1 #!/bin/bash 2 # Usage: user-dpkg-i <package-file> 3 4 # Configuration: 5 if [ -e userinstall-defaults ]; then 6 source userinstall-defaults 7 elif [ -e /etc/default/userinstall ]; then 8 source /etc/default/userinstall 9 else 10 echo "No defaults found for userinstall." 11 exit 1 12 fi 13 14 if [[ $1 == "--help" ]]; then 15 echo "Usage: user-dpkg-i <package-file>" 16 echo 17 echo "Examples:" 18 echo 19 echo "user-dpkg-i downloads/python-cmdsyntax_0.91-0ubuntu2_all.deb" 20 exit 1 21 fi 22 23 export PERSONAL=$PACKAGEROOT/personal 24 25 if [ ! -e $PERSONAL ]; then 26 mkdir $PERSONAL 27 fi 28 29 if [ ! $1 ]; then 30 echo "Please specify a package file." 31 exit 1 32 fi 33 34 export PACKAGEFILE=`basename $1` 35 export PPACKAGEFILE=$PERSONAL/$PACKAGEFILE 36 37 cp $1 $PPACKAGEFILE 38 fakeroot fakechroot $FAKECHROOT_OPTIONS chroot $PACKAGEROOT dpkg -i $PPACKAGEFILE