diff options
author | Simone Rota <simone@sip.local> | 2006-07-13 04:59:42 +0200 |
---|---|---|
committer | Simone Rota <simone@sip.local> | 2006-07-13 04:59:42 +0200 |
commit | 2570da93a052b866ea67a8407a8c2672defe28e9 (patch) | |
tree | 7f47c5a3d185a6ec79787d6fbfb74a8b454bdf8c | |
parent | b1b1753243b1f3488b1aa10646b5fa2c0a05983c (diff) | |
download | pkg-get-2570da93a052b866ea67a8407a8c2672defe28e9.tar.gz pkg-get-2570da93a052b866ea67a8407a8c2672defe28e9.tar.xz |
Addedd --all switch for diff command
-rw-r--r-- | doc/pkg-get.8 | 6 | ||||
-rw-r--r-- | doc/pkg-get.8.txt | 2 | ||||
-rwxr-xr-x | scripts/pkg-get.pl | 13 |
3 files changed, 15 insertions, 6 deletions
diff --git a/doc/pkg-get.8 b/doc/pkg-get.8 index 1ec46a0..1f8cd58 100644 --- a/doc/pkg-get.8 +++ b/doc/pkg-get.8 @@ -1,5 +1,5 @@ ." Text automatically generated by txt2man-1.4.7 -.TH pkg-get 8 "April 23, 2006" "" "" +.TH pkg-get 8 "July 13, 2006" "" "" .SH NAME \fBpkg-get \fP- a package management tool for CRUX Linux \fB @@ -29,8 +29,8 @@ Update given packages, download if necessary. .TP .B -diff -Show a list of outdated packages. +diff [\fB--all\fP] +Show a list of outdated packages. The \fB--all\fP option also displays locked packages. .TP .B quickdiff diff --git a/doc/pkg-get.8.txt b/doc/pkg-get.8.txt index aee645a..99a9d36 100644 --- a/doc/pkg-get.8.txt +++ b/doc/pkg-get.8.txt @@ -17,7 +17,7 @@ COMMANDS download if necessary. update <package1> [<package2>..<packageN>] Update given packages, download if necessary. - diff Show a list of outdated packages. + diff [--all] Show a list of outdated packages. The --all option also displays locked packages. quickdiff Show a compact list of outdated packages. sysup Update all outdated packages. Download if necessary. depinst <package1> [<package2>..<packageN>] Install given packages diff --git a/scripts/pkg-get.pl b/scripts/pkg-get.pl index 5fe394f..5ab5796 100755 --- a/scripts/pkg-get.pl +++ b/scripts/pkg-get.pl @@ -936,13 +936,22 @@ sub diff { %pkg = parsepackage($_, $dir, $url, 1); if (not $found{$pkg{'name'}}) { if ($pkg{'instversion'}) { - if ($pkg{'instversion'} ne $pkg{'version'}."-".$pkg{'release'} and (islocked($pkg{'name'}) eq "no")) { + if ($pkg{'instversion'} ne $pkg{'version'}."-".$pkg{'release'}) { + if (islocked($pkg{'name'}) eq "no") { if ($gotdiff == 0){ print "Differences between installed packages and packages repo:\n\n"; printf("%-19s %-19s %-19s\n\n","Package","Installed","Available in the repositories"); $gotdiff = 1; } - printf("%-19s %-19s %-19s\n", $pkg{'name'}, $pkg{'instversion'}, $pkg{'version'}."-".$pkg{'release'}); + printf("%-19s %-19s %-19s %-19s\n", $pkg{'name'}, $pkg{'instversion'}, $pkg{'version'}."-".$pkg{'release'}); + } elsif ($all) { # yeah, it blows, at least avoid to read the locked state twice. + if ($gotdiff == 0){ + print "Differences between installed packages and packages repo:\n\n"; + printf("%-19s %-19s %-19s\n\n","Package","Installed","Available in the repositories"); + $gotdiff = 1; + } + printf("%-19s %-19s %-19s %-19s\n", $pkg{'name'}, $pkg{'instversion'}, $pkg{'version'}."-".$pkg{'release'}, "locked"); + } } } $found{$pkg{'name'}} = 1; |