X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=scripts%2Fdistrib-info;h=241127e5632225d238fdb7549059726853a33b90;hb=05bfe19d376b0d44127dd3b9dc7dfc2ced0aaf3f;hp=5a35f5eb0a752e86f3da5d32db066c6e17ff3388;hpb=96b9bc3416686cb4080beb8bda4283edaefafbe2;p=util-vserver.git diff --git a/scripts/distrib-info b/scripts/distrib-info index 5a35f5e..241127e 100755 --- a/scripts/distrib-info +++ b/scripts/distrib-info @@ -2,7 +2,8 @@ # Copyright (C) 2003 Enrico Scholz # based on distrib-info by Jacques Gelinas -# +# Debian support shoe-horned in by Matthew Lavy +# # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) @@ -71,6 +72,27 @@ if [ -f $DIRDIR/etc/redhat-release -o -f $DISTDIR/etc/mandrake-release ] ; then echo unknown request $KEY >&2 ;; esac +elif [ -f $DISTDIR/etc/debian_version ] ; then + case $KEY in + pkgversion) + $CHROOTCMD /usr/bin/dpkg-query -W \ + --showformat='${Package}=${Version}#${Status}\n' \ + | perl -pe 's/(.+)-.*/$1/' \ + | grep "install ok installed" | cut -d"#" -f1 + ;; + unifiles) + echo $* | perl -pe 's/(.+)-.*/$1/' \ + | xargs $CHROOTCMD /usr/bin/dpkg -L \ + | grep -v "^/etc\|^/var" + ;; + dumpfiles) + echo $* | perl -pe 's/(.+)-.*/$1/' \ + | xargs $CHROOTCMD /usr/bin/dpkg -L + ;; + *) + echo unknown request $KEY >&2 + ;; + esac else echo Distribution not supported yet >&2 fi