2 # This file contains functions that are used in multiple other scripts, i.e.
3 # shared functions. The purpose of centralising these, is to deduplicate code
4 # and increase maintainability
6 # By Dennis Groenen <tj.groenen@gmail.com>
9 # Last updated: 08-24-2012 (MM-DD-YYYY)
14 if test $VERBOSE == 1; then
18 # Detect the current environment
20 if test -d /scratchbox; then
23 PROD=$($EXECPWR cat /proc/component_version | $EXECPWR grep product | $EXECPWR cut -d" " -f 6)
26 ENVIRONMENT="FREMANTLE"
29 # Unsupported, use the least strict environment (SDK)
36 # Check whether I'm running standalone
38 #if test -n "`pgrep dpkg`" -o "`pgrep apt`"
39 if ! lsof /var/lib/dpkg/lock >> /dev/null; then
40 echo "error: you're running me as a stand-alone application"
41 echo " do not do this, I will be called automatically when"
42 echo " required by busybox-power"
47 # Check whether the user is root
49 if test "`$EXECPWR id -u`" -ne 0; then
50 echo "error: you're not running me as root, aborting"
51 echo " also, DO NOT run me as a stand-alone application"
52 echo " I will be called automatically when required by"