Browse code

Merge "deb" and "debian" plugins.

Daniel Bolton authored on 06/08/2011 at 19:22:55
Showing 2 changed files
1 1
deleted file mode 100644
... ...
@@ -1,13 +0,0 @@
1
-# Aliases
2
-alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \
3
-		--no-gui --disable-columns search"	# search package
4
-alias ad="sudo apt-get update"				# update packages lists
5
-alias au="sudo apt-get update && \
6
-		sudo apt-get dselect-upgrade"		# upgrade packages
7
-alias ai="sudo apt-get install"				# install package
8
-alias ar="sudo apt-get remove --purge && \
9
-		sudo apt-get autoremove --purge"	# remove package
10
-alias ap="apt-cache policy"				# apt policy
11
-alias av="apt-cache show"				# show package info
12
-alias acs="apt-cache search"                            # search package
13
-alias ac="sudo apt-get clean && sudo apt-get autoclean" # clean apt cache
... ...
@@ -1,4 +1,4 @@
1
-# https://github.com/dbbolton/
1
+# https://github.com/dbb/
2 2
 #
3 3
 # Debian-related zsh aliases and functions for zsh
4 4
 
... ...
@@ -6,14 +6,29 @@
6 6
 # Aliases ###################################################################
7 7
 
8 8
 # Some self-explanatory aliases
9
+alias acs="apt-cache search"
9 10
 alias afs='apt-file search --regexp'
10 11
 alias aps='aptitude search'
12
+alias as="aptitude -F \"* %p -> %d \n(%v/%V)\" \
13
+		--no-gui --disable-columns search"	# search package
11 14
 alias apsrc='apt-get source'
12 15
 alias apv='apt-cache policy'
13 16
 
17
+# aliases that use su -c ##############
14 18
 alias apdg='su -c "aptitude update && aptitude safe-upgrade"'
15 19
 alias apud='su -c "aptitude update"'
16 20
 alias apug='su -c "aptitude safe-upgrade"'
21
+# end aliases that use su -c ##########
22
+
23
+# aliases that use sudo ###############
24
+alias ad="sudo apt-get update"				# update packages lists
25
+alias au="sudo apt-get update && \
26
+		sudo apt-get dselect-upgrade"		# upgrade packages
27
+alias ai="sudo apt-get install"				# install package
28
+alias ar="sudo apt-get remove --purge && \
29
+		sudo apt-get autoremove --purge"	# remove package
30
+alias ac="sudo apt-get clean && sudo apt-get autoclean" # clean apt cache
31
+# end aliases that use sudo ###########
17 32
 
18 33
 # print all installed packages
19 34
 alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
... ...
@@ -33,6 +48,13 @@ alias kclean='su -c '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`unam
33 33
 
34 34
 # Functions #################################################################
35 35
 
36
+# install packages without sudo
37
+apin() {
38
+    cmd="su -lc 'aptitude -P install $@' root"
39
+    print "$cmd"
40
+    eval "$cmd"
41
+}
42
+
36 43
 # create a simple script that can be used to 'duplicate' a system
37 44
 apt-copy() {
38 45
 	print '#!/bin/sh'"\n" > apt-copy.sh
... ...
@@ -46,8 +68,10 @@ apt-copy() {
46 46
 
47 47
 
48 48
 # Kernel-package building shortcut
49
-dbb-build () {
50
-	MAKEFLAGS=''		# temporarily unset MAKEFLAGS ( '-j3' will fail )
49
+kerndeb () {
50
+    # temporarily unset MAKEFLAGS ( '-j3' will fail )
51
+    MAKEFLAGS=$( print - $MAKEFLAGS | perl -pe 's/-j\s*[\d]+//g' )		
52
+    print '$MAKEFLAGS set to '"'$MAKEFLAGS'"
51 53
 	appendage='-custom' # this shows up in $ (uname -r )
52 54
     revision=$(date +"%Y%m%d") # this shows up in the .deb file name
53 55