Browse Source

updated vbuilder.sh.in: Build() を最適化。vbuilder clean build しても、self-build-setup ぱっけーじをインストールしないように変更。self-build-setup は、self-build 関連パッケージをビルド、もしくは、インストールするときのみに、インストールするように変更。

git-svn-id: http://trac.vinelinux.org/repos/projects/vbootstrap/trunk@4622 ec354946-7b23-47d6-9f5a-488ba84defc7
munepi 12 years ago
parent
commit
40dd5109ee
2 changed files with 16 additions and 6 deletions
  1. 4 1
      vbootstrap-vl.spec
  2. 12 5
      vbuilder.sh.in

+ 4 - 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.45
+%define version 0.0.46
 
 Summary: bootstrap scripts to create a basic Vine Linux system
 Summary(ja): Vine Linux の基本システムを作成するためのスクリプト
@@ -83,6 +83,9 @@ vbuilder は vbootstrap を利用して chroot 環境の構築し、
 
 
 %changelog
+* Sat Aug 20 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.46-1
+- 
+
 * Tue Aug 09 2011 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.45-1
 - set STABLE_VERSION to 6.0
 

+ 12 - 5
vbuilder.sh.in

@@ -586,10 +586,6 @@ Build(){
 	$__chroot_sh 'apt-get -qq update && apt-get -qq -y dist-upgrade'
 
     $__chroot_sh 'apt-get -qq -y install build-essential'
-
-    [ $with_category_nonfree -eq 1 ] && \
-	$__chroot_sh 'apt-get -qq -y install self-build-setup'
-
     $__chroot_sh 'apt-get -qq -y install etcskel shadow-utils'
 
     $__chroot_sh 'cd /dev && /sbin/MAKEDEV console'
@@ -655,6 +651,10 @@ RPM_Install(){
 
     apt-get-update --chroot
 
+    [ $with_category_nonfree -eq 1 ] && \
+	[ ! -z "$(echo $BASE_RPM_PKG | grep -e 'self-build-' -e 'install-assist-')" ] && \
+	$__chroot_sh 'rpm -q --quiet self-build-setup || apt-get -qq -y install self-build-setup'
+
     $__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $BASE_RPM_PKG"
 
     mount-chroot --umount /dev/shm
@@ -696,8 +696,15 @@ RPM_Build(){
     ## rebuild $BASE_RPM_PKG on ${DIST_RELEASE}
     $__chroot_sh "cd ${BUILD_DIR}/SRPMS && apt-get -o APT::Install::Virtual=true -y build-dep $BASE_RPM_PKG"
     $__chroot_sh "cd ${BUILD_DIR}/SRPMS && su ${BUILD_USER} -c 'rpmbuild --rebuild $RPM_OPTS $BASE_RPM_PKG'"
+
+    BUILT_RPMS_LIST=$(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')
+
+    [ $with_category_nonfree -eq 1 ] && \
+	[ ! -z "$(echo $BUILT_RPMS_LIST | grep -e 'self-build-' -e 'install-assist-')" ] && \
+	$__chroot_sh 'rpm -q --quiet self-build-setup || apt-get -qq -y install self-build-setup'
+
     [ $with_no_install -eq 0 ] && \
-	$__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')"
+	$__chroot_sh "cd ${BUILD_DIR} && apt-get -y install $BUILT_RPMS_LIST"
 
     ## copy built rpms to ${HOME}/rpm/ for each archtectures
     echo $"Copying built rpms to ${BUILT_RPMS_DIR} for each archtectures ... "