From 851fb93dd3d1778da12752977cfbe4fff7d65ecb Mon Sep 17 00:00:00 2001 From: makefu Date: Mon, 29 Aug 2011 10:05:36 +0200 Subject: punani: add dryrun,hard,filebased search punani is now able to search for packages via files and packages in debian-based and arch-based systems. Fix bug in punani godmode --- punani/bin/punani | 156 ++++++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 122 insertions(+), 34 deletions(-) diff --git a/punani/bin/punani b/punani/bin/punani index 7af6f0f8..f01cedb7 100755 --- a/punani/bin/punani +++ b/punani/bin/punani @@ -6,7 +6,7 @@ # -E -i spec insert a package to the target filesystem # -E -r spec remove a package # - +set -euf godmode() { if test "${nosudo-false}" != true -a `id -u` != 0; then echo "Warning: we require god mode..." >&2 @@ -15,44 +15,44 @@ godmode() { fi } -if pacman --version 2>/dev/null | fgrep -q Pacman; then - system="${system+$system, }arch-like" -fi +# return the 'system' variable +# currently be: +# arch-like +# debian-like +guess_system() +{ + if [ -f "/etc/arch-release" ] ;then + system="${system+$system, }arch-like" + fi + if [ -f "/etc/lsb-release" -o -f "/etc/debian_version" ] ;then + system="${system+$system, }debian-like" + fi -case "$system" in - (*arch-like*) - punani_Engineer_insert() { - pacman -Sy "$1" - } - punani_Engineer_remove() { - pacman -Rcs "$1" - } - ;; - (*) - email='krebs@syntax-fehler.de' - irc_host='irc.freenode.org' - irc_channel='#tincspasm' - cat>&2<&2<