summaryrefslogtreecommitdiff
path: root/plugins/debian/debian.plugin.zsh
diff options
context:
space:
mode:
authorFredrik Appelberg <fredrik.appelberg@gmail.com>2011-03-23 09:20:24 +0100
committerFredrik Appelberg <fredrik.appelberg@gmail.com>2011-03-23 09:20:24 +0100
commit9092bf7b53b9e24a5283aeb6dd6950c3238e5cb8 (patch)
tree956405ade580b169c85f4be4397ebbe02a3f94d5 /plugins/debian/debian.plugin.zsh
parentf61a395587327b68e25ee7b5390d8888dde314c2 (diff)
parent52df85440ee8ead8f17d3aa3e1fedf187162313c (diff)
downloadzsh-9092bf7b53b9e24a5283aeb6dd6950c3238e5cb8.tar.gz
zsh-9092bf7b53b9e24a5283aeb6dd6950c3238e5cb8.tar.bz2
zsh-9092bf7b53b9e24a5283aeb6dd6950c3238e5cb8.zip
Merge branch 'master' of git://github.com/robbyrussell/oh-my-zsh
Diffstat (limited to 'plugins/debian/debian.plugin.zsh')
-rw-r--r--plugins/debian/debian.plugin.zsh60
1 files changed, 60 insertions, 0 deletions
diff --git a/plugins/debian/debian.plugin.zsh b/plugins/debian/debian.plugin.zsh
new file mode 100644
index 000000000..f8865a412
--- /dev/null
+++ b/plugins/debian/debian.plugin.zsh
@@ -0,0 +1,60 @@
+# https://github.com/dbbolton/
+#
+# Debian-related zsh aliases and functions for zsh
+
+
+# Aliases ###################################################################
+
+# Some self-explanatory aliases
+alias afs='apt-file search --regexp'
+alias aps='aptitude search'
+alias apsrc='apt-get source'
+alias apv='apt-cache policy'
+
+alias apdg='su -c "aptitude update && aptitude safe-upgrade"'
+alias apud='su -c "aptitude update"'
+alias apug='su -c "aptitude safe-upgrade"'
+
+# print all installed packages
+alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
+
+# Install all .deb files in the current directory.
+# Warning: you will need to put the glob in single quotes if you use:
+# glob_subst
+alias di='su -c "dpkg -i ./*.deb"'
+
+# Create a basic .deb package
+alias mydeb='time dpkg-buildpackage -rfakeroot -us -uc'
+
+# Remove ALL kernel images and headers EXCEPT the one in use
+alias kclean='su -c '\''aptitude remove -P ?and(~i~nlinux-(ima|hea) ?not(~n`uname -r`))'\'' root'
+
+
+
+# Functions #################################################################
+
+# create a simple script that can be used to 'duplicate' a system
+apt-copy() {
+ print '#!/bin/sh'"\n" > apt-copy.sh
+
+ list=$(perl -m'AptPkg::Cache' -e '$c=AptPkg::Cache->new; for (keys %$c){ push @a, $_ if $c->{$_}->{'CurrentState'} eq 'Installed';} print "$_ " for sort @a;')
+
+ print 'aptitude install '"$list\n" >> apt-copy.sh
+
+ chmod +x apt-copy.sh
+}
+
+
+# Kernel-package building shortcut
+dbb-build () {
+ MAKEFLAGS='' # temporarily unset MAKEFLAGS ( '-j3' will fail )
+ appendage='-custom' # this shows up in $ (uname -r )
+ revision=$(date +"%Y%m%d") # this shows up in the .deb file name
+
+ make-kpkg clean
+
+ time fakeroot make-kpkg --append-to-version "$appendage" --revision \
+ "$revision" kernel_image kernel_headers
+}
+
+