summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Makefile.am2
-rwxr-xr-xscripts/vyatta-show-version (renamed from scripts/show_version)20
2 files changed, 17 insertions, 5 deletions
diff --git a/Makefile.am b/Makefile.am
index 65b0a7f..1f12ffc 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -5,7 +5,7 @@ completion_DATA = etc/bash_completion.d/vyatta-op
opdir = $(datadir)/vyatta-op/templates
bin_SCRIPTS = scripts/vyatta-show-interfaces
-bin_SCRIPTS += scripts/show_version
+bin_SCRIPTS += scripts/vyatta-show-version
cpiop = find . ! -regex '\(.*~\|.*\.bak\|.*\.swp\|.*\#.*\#\)' -print0 | \
cpio -0pd
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: