Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
adam.huang
Oh My Zsh
Commits
ae3f5e49
Commit
ae3f5e49
authored
Dec 26, 2011
by
Robby Russell
Browse files
Merge pull request #693 from dreur/upstream-debian-apt-history
Add apt-history function to debian plugin
parents
22b99779
452f1213
Changes
1
Show whitespace changes
Inline
Side-by-side
plugins/debian/debian.plugin.zsh
View file @
ae3f5e49
...
@@ -113,9 +113,6 @@ alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
...
@@ -113,9 +113,6 @@ alias allpkgs='aptitude search -F "%p" --disable-columns ~i'
alias
mydeb
=
'time dpkg-buildpackage -rfakeroot -us -uc'
alias
mydeb
=
'time dpkg-buildpackage -rfakeroot -us -uc'
# Functions #################################################################
# Functions #################################################################
# create a simple script that can be used to 'duplicate' a system
# create a simple script that can be used to 'duplicate' a system
apt-copy
()
{
apt-copy
()
{
...
@@ -132,6 +129,41 @@ apt-copy() {
...
@@ -132,6 +129,41 @@ apt-copy() {
chmod
+x apt-copy.sh
chmod
+x apt-copy.sh
}
}
# Prints apt history
# Usage:
# apt-history install
# apt-history upgrade
# apt-history remove
# apt-history rollback
# apt-history list
# Based On: http://linuxcommando.blogspot.com/2008/08/how-to-show-apt-log-history.html
apt-history
()
{
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
*
)
;;
*
)
echo
"Parameters:"
echo
" install - Lists all packages that have been installed."
echo
" upgrade - Lists all packages that have been upgraded."
echo
" remove - Lists all packages that have been removed."
echo
" rollback - Lists rollback information."
echo
" list - Lists all contains of dpkg logs."
;;
esac
}
# Kernel-package building shortcut
# Kernel-package building shortcut
kerndeb
()
{
kerndeb
()
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment