Browse Source

updated vbuilder.sh.in: added --bootstrap-dir --built-rpms-dir options

git-svn-id: http://trac.vinelinux.org/repos/projects/vbootstrap/trunk@709 ec354946-7b23-47d6-9f5a-488ba84defc7
munepi 14 years ago
parent
commit
8f94d45fab
3 changed files with 25 additions and 8 deletions
  1. 6 1
      vbootstrap-vl.spec
  2. 1 2
      vbuilder-bash-completion.sh
  3. 18 5
      vbuilder.sh.in

+ 6 - 1
vbootstrap-vl.spec

@@ -1,7 +1,7 @@
 # This package is maintained on trac svn repository. Please do not change on local.
 # If you find a BUG, please report to Vine@vinelinux.org or mailing list or BTS.
 
-%define version 0.0.21
+%define version 0.0.22
 
 Summary: bootstrap scripts to create a basic Vine Linux system
 Summary(ja): Vine Linux の基本システムを作成するためのスクリプト
@@ -72,6 +72,11 @@ vbuilder は vbootstrap を利用して chroot 環境の構築し、
 
 
 %changelog
+* Mon Mar 29 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.22-1
+- updated vbuilder.sh.in: 
+  - added --bootstrap-dir --built-rpms-dir options
+- updated vbuilder-bash-completion.sh
+
 * Fri Mar 26 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.21-1
 - updated vbuilder.sh.in: 
   - added a compatible name for actions: 

+ 1 - 2
vbuilder-bash-completion.sh

@@ -23,8 +23,7 @@ _vbuilder()
 
     ## The basic options we'll complete.
     options="--version --arch --dist-upgrade --unionfs --target --with-compat32"
-    actions="--clean --build --build-rpm --install-rpm --remove-rpm \
-             clean build build-rpm install-rpm remove-rpm"
+    actions="clean build build-rpm install-rpm remove-rpm"
     opts="$options $actions"
 
     _arch=$(rpm --eval %_arch)

+ 18 - 5
vbuilder.sh.in

@@ -3,7 +3,7 @@
 
 Usage_C(){
     cat<<EOF
-Usage:	$(basename $0) {--version [version]} {--arch [arch]} {--dist-upgrade} {--target [target]} {--with-compat32} {clean|build|build-rpm [src.rpm]|install-rpm [arch.rpm|package]|remove-rpm [package]}
+Usage:	$(basename $0) {--version [version]} {--arch [arch]} {--dist-upgrade} {--target [target]} {--with-compat32} {--bootstrap-dir [directory]} {--built-rpms-dir [directory]} {clean|build|build-rpm [src.rpm]|install-rpm [arch.rpm|package]|remove-rpm [package]}
 
 Options:
 	--version:		set [version] (default: ${DEFAULT_VERSION})
@@ -12,6 +12,8 @@ Options:
 	--unionfs		cover a bootstrap with unionfs
 	--target:		build rpms with [target]
 	--with-compat32:	build rpms with compat32 on boostrap
+	--bootstrap-dir:	set a bootstrap directory (default: ${VBOOTSTRAP_DIR})
+	--built-rpms-dir:	set a directory to store built rpms in chroot (default: ${BUILT_RPMS_DIR})
 
 Actions:
 	clean:			clean the boostrap of [version]
@@ -141,7 +143,7 @@ check-parameter(){
 		Usage_$LOCALE
 		return 1
 		;;
-	    --version|--arch|--target|--build-rpm|build-rpm|--install-rpm|install-rpm|--remove-rpm|remove-rpm)
+	    --version|--arch|--target|--bootstrap-dir|--built-rpms-dir|--build-rpm|build-rpm|--install-rpm|install-rpm|--remove-rpm|remove-rpm)
 		shift
 		check-next-parameter $1 || return 1
 		;;
@@ -182,10 +184,11 @@ setup-vbuilder(){
 	DEFAULT_VERSION=@@VBUILDER_DEFAULT_VERSION@@
     [ -z "${BUILT_RPMS_DIR}" ] && \
 	BUILT_RPMS_DIR=@@VBUILDER_BUILT_RPMS_DIR@@
-    [ -d $VBOOTSTRAP_DIR ] || mkdir -p $VBOOTSTRAP_DIR
+
+    ## set default version for vbootstrap
     VERSION=$DEFAULT_VERSION
 
-    ## current stable relase version
+    ## set current stable relase version
     STABLE_VERSION=@@VBUILDER_STABLE_VERSION@@
 
     ## set locale
@@ -204,6 +207,10 @@ setup-vbootstrap(){
     if [ ${with_setup_vbootstrap} -eq 0 ]; then
 	with_setup_vbootstrap=1
 
+        ## check some directories
+        ## Note: create $BUILT_RPMS_DIR in RPM_Build()
+	[ -d $VBOOTSTRAP_DIR ] || mkdir -p $VBOOTSTRAP_DIR
+
 	## check a chroot archtecture
 	if [ ! -z ${VARCH} ]; then
 	    case "${VARCH}" in
@@ -605,7 +612,7 @@ check-parameter $* || exit 1
 while [ $# -gt 0 ]; do
     tmpARG=$1
     case $tmpARG in
-	--version|--arch|--target|--build-rpm|build-rpm|--install-rpm|install-rpm|--remove-rpm|remove-rpm)
+	--version|--arch|--target|--bootstrap-dir|--built-rpms-dir|--build-rpm|build-rpm|--install-rpm|install-rpm|--remove-rpm|remove-rpm)
 	    shift
 	    ;;
 	--dist-upgrade|--unionfs|--with-compat32|--build|build|--clean|clean)
@@ -636,6 +643,12 @@ while [ $# -gt 0 ]; do
 	--with-compat32)
 	    RPM_OPTS="${RPM_OPTS} --with compat32"
 	    ;;
+	--bootstrap-dir)
+	    VBOOTSTRAP_DIR=$1
+	    ;;
+	--built-rpms-dir)
+	    BUILT_RPMS_DIR=$1
+	    ;;
 	--build-rpm|build-rpm)
 	    RPM_PKG=$1
 	    RPM_Build || exit 1