summaryrefslogtreecommitdiff
path: root/scripts
diff options
context:
space:
mode:
authorTom Grennan <tgrennan@vyatta.com>2007-09-27 17:35:57 -0700
committerTom Grennan <tgrennan@vyatta.com>2007-09-27 17:35:57 -0700
commit3a78e323730c87d006d36fd1f8c30ce16164b945 (patch)
treee83f2b6eade1dd367b2bc71c45e79a5daaf03088 /scripts
parentb47d02e999233cb8b87b7dbc62a28a6a1701aa69 (diff)
downloadvyatta-op-3a78e323730c87d006d36fd1f8c30ce16164b945.tar.gz
vyatta-op-3a78e323730c87d006d36fd1f8c30ce16164b945.zip
rename show_version to vyatta-show-version
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/vyatta-show-version (renamed from scripts/show_version)20
1 files changed, 16 insertions, 4 deletions
diff --git a/scripts/show_version b/scripts/vyatta-show-version
index ffb2da0..636f2c0 100755
--- a/scripts/show_version
+++ b/scripts/vyatta-show-version
@@ -23,12 +23,24 @@
# TODO add other version info
-for cl in /usr/share/doc/vyatta-*/changelog.gz ; do
- dir=${cl%/*} ;
- pkg=${dir##*/} ;
+shopt -s extglob
+shopt -s nullglob
+
+declare -a cls=( /usr/share/doc/vyatta-*/changelog.gz )
+declare -a cl_dirs=( ${cls[@]%/*} )
+declare -a pkgs=( ${cl_dirs[@]##*/} )
+
+dpkg -l ${pkgs[@]}
+
+cat <<EOF
+
+Source Repositories
+EOF
+
+for pkg in ${pkgs[@]} ; do
printf " %-20s " ${pkg} ;
test ${#pkg} -lt 20 || echo -ne \\n\\t ;
- gunzip -c $cl | tail -n1 ;
+ gunzip -c /usr/share/doc/$pkg/changelog.gz | tail -n1 ;
done
### Local Variables: