Browse Source

updated vbuilder.sh.in: fixed RPM_Sign()

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

+ 1 - 1
vbootstrap-vl.spec

@@ -75,7 +75,7 @@ vbuilder は vbootstrap を利用して chroot 環境の構築し、
 
 
 %changelog
-* Xxx Yyy Zz 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.29-1
+* Sat Jul 17 2010 Munehiro Yamamoto <munepi@vinelinux.org> 0.0.29-1
 - updated vbuilder.sh.in
   - added --sign option
   - added --no-install option

+ 5 - 7
vbuilder.sh.in

@@ -811,13 +811,11 @@ RPM_Build(){
 }
 
 RPM_Sign(){
-    if [ $with_sign -eq 1 ]; then
-	if [ -z "${SUDO_USER}" ]; then
-	    Msg_SUDO_USERisEmpty_$LOCALE
-	else
-	    su ${SUDO_USER} -c "rpm --addsign $(for i in $RPM_PKG_ARCH_LIST; do find $BUILD_ROOT${BUILD_DIR}/${i} -type f -regex '.*\.rpm'; done | sed -e s,$BUILD_ROOT${BUILD_DIR},${BUILT_RPMS_DIR}/${MAJOR_VERSION},g -e 's/$/ \\/g')"
-	fi
-    fi
+    [ $with_sign -eq 1 ] || return 1
+
+    [ -z "${SUDO_USER}" ] && Msg_SUDO_USERisEmpty_$LOCALE && return 1
+
+    su ${SUDO_USER} -c "rpm --addsign $(for i in $RPM_PKG_ARCH_LIST; do find $BUILD_ROOT${BUILD_DIR}/${i} -type f -regex '.*\.rpm' 2>/dev/null; done | sed -e s,$BUILD_ROOT${BUILD_DIR},${BUILT_RPMS_DIR}/${MAJOR_VERSION},g -e 's/$/ \\/g')"
 
     return 0
 }