init
This commit is contained in:
25
.zprezto/modules/dpkg/functions/deb-clone
Normal file
25
.zprezto/modules/dpkg/functions/deb-clone
Normal file
@@ -0,0 +1,25 @@
|
||||
#
|
||||
# Generates a script that can be used to duplicate a dpkg-based system.
|
||||
#
|
||||
# Authors:
|
||||
# Daniel Bolton <danielbarrettbolton@gmail.com>
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
local clone_script="${0}.sh"
|
||||
local package_list=$(
|
||||
perl \
|
||||
-m 'AptPkg::Cache' \
|
||||
-e '
|
||||
$c=AptPkg::Cache->new;
|
||||
for (keys %$c) {
|
||||
push @a, $_ if $c->{$_}->{'CurrentState'} eq 'Installed';
|
||||
}
|
||||
print "$_ " for sort @a;
|
||||
'
|
||||
)
|
||||
|
||||
rm "$clone_script"
|
||||
print '#!/bin/sh\n' > "$clone_script"
|
||||
print "aptitude install ${package_list}\n" >> "$clone_script"
|
||||
chmod +x "$clone_script"
|
36
.zprezto/modules/dpkg/functions/deb-history
Normal file
36
.zprezto/modules/dpkg/functions/deb-history
Normal file
@@ -0,0 +1,36 @@
|
||||
#
|
||||
# Displays dpkg history.
|
||||
#
|
||||
# Authors:
|
||||
# Peter Leung <commandolinux@gmail.com>
|
||||
# Benjamin Boudreau <boudreau.benjamin@gmail.com>
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
case "$1" in
|
||||
(install)
|
||||
zgrep --no-filename 'install ' $(ls -rt /var/log/dpkg*)
|
||||
;;
|
||||
(upgrade|remove)
|
||||
zgrep --no-filename "$1" $(ls -rt /var/log/dpkg*)
|
||||
;;
|
||||
(rollback)
|
||||
zgrep --no-filename upgrade $(ls -rt /var/log/dpkg*) \
|
||||
| grep "$2" -A10000000 \
|
||||
| grep "$3" -B10000000 \
|
||||
| awk '{print $4"="$5}'
|
||||
;;
|
||||
(list)
|
||||
zcat $(ls -rt /var/log/dpkg*)
|
||||
;;
|
||||
(*)
|
||||
cat >&2 <<EOF
|
||||
Commands:
|
||||
install - List installed packages
|
||||
upgrade - List upgraded packages
|
||||
remove - List removed packages
|
||||
rollback - List rollback information
|
||||
list - Display contents of dpkg logs
|
||||
EOF
|
||||
;;
|
||||
esac
|
14
.zprezto/modules/dpkg/functions/deb-kbuild
Normal file
14
.zprezto/modules/dpkg/functions/deb-kbuild
Normal file
@@ -0,0 +1,14 @@
|
||||
#
|
||||
# Makes a dpkg Linux kernel package.
|
||||
#
|
||||
# Authors:
|
||||
# Daniel Bolton <dbb@9y.com>
|
||||
# Sorin Ionescu <sorin.ionescu@gmail.com>
|
||||
#
|
||||
|
||||
make-kpkg clean
|
||||
MAKEFLAGS='' time fakeroot make-kpkg \
|
||||
--append-to-version '-custom' \
|
||||
--revision "$(date +"%Y%m%d")" \
|
||||
kernel_image \
|
||||
kernel_headers
|
Reference in New Issue
Block a user