Quellcode durchsuchen

* add --help option to vbuilder
- vbuilder に "--help" オプションを追加
* ensure all files/subdirectories under BUILT_RPMS_DIR (i.e. $HOME/vbuilder/{5.1,VineSeed}/{RPMS/{i686,ppc,x86_64},SRPMS}/*) have ownerships of the user/group who executed "sudo vbuilder"
- 生成される rpm パッケージ、およびそれをコピーする先のディレクトリ ($HOME/vbuilder/ 以下) の ownership を、sudo vbuilder を実行した user/group になるように修正



git-svn-id: http://trac.vinelinux.org/repos/projects/vbootstrap/trunk@516 ec354946-7b23-47d6-9f5a-488ba84defc7

shaolin vor 15 Jahren
Ursprung
Commit
27002895f2
2 geänderte Dateien mit 15 neuen und 2 gelöschten Zeilen
  1. 7 1
      vbootstrap.spec
  2. 8 1
      vbuilder.sh.in

+ 7 - 1
vbootstrap.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.16
+%define version 0.0.17
 
 Summary: bootstrap scripts to create a basic Vine Linux system
 Summary(ja): Vine Linux の基本システムを作成するためのスクリプト
@@ -61,6 +61,12 @@ vbootstrap は Vine Linux の基本システムを既存の Vine Linux システ
 
 
 %changelog
+* Thu Mar 04 2010 MATSUBAYASHI Kohji <shaolin@vinelinux.org> - 0.0.17-1
+- add --help option to vbuilder
+- ensure all files/subdirectories under BUILT_RPMS_DIR
+  (i.e. $HOME/vbuilder/{5.1,VineSeed}/{RPMS/{i686,ppc,x86_64},SRPMS}/*)
+  have ownerships of the user/group who executed "sudo vbuilder"
+
 * Mon Feb 22 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.16-1
 - added Requires: unionfs-utils
 - updated vbuilder.sh.in

+ 8 - 1
vbuilder.sh.in

@@ -137,6 +137,9 @@ check-parameter(){
 
     while [ ! -z "$*" ]; do
 	case $1 in
+	    --help)
+		Usage_$LOCALE
+		;;
 	    --version|--arch|--target|--build-rpm|--install-rpm|--remove-rpm)
 		shift
 		check-next-parameter $1 || return 1
@@ -574,6 +577,8 @@ RPM_Build(){
     
     RPM_PKG_USER=$(stat -c %U $RPM_PKG)
     RPM_PKG_GROUP=$(stat -c %G $RPM_PKG)
+    [ ! -z "${SUDO_UID}" ] && RPM_PKG_USER=SUDO_UID
+    [ ! -z "${SUDO_GID}" ] && RPM_PKG_GROUP=SUDO_GID
     local __install="install -p -v -o ${RPM_PKG_USER} -g ${RPM_PKG_GROUP}"
     RPM_PKG_ARCH_LIST="RPMS/i386 RPMS/i686 RPMS/x86_64 RPMS/ppc RPMS/noarch SRPMS"
     [ -z "${TARGET}" ] || \
@@ -596,8 +601,10 @@ RPM_Build(){
     echo "Copying built rpms to ${HOME}/rpm/ for each archtectures ... "
     for i in $RPM_PKG_ARCH_LIST; do \
 	if [ -d $BUILD_ROOT${BUILD_DIR}/${i} ]; then
-	    [ -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i} ] || \
+	    if [ ! -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i} ]; then
 		$__install -d ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i}/
+		chown -R ${RPM_PKG_USER}:${RPM_PKG_GROUP} ${BUILT_RPMS_DIR}
+	    fi
 	    find $BUILD_ROOT${BUILD_DIR}/${i} -type f -regex '.*\.rpm' \
 		-exec $__install -m0644 {} ${BUILT_RPMS_DIR}/${MAJOR_VERSION}/${i}/ \;
 	fi