From: Dennis Groenen Date: Tue, 16 Oct 2012 17:06:12 +0000 (+0200) Subject: modify checks in (un)installation script X-Git-Tag: 1.20.2power4~11 X-Git-Url: http://vcs.maemo.org/git/?p=busybox-power;a=commitdiff_plain;h=8d62bf2df42a696092469ca3d0d9511ae3643955 modify checks in (un)installation script --- diff --git a/debian/busybox-power.postinst b/debian/busybox-power.postinst index 74a2edb..eefd139 100644 --- a/debian/busybox-power.postinst +++ b/debian/busybox-power.postinst @@ -18,6 +18,7 @@ EXECPWR="$INSTALLDIR/busybox.power" DISTBIN="/bin/busybox.distrib" VERBOSE="0" +SYMLINK="1" INSTBINARY_SHA1=`$EXECPWR sha1sum $EXECPWR | $EXECPWR awk '{ print $1 }'` ORIGBINARY_SHA1=`$EXECPWR sha1sum /bin/busybox | $EXECPWR awk '{ print $1 }'` @@ -36,9 +37,8 @@ CHECK_APPLETSFILE() { # Check whether symlinks have been made before CHECK_SYMLINKSFILE() { if test -e $INSTALLDIR/busybox-power.symlinks; then - echo "error: symlinks already seem to be made?" - echo " this script is not supposed to be ran twice" - exit 1 + ECHO_VERBOSE "symlinks are already made, skipping creation" + SYMLINK="0" fi } @@ -132,12 +132,14 @@ ECHO_VERBOSE " binary: $EXECPWR" ECHO_VERBOSE " version string: `$EXECPWR | $EXECPWR head -n 1`" CHECK_ENV && ECHO_VERBOSE " environment: $ENVIRONMENT" -CHECK_STANDALONE CHECK_APPLETSFILE CHECK_SYMLINKSFILE if test "$ENVIRONMENT" != "SDK"; then - CHECK_ROOT; fi + CHECK_ROOT +fi BACKUP INSTALL -SYMLINK +if test $SYMLINK == 1; then + SYMLINK +fi diff --git a/debian/busybox-power.prerm b/debian/busybox-power.prerm index dafdf88..005916b 100644 --- a/debian/busybox-power.prerm +++ b/debian/busybox-power.prerm @@ -184,13 +184,12 @@ ECHO_VERBOSE " binary: $EXECPWR" ECHO_VERBOSE " version string: `$EXECPWR | $EXECPWR head -n 1`" CHECK_ENV && ECHO_VERBOSE " environment: $ENVIRONMENT" -CHECK_STANDALONE CHECK_SYMLINKSFILE if test "$ENVIRONMENT" != "SDK"; then CHECK_ROOT - CHECK_BACKUP - CHECK_INSTALLEDBIN fi +CHECK_BACKUP +CHECK_INSTALLEDBIN if test -e /tmp/busybox-power-error; then # An error has occured during the checks DISPLAY_ERRORS diff --git a/debian/scripts/functions b/debian/scripts/functions index 6d532b6..436b277 100644 --- a/debian/scripts/functions +++ b/debian/scripts/functions @@ -31,24 +31,10 @@ CHECK_ENV() { fi } -# Check whether I'm running standalone -CHECK_STANDALONE() { - #if test -n "`pgrep dpkg`" -o "`pgrep apt`" - if ! lsof /var/lib/dpkg/lock >> /dev/null; then - echo "error: you're running me as a stand-alone application" - echo " do not do this, I will be called automatically when" - echo " required by busybox-power" - exit 1 - fi -} - # Check whether the user is root CHECK_ROOT() { if test "`$EXECPWR id -u`" -ne 0; then - echo "error: you're not running me as root, aborting" - echo " also, DO NOT run me as a stand-alone application" - echo " I will be called automatically when required by" - echo " busybox-power" + echo "error: you're not running me as root" exit 1 fi }