From 1d1eef195996f19b212c6496da9f928c5c38a8be Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Tue, 24 Feb 2009 10:01:20 -0800 Subject: makechrootpkg: Remove $CHROOT_SHELL env var This was kinda useless and complicated. We'll just force -r usage Signed-off-by: Aaron Griffin --- makechrootpkg | 37 ++++++++++++++++++------------------- 1 file changed, 18 insertions(+), 19 deletions(-) (limited to 'makechrootpkg') diff --git a/makechrootpkg b/makechrootpkg index 43a2253..c4f47ef 100755 --- a/makechrootpkg +++ b/makechrootpkg @@ -13,32 +13,30 @@ RUN="" MAKEPKG_ARGS="-sr" REPACK="" WORKDIR=$PWD + update_first="0" clean_first="0" install_pkg="" -chrootdir="$CHROOT_SHELL" +chrootdir="" APPNAME=$(basename "${0}") usage () { - echo "usage ${APPNAME} [-hcuI] [-r CHROOT_SHELL] [--] [makepkg args]" + echo "usage ${APPNAME} [-hcu] -r [--] [makepkg args]" + echo " ${APPNAME} -r -I " echo " Run this script in a PKGBUILD dir to build a package inside a" echo " clean chroot. All unrecognized arguments passed to this script" echo " will be passed to makepkg." echo "" - echo "The \$CHROOT_SHELL environment variable is used to determine where" - echo " your chroot shell is. The shell consists of the following" - echo " directories: \$CHROOT_SHELL/{root, rw, union} but only 'root' is" - echo " required by default. The rest will be created as needed" + echo " The chroot dir consists of the following directories:" + echo " /{root, rw, union} but only 'root' is required" + echo " by default. The rest will be created as needed" echo "" - echo "The chroot shell 'root' directory must be created via the following" + echo "The chroot 'root' directory must be created via the following" echo "command:" - echo " mkarchroot \$CHROOT_SHELL/root base base-devel sudo" - echo "" - echo "If you have problems passing params to makepkg or need to pass long" - echo "options, put -- between the makechrootpkg args and the makepkg args" + echo " mkarchroot /root base base-devel sudo" echo "" echo "Default makepkg args: $MAKEPKG_ARGS" echo "" @@ -48,17 +46,18 @@ usage () echo "-u Update the rw layer of the chroot before building" echo " This is useful for rebuilds without dirtying the pristine" echo " chroot" + echo "-r The chroot shell to use" echo "-I Install a package into the rw layer of the chroot" exit 1 } -while getopts ':r:I:h:cu' arg; do +while getopts 'hcur:I:' arg; do case "${arg}" in + h) usage ;; + c) clean_first=1 ;; + u) update_first=1 ;; r) chrootdir="$OPTARG" ;; I) install_pkg="$OPTARG" ;; - u) update_first=1 ;; - c) clean_first=1 ;; - h|?) usage ;; *) MAKEPKG_ARGS="$MAKEPKG_ARGS -$arg $OPTARG" ;; esac done @@ -89,13 +88,13 @@ fi source PKGBUILD if [ ! -d "$chrootdir" ]; then - echo "No \$CHROOT_SHELL defined, or invalid path ($chrootdir)" + echo "No chroot dir defined, or invalid path '$chrootdir'" exit 1 fi if [ ! -d "$chrootdir/root" ]; then - echo "Missing \$CHROOT_SHELL root directory." - echo "Try using: mkarchroot \$CHROOT_SHELL base base-devel sudo" + echo "Missing chroot dir root directory." + echo "Try using: mkarchroot $chrootdir/root base base-devel sudo" usage fi @@ -229,7 +228,7 @@ if [ -z "$(mount | grep ${chrootdir}/union/srcdest)" ]; then fi if [ -e ${chrootdir}/rw/build/BUILD_FAILED ]; then - echo "Build failed, check \$CHROOT_DIR/rw/build" + echo "Build failed, check $chrootdir/rw/build" rm ${chrootdir}/rw/build/BUILD_FAILED else rm -rf ${chrootdir}/rw/build/* -- cgit v1.2.3-24-g4f1b