Browse Source

vbuilder関連を更新。

git-svn-id: http://trac.vinelinux.org/repos/projects/vbootstrap/trunk@725 ec354946-7b23-47d6-9f5a-488ba84defc7
munepi 14 years ago
parent
commit
8f1bdcaa85
5 changed files with 183 additions and 76 deletions
  1. 4 0
      Makefile
  2. 5 2
      vbootstrap-vl.spec
  3. 1 1
      vbuilder-bash-completion.sh
  4. 7 3
      vbuilder.conf.in
  5. 166 70
      vbuilder.sh.in

+ 4 - 0
Makefile

@@ -5,6 +5,8 @@ REVISION=$(shell LC_ALL=C svn info 2> /dev/null | grep Revision | cut -d' ' -f2)
 VBUILDER_STABLE_VERSION=5.1
 VBUILDER_DEFAULT_VERSION=VineSeed
 VBUILDER_VBOOTSTRAP_DIR=/var/local/vbootstrap
+#VBUILDER_CACHE_DIR=$$\{VBOOTSTRAP_DIR\}/cache
+VBUILDER_CACHE_DIR=/var/local/vbootstrap/cache
 VBUILDER_BUILT_RPMS_DIR=$$\{HOME\}/rpm/vbuilder
 
 DESTDIR=
@@ -14,10 +16,12 @@ all:
 	sed -e "s/@@VBUILDER_STABLE_VERSION@@/${VBUILDER_STABLE_VERSION}/g" \
 	    -e "s/@@VBUILDER_DEFAULT_VERSION@@/${VBUILDER_DEFAULT_VERSION}/g" \
 	    -e "s|@@VBUILDER_VBOOTSTRAP_DIR@@|${VBUILDER_VBOOTSTRAP_DIR}|g" \
+	    -e "s|@@VBUILDER_CACHE_DIR@@|${VBUILDER_CACHE_DIR}|g" \
 	    -e "s|@@VBUILDER_BUILT_RPMS_DIR@@|${VBUILDER_BUILT_RPMS_DIR}|g" \
 		vbuilder.sh.in > vbuilder.sh
 	sed -e "s/@@VBUILDER_DEFAULT_VERSION@@/${VBUILDER_DEFAULT_VERSION}/g" \
 	    -e "s|@@VBUILDER_VBOOTSTRAP_DIR@@|${VBUILDER_VBOOTSTRAP_DIR}|g" \
+	    -e "s|@@VBUILDER_CACHE_DIR@@|${VBUILDER_CACHE_DIR}|g" \
 	    -e "s|@@VBUILDER_BUILT_RPMS_DIR@@|${VBUILDER_BUILT_RPMS_DIR}|g" \
 		vbuilder.conf.in > vbuilder.conf
 

+ 5 - 2
vbootstrap-vl.spec

@@ -72,9 +72,12 @@ vbuilder は vbootstrap を利用して chroot 環境の構築し、
 
 
 %changelog
-* Mon Mar 29 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.22-1
+* Fri Apr 02 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.22-1
 - updated vbuilder.sh.in: 
-  - added --bootstrap-dir --built-rpms-dir options
+  - added --bootstrap-dir, --built-rpms-dir, --cache-dir options
+  - added show-info action
+    - defined write-vbuilder-log()
+- added CACHE_DIR in vbuilder.conf.in
 - updated vbuilder-bash-completion.sh
 
 * Fri Mar 26 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.21-1

+ 1 - 1
vbuilder-bash-completion.sh

@@ -23,7 +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"
+    actions="clean build build-rpm install-rpm remove-rpm show-info"
     opts="$options $actions"
 
     _arch=$(rpm --eval %_arch)

+ 7 - 3
vbuilder.conf.in

@@ -3,13 +3,17 @@
 ## 
 ## This configuration is read at the begin of vbuilder. 
 
+## Default version for chroot
+## default: DEFAULT_VERSION=@@VBUILDER_DEFAULT_VERSION@@
+DEFAULT_VERSION=@@VBUILDER_DEFAULT_VERSION@@
+
 ## The top dirctory for vbootstrap
 ## default: VBOOTSTRAP_DIR=@@VBUILDER_VBOOTSTRAP_DIR@@
 VBOOTSTRAP_DIR=@@VBUILDER_VBOOTSTRAP_DIR@@
 
-## Default version for chroot
-## default: DEFAULT_VERSION=@@VBUILDER_DEFAULT_VERSION@@
-DEFAULT_VERSION=@@VBUILDER_DEFAULT_VERSION@@
+## Default directory to cache rpms of /var/cache/apt/archives in chroot
+## default: CACHE_DIR=@@VBUILDER_CACHE_DIR@@
+CACHE_DIR=@@VBUILDER_CACHE_DIR@@
 
 ## Default directory to store built rpms
 ## default: BUILT_RPMS_DIR=@@VBUILDER_BUILT_RPMS_DIR@@

+ 166 - 70
vbuilder.sh.in

@@ -3,7 +3,7 @@
 
 Usage_C(){
     cat<<EOF
-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]}
+Usage:	$(basename $0) {--version [version]} {--arch [arch]} {--dist-upgrade} {--target [target]} {--with-compat32} {--bootstrap-dir [directory]} {--cache-dir [directory]} {--built-rpms-dir [directory]} {clean|build|build-rpm [src.rpm]|install-rpm [arch.rpm|package]|remove-rpm [package]|show-info}
 
 Options:
 	--version:		set [version] (default: ${DEFAULT_VERSION})
@@ -13,6 +13,7 @@ Options:
 	--target:		build rpms with [target]
 	--with-compat32:	build rpms with compat32 on boostrap
 	--bootstrap-dir:	set a bootstrap directory (default: ${VBOOTSTRAP_DIR})
+	--cache-dir:		set a directory to cache rpms (default: ${CACHE_DIR})
 	--built-rpms-dir:	set a directory to store built rpms in chroot (default: ${BUILT_RPMS_DIR})
 
 Actions:
@@ -21,6 +22,7 @@ Actions:
 	build-rpm:		build [src.rpm] on a boostrap
 	install-rpm:		install [arch.rpm|package] on a boostrap
 	remove-rpm:		remove [package] on a boostrap
+	show-info:		show basic informations and logs in chroot
 
 For example, 
 * make a clean/plain build environment on the current archtecture:
@@ -44,16 +46,40 @@ Usage_ja(){
 }
 
 Msg_MissingParameter_C(){
-    para=$1
+    local para=$1
     cat<<EOF
 E: Missing some parameters after ${para}
 EOF
 }
 
 Msg_MissingParameter_ja(){
-    para=$1
+    local para=$1
     cat<<EOF
-E: ${para} 以後のいくつかのパラメータに間違いがあります
+E: ${para} 以後のいくつかの引数に間違いがあります
+EOF
+}
+
+Msg_GiveMoreOptions_C(){
+    cat<<EOF
+E: You can give no more options after actions
+EOF
+}
+
+Msg_GiveNoMoreOptions_ja(){
+    cat<<EOF
+E: 動作の以後にオプションを与えられません
+EOF
+}
+
+Msg_GiveAtLeastOneAction_C(){
+    cat<<EOF
+E: You must give at least one action
+EOF
+}
+
+Msg_GiveAtLeastOneAction_ja(){
+    cat<<EOF
+E: 少なくとも1つの動作を与えなければなりません
 EOF
 }
 
@@ -106,24 +132,28 @@ EOF
 }
 
 Msg_NotPackageName_C(){
+    local RPM_PKG=$1
     cat<<EOF
 E: $RPM_PKG is not a package name
 EOF
 }
 
 Msg_NotPackageName_ja(){
+    local RPM_PKG=$1
     cat<<EOF
 E: $RPM_PKG はパッケージ名でありません
 EOF
 }
 
 Msg_NotSourceRPM_C(){
+    local RPM_PKG=$1
     cat<<EOF
 E: $RPM_PKG is not a source RPM package
 EOF
 }
 
 Msg_NotSourceRPM_ja(){
+    local RPM_PKG=$1
     cat<<EOF
 E: $RPM_PKG はソース RPM パッケージでありません
 EOF
@@ -132,22 +162,31 @@ EOF
 ##############################################################################
 
 check-parameter(){
-    if [ -z "$*" ]; then
-	Usage_$LOCALE
-	return 1
-    fi
+    [ -z "$*" ] && Usage_$LOCALE && return 1
 
     while [ ! -z "$*" ]; do
 	case $1 in
-	    --help)
+	    --help|help)
 		Usage_$LOCALE
 		return 1
 		;;
-	    --version|--arch|--target|--bootstrap-dir|--built-rpms-dir|--build-rpm|build-rpm|--install-rpm|install-rpm|--remove-rpm|remove-rpm)
+	    --version|--arch|--target|--bootstrap-dir|--cache-dir|--built-rpms-dir)
+		[ $with_actions -eq 1 ] && \
+		    Msg_GiveNoMoreOptions_$LOCALE && return 1
 		shift
 		check-next-parameter $1 || return 1
 		;;
-	    --dist-upgrade|--unionfs|--with-compat32|--build|build|--clean|clean)
+	    --dist-upgrade|--unionfs|--with-compat32)
+		[ $with_actions -eq 1 ] && \
+		    Msg_GiveNoMoreOptions_$LOCALE && return 1
+		;;
+	    --build-rpm|build-rpm|--install-rpm|install-rpm|--remove-rpm|remove-rpm)
+		with_actions=1
+		shift
+		check-next-parameter $1 || return 1
+		;;
+	    --build|build|--clean|clean|--show-info|show-info)
+		with_actions=1
 		;;
 	    *)
 		Msg_MissingParameter_$LOCALE $1
@@ -156,32 +195,34 @@ check-parameter(){
 	esac
 	shift
     done
+
+    [ $with_actions -eq 0 ] && Msg_GiveAtLeastOneAction_$LOCALE && return 1
+
     return 0
 }
 
 check-next-parameter(){
-    arg=$1
-    if [ -z "${arg}" ]; then
-	Msg_MissingParameter_$LOCALE ${arg}
-	return 1
-    fi
+    local arg=$1
+    [ -z "${arg}" ] && Msg_MissingParameter_$LOCALE ${arg} && return 1
+
+    [ $(echo ${arg} | grep '^-') ] && \
+	Msg_MissingParameter_$LOCALE ${arg} && return 1
 
-    if [ $(echo ${arg} | grep '^-') ]; then
-	Msg_MissingParameter_$LOCALE ${arg}
-	return 1
-    fi
     return 0
 }
 
 setup-vbuilder(){
     ## load default settings
-    if [ -r /etc/vbootstrap/vbuilder.conf ]; then
-	. /etc/vbootstrap/vbuilder.conf
+    VBUILDER_CONF=/etc/vbootstrap/vbuilder.conf
+    if [ -r $VBUILDER_CONF ]; then
+	. $VBUILDER_CONF
     fi
-    [ -z "${VBOOTSTRAP_DIR}" ] && \
-	VBOOTSTRAP_DIR=@@VBUILDER_VBOOTSTRAP_DIR@@
     [ -z "${DEFAULT_VERSION}" ] && \
 	DEFAULT_VERSION=@@VBUILDER_DEFAULT_VERSION@@
+    [ -z "${VBOOTSTRAP_DIR}" ] && \
+	VBOOTSTRAP_DIR=@@VBUILDER_VBOOTSTRAP_DIR@@
+    [ -z "${CACHE_DIR}" ] && \
+	CACHE_DIR=@@VBUILDER_CACHE_DIR@@
     [ -z "${BUILT_RPMS_DIR}" ] && \
 	BUILT_RPMS_DIR=@@VBUILDER_BUILT_RPMS_DIR@@
 
@@ -201,38 +242,37 @@ setup-vbuilder(){
     with_setup_vbootstrap=0
     with_unionfs=0
     with_dist_upgrade=0
+    with_actions=0
 }
 
 setup-vbootstrap(){
     if [ ${with_setup_vbootstrap} -eq 0 ]; then
 	with_setup_vbootstrap=1
 
-        ## check some directories
-        ## Note: create $BUILT_RPMS_DIR in RPM_Build()
+	## check some directories
+	## Note: create $BUILT_RPMS_DIR in RPM_Build()
 	[ -d $VBOOTSTRAP_DIR ] || mkdir -p $VBOOTSTRAP_DIR
+	[ -d $CACHE_DIR ] || mkdir -p $CACHE_DIR
 
 	## check a chroot archtecture
-	if [ ! -z ${VARCH} ]; then
+	if [ -z ${VARCH} ]; then
+	    VARCH=$(uname -i)
+	else
 	    case "${VARCH}" in
 		i386|i686|x86_64)
 		    [ "$(uname -i)" = "ppc" ] && \
-			Msg_NoSupportVARCH_$LOCALE
-		    [ $? -eq 0 ] && exit 1
+			Msg_NoSupportVARCH_$LOCALE && exit 1
 		    ;;
 		ppc)
 		    [ "$(uname -i)" = "i386" -o "$(uname -i)" = "i686" -o "$(uname -i)" = "x86_64" ] && \
-			Msg_NoSupportVARCH_$LOCALE
-		    [ $? -eq 0 ] && exit 1
+			Msg_NoSupportVARCH_$LOCALE && exit 1
 		    ;;
 	    esac
 	fi
 
-	[ -z ${VARCH} ] && VARCH=$(uname -i)
-
         ##!! 4.2 is NO support on VARCH=x86_64
 	if [ "${VERSION}" = "4.2" -a "${VARCH}" = "x86_64" ]; then
-	    Msg_NoSupportVERSION_${LOCALE}
-	    exit 1
+	    Msg_NoSupportVERSION_${LOCALE} && exit 1
 	fi
 
 	## support i386 chroot on x86_64 below: 
@@ -240,15 +280,13 @@ setup-vbootstrap(){
 
         ## check support ${VERSION}
 	if [ -z "$(/usr/sbin/vbootstrap | sed -e s/^Usage:.*// -e s/^E:.*// | grep -m 1 ${VERSION})" ]; then
-	    Msg_NoSupportVERSION_$LOCALE
-	    exit 1
+	    Msg_NoSupportVERSION_$LOCALE && exit 1
 	fi
 
 	## check ${VERSION} equals VineSeed*, when with_dist_upgrade=1
 	if [ $with_dist_upgrade -eq 1 ]; then
-	    if [ "$(echo ${VERSION} | sed -e "s/\(VineSeed\).*/\1/")" != "VineSeed" ]; then
-		Msg_NoSupportDistUpgradeVERSION_$LOCALE
-		exit 1
+	    if [ "$(echo ${VERSION} | sed -e "s/\(VineSeed\).*/\1/")" != "VineSeed" ]; then 
+		Msg_NoSupportDistUpgradeVERSION_$LOCALE && exit 1
 	    fi
 	fi
 
@@ -256,8 +294,7 @@ setup-vbootstrap(){
 	if [ ! -z "${TARGET}" ]; then
 	    RPM_TARGET_LIST="$(cat /usr/lib/rpm/rpmrc | grep arch_canon: | sed -e "s/arch_canon:[[:blank:]]*\(.*\):.*/\1/")"
 	    if [ -z "$(echo $RPM_TARGET_LIST | grep $TARGET)" ]; then
-		Msg_NoSupportTARGET_$LOCALE
-		exit 1
+		Msg_NoSupportTARGET_$LOCALE && exit 1
 	    fi
 	fi
 
@@ -268,9 +305,10 @@ setup-vbootstrap(){
     BUILD_ROOT=${VBOOTSTRAP_DIR}/${VERSION}
     BUILD_USER=vbuilder
     BUILD_DIR=/home/${BUILD_USER}/rpm
-    ARCHIVES_DIR=${BUILD_ROOT}/var/cache/apt/archives
-    CACHE_DIR=${VBOOTSTRAP_DIR}/cache/${VERSION}/apt/archives
     UNIONFS_DIR=${VBOOTSTRAP_DIR}/unionfs/${VERSION}
+    ARCHIVES_DIR=${BUILD_ROOT}/var/cache/apt/archives
+    EXTERNAL_ARCHIVES_DIR=${CACHE_DIR}/${VERSION}/apt/archives
+    VBUILDER_LOG=${BUILD_ROOT}/var/log/vbuilder.log
 
     __chroot_sh="/usr/sbin/chroot ${BUILD_ROOT} /bin/sh -c"
 
@@ -318,7 +356,7 @@ apt-get-update(){
 ## support name: vfs chache_dir
 ## NOTE: /tmp needs for applications which use X
 ##       vfs is virtual file systems
-##       cache_dir is ${CACHE_DIR} to ${ARCHIVES_DIR}
+##       archives_dir is ${EXTERNAL_ARCHIVES_DIR} to ${ARCHIVES_DIR}
 mount-chroot(){
     if [ "$1" = "--umount" ]; then
 	mount-chroot-umount $2 || return 1
@@ -347,7 +385,7 @@ mount-chroot-umount(){
 		umount ${BUILD_ROOT}/proc
 	    return 0
 	    ;;
-	cache_dir)
+	archives_dir)
 	    [ -d ${ARCHIVES_DIR} ] || return 1
 	    [ -z "$(mount | grep ${ARCHIVES_DIR})" ] || \
     		umount ${ARCHIVES_DIR}
@@ -399,11 +437,11 @@ mount-chroot-mount(){
 	    mount-chroot-mount /proc || return 1
 	    return 0
 	    ;;
-	cache_dir)
-	    [ -d ${CACHE_DIR} ] || mkdir -p ${CACHE_DIR}
+	archives_dir)
+	    [ -d ${EXTERNAL_ARCHIVES_DIR} ] || mkdir -p ${EXTERNAL_ARCHIVES_DIR}
 	    [ -d ${ARCHIVES_DIR} ] || mkdir -p ${ARCHIVES_DIR}
 	    [ -z "$(mount | grep ${ARCHIVES_DIR})" ] && \
-		mount ${mnt_opts} ${CACHE_DIR} ${ARCHIVES_DIR}
+		mount ${mnt_opts} ${EXTERNAL_ARCHIVES_DIR} ${ARCHIVES_DIR}
 	    [ -d ${ARCHIVES_DIR}/partial ] || mkdir -p ${ARCHIVES_DIR}/partial
 	    return 0
 	    ;;
@@ -421,19 +459,56 @@ mount-chroot-mount(){
 	    exit 1
 	    ;;
     esac
-   
 }
 
+write-vbuilder-log(){
+    [ -d ${BUILD_ROOT} ] || return 1
+
+    if [ ! -f $VBUILDER_LOG ]; then
+	cat<<EOF > $VBUILDER_LOG
+======================================================================
+VBUILDER REPORT
+DATE:		$(LANG=C date)
+HOSTNAME:	$(hostname)
+OS:		$(echo $($__chroot_sh "cat /etc/vine-release"))
+%_arch:		$(echo $($__chroot_sh "rpm --eval %_arch"))
+
+--version:	${VERSION}
+$(echo $([ -z "${VARCH}" ] || echo "--arch:		${VARCH}"))
+$(echo $([ $with_dist_upgrade -eq 1 ] && echo "--dist-upgrade"))
+$(echo $([ $with_unionfs -eq 1 ] && echo "--unionfs"))
+$(echo $([ -z "${TARGET}" ] || echo "--target:		${TARGET}"))
+--bootstrap-dir:	${VBOOTSTRAP_DIR}
+--cache-dir:		${CACHE_DIR}
+--built-rpms-dir:	${BUILT_RPMS_DIR}
+======================================================================
+
+[$VBUILDER_CONF]
+$(cat $VBUILDER_CONF)
+
+[History]
+EOF
+    else
+	cat<<EOF >> $VBUILDER_LOG
+$*
+EOF
+    fi
+}
 
 ##############################################################################
 
 Clean(){
     setup-vbootstrap
 
+    # output end-of-line in $VBUILDER_LOG
+    [ -f $VBUILDER_LOG ] && \
+	write-vbuilder-log "======================================================================"
+    Show-Info
+
     # mount-chroot --umount /home
     # mount-chroot --umount /tmp
     mount-chroot --umount vfs
-    mount-chroot --umount cache_dir
+    mount-chroot --umount archives_dir
     mount-chroot --umount unionfs_dir
     apt-get-update --host
 
@@ -470,7 +545,7 @@ Build(){
 	/usr/sbin/vbootstrap ${VERSION} ${BUILD_ROOT}
     fi
 
-    mount-chroot cache_dir
+    mount-chroot archives_dir
     mount-chroot vfs
     # mount-chroot /tmp
     # mount-chroot /home
@@ -504,30 +579,39 @@ Build(){
 	$__chroot_sh "sed -i -e 's/^%_topdir/#%_topdir/' /home/${BUILD_USER}/.rpmmacros"
     fi
 
+    ## output basic informations in chroot
+    write-vbuilder-log
+    write-vbuilder-log "build"
+
     # mount-chroot --umount /home
     # mount-chroot --umount /tmp
     mount-chroot --umount vfs
-    mount-chroot --umount cache_dir
+    mount-chroot --umount archives_dir
     apt-get-update --host
 
     echo "Making a build farm for ${VERSION} done."
 }
 
+Show-Info(){
+    setup-vbootstrap
+
+    [ -f $VBUILDER_LOG ] && cat $VBUILDER_LOG
+}
+
 RPM_Remove(){
     setup-vbootstrap-rpm
     mount-chroot unionfs_dir
-    mount-chroot cache_dir
+    mount-chroot archives_dir
     mount-chroot vfs
     apt-get-update --chroot
 
-    if [ -f $RPM_PKG ]; then
-	Msg_NotPackageName_$LOCALE
-	exit 1
-    fi
+    [ -f $RPM_PKG ] && Msg_NotPackageName_$LOCALE $RPM_PKG && exit 1
     $__chroot_sh "apt-get -y remove $BASE_RPM_PKG"
 
+    write-vbuilder-log "remove-rpm $RPM_PKG"
+
     mount-chroot --umount vfs
-    mount-chroot --umount cache_dir
+    mount-chroot --umount archives_dir
     mount-chroot --umount unionfs_dir
     apt-get-update --host
 }
@@ -535,14 +619,16 @@ RPM_Remove(){
 RPM_Install(){
     setup-vbootstrap-rpm
     mount-chroot unionfs_dir
-    mount-chroot cache_dir
+    mount-chroot archives_dir
     mount-chroot vfs
     apt-get-update --chroot
 
     $__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $BASE_RPM_PKG"
 
+    write-vbuilder-log "install-rpm $RPM_PKG"
+
     mount-chroot --umount vfs
-    mount-chroot --umount cache_dir
+    mount-chroot --umount archives_dir
     mount-chroot --umount unionfs_dir
     apt-get-update --host
 }
@@ -550,14 +636,11 @@ RPM_Install(){
 RPM_Build(){
     setup-vbootstrap-rpm
     mount-chroot unionfs_dir
-    mount-chroot cache_dir
+    mount-chroot archives_dir
     mount-chroot vfs
     apt-get-update --chroot
 
-    if [ ! -f $RPM_PKG ]; then
-	Msg_NotSourceRPM_$LOCALE
-	exit 1
-    fi
+    [ ! -f $RPM_PKG ] && Msg_NotSourceRPM_$LOCALE $RPM_PKG && exit 1
     
     RPM_PKG_USER=$(stat -c %U $RPM_PKG)
     RPM_PKG_GROUP=$(stat -c %G $RPM_PKG)
@@ -582,7 +665,7 @@ RPM_Build(){
     $__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $(find $BUILD_ROOT${BUILD_DIR}/RPMS -type f -regex '.*\.rpm' | sed -e s@${BUILD_ROOT}@@g -e 's|.*\/compat32-.*||g' -e 's|.*\/.*\.src\.rpm||g' -e 's/$/ \\/g')"
 
     ## copy built rpms to ${HOME}/rpm/ for each archtectures
-    echo "Copying built rpms to ${HOME}/rpm/ for each archtectures ... "
+    echo "Copying built rpms to ${BUILT_RPMS_DIR} for each archtectures ... "
     for i in $RPM_PKG_ARCH_LIST; do \
 	if [ -d $BUILD_ROOT${BUILD_DIR}/${i} ]; then
 	    if [ ! -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i} ]; then
@@ -594,8 +677,10 @@ RPM_Build(){
 	fi
     done
 
+    write-vbuilder-log "build-rpm $RPM_PKG"
+
     mount-chroot --umount vfs
-    mount-chroot --umount cache_dir
+    mount-chroot --umount archives_dir
     mount-chroot --umount unionfs_dir
     apt-get-update --host
 
@@ -612,10 +697,15 @@ check-parameter $* || exit 1
 while [ $# -gt 0 ]; do
     tmpARG=$1
     case $tmpARG in
-	--version|--arch|--target|--bootstrap-dir|--built-rpms-dir|--build-rpm|build-rpm|--install-rpm|install-rpm|--remove-rpm|remove-rpm)
+	--version|--arch|--target|--bootstrap-dir|--cache-dir|--built-rpms-dir)
 	    shift
 	    ;;
-	--dist-upgrade|--unionfs|--with-compat32|--build|build|--clean|clean)
+	--dist-upgrade|--unionfs|--with-compat32)
+	    ;;
+	--build-rpm|build-rpm|--install-rpm|install-rpm|--remove-rpm|remove-rpm)
+	    shift
+	    ;;
+	--build|build|--clean|clean|--show-info|show-info)
 	    ;;
 	*)
 	    echo unknown option $1
@@ -646,6 +736,9 @@ while [ $# -gt 0 ]; do
 	--bootstrap-dir)
 	    VBOOTSTRAP_DIR=$1
 	    ;;
+	--cache-dir)
+	    CACHE_DIR=$1
+	    ;;
 	--built-rpms-dir)
 	    BUILT_RPMS_DIR=$1
 	    ;;
@@ -661,6 +754,9 @@ while [ $# -gt 0 ]; do
 	    RPM_PKG=$1
 	    RPM_Remove || exit 1
 	    ;;
+	--show-info|show-info)
+	    Show-Info
+	    ;;
 	--build|build)
 	    Build
 	    ;;