1 #!/bin/sh 2 3 # Copyright (C) 2010, 2011, 2012, 2013 Paul Boddie <paul@boddie.org.uk> 4 # 5 # This program is free software; you can redistribute it and/or modify it under 6 # the terms of the GNU General Public License as published by the Free Software 7 # Foundation; either version 3 of the License, or (at your option) any later 8 # version. 9 # 10 # This program is distributed in the hope that it will be useful, but WITHOUT 11 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 12 # FOR A PARTICULAR PURPOSE. See the GNU General Public License for more 13 # details. 14 # 15 # You should have received a copy of the GNU General Public License along with 16 # this program. If not, see <http://www.gnu.org/licenses/>. 17 18 # Configuration: 19 if [ -e userinstall-defaults ]; then 20 . "$PWD/userinstall-defaults" 21 elif [ -e /etc/default/userinstall ]; then 22 . /etc/default/userinstall 23 else 24 echo "No defaults found for userinstall." 1>&2 25 exit 1 26 fi 27 28 THISDIR=`dirname "$0"` 29 30 if [ "$1" = '--help' ]; then 31 echo "Usage: `basename $0` [ --root [ --dev ] ] [ <command and options> ]" 32 exit 1 33 elif [ "$1" = '--root' ]; then 34 shift 1 35 sudo "$THISDIR/user-do-root" $* 36 else 37 fakeroot fakechroot $FAKECHROOT_OPTIONS /usr/sbin/chroot "$PACKAGEROOT" $* 38 fi