Changeset 695 for trunk/technical/common
- Timestamp:
- Nov 21, 2004, 11:01:59 PM (20 years ago)
- Location:
- trunk/technical/common/build
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/technical/common/build/build.sh
r694 r695 24 24 # %users ALL=(ALL) NOPASSWD: /bin/su 25 25 # for automatic building 26 # 27 # return codes: 28 # 0: success 29 # 1: skipped (current RPM already in dest dir) 30 # >1: error 31 26 32 27 33 CONFIG_FILE=/usr/local/etc/build … … 98 104 99 105 if [ "$1" ]; then 100 cp -a "$1" ${BUILDTEMP}/src/${PACKAGE} 101 cd ${BUILDTEMP}/src/${PACKAGE}; rpm2cpio $1 | cpio -i 106 EXPECTED_DEST_RPM_FILENAME=${DEST_DIR}/${BUILD_DIST}/`echo $1 | sed 's/\.src\./.*./'` 107 if [ -f $EXPECTED_DEST_RPM_FILENAME ]; then 108 echo 109 echo "Build of \"${PACKAGE}\" unnecessary. Current RPM already at " $EXPECTED_DEST_RPM_FILENAME 110 echo 111 exit 1 112 else 113 cp -a "$1" ${BUILDTEMP}/src/${PACKAGE} 114 cd ${BUILDTEMP}/src/${PACKAGE}; rpm2cpio $1 | cpio -i 115 fi 102 116 else 103 117 cp -a $SPECFILE ${BUILDTEMP}/src/${PACKAGE} … … 111 125 # in case of local modification a "m" is added to the release number 112 126 SVN_BUILD_MODIFIED=$(svn status -v | grep "^ *M" | wc -l) 113 if [ $SVN_BUILD_MODIFIED -gt 0 ]; then 127 # checks if a file is commited, 128 # but update on its directory is not performed 129 SVN_LAST_MODIFICATION=$(svn status -v | sed -n 's/^ *[0-9]* *\([0-9]*\) .*/\1/p' | sort -n | tail -1) 130 if [ $SVN_BUILD_MODIFIED -gt 0 ]; then 114 131 SVN_BUILD_RELEASE=${SVN_BUILD_RELEASE}m 132 elif [ $SVN_LAST_MODIFICATION -ne $SVN_BUILD_RELEASE ]; then 133 SVN_BUILD_RELEASE=${SVN_BUILD_RELEASE}p 115 134 else # check if RPM has been build already 116 135 EXPECTED_DEST_RPM_FILENAME=${DEST_DIR}/${BUILD_DIST}/${PACKAGE}-${VERSION}-${SVN_BUILD_RELEASE}.*.rpm … … 118 137 echo 119 138 echo "Build of \"${PACKAGE}\" unnecessary. Current RPM already at " $EXPECTED_DEST_RPM_FILENAME 120 echo "verify if 'svn update' has been performed on the source directory"121 139 echo 122 exit 140 exit 1 123 141 fi 124 142 fi … … 174 192 #!/bin/bash 175 193 # local buildscript 176 #. /work/src/bin/.profile177 194 export BUILD_ROOT=$BUILD_ROOT 178 195 export BUILD_DIST=$BUILD_DIST … … 190 207 mkdir -p ${DEST_DIR}/src 191 208 # delete all old versions of this package 192 rm -f ${DEST_DIR}/src/${PACKAGE}-*.src.rpm 209 for i in ${DEST_DIR}/src/${PACKAGE}-*.src.rpm; do 210 if [ -f $i -a ${PACKAGE} = "`rpm -qp --qf "%{NAME}\n" $i`" ]; then 211 rm $i 212 fi 213 done 214 #rm -f ${DEST_DIR}/src/${PACKAGE}-*.src.rpm 193 215 194 216 if !(cp -a ${BUILD_ROOT}/usr/src/packages/SRPMS/${PACKAGE}-${VERSION}-*.src.rpm ${DEST_DIR}/src 2> /dev/null); then 195 ERROR= 1217 ERROR=4 196 218 fi 197 219 198 220 mkdir -p ${DEST_DIR}/${BUILD_DIST} 199 221 # delete all old versions of this package 200 rm -f ${DEST_DIR}/${BUILD_DIST}/${PACKAGE}-*.rpm 222 for i in ${DEST_DIR}/${BUILD_DIST}/${PACKAGE}-*.rpm; do 223 if [ -f $i -a ${PACKAGE} = "`rpm -qp --qf "%{NAME}\n" $i`" ]; then 224 rm $i 225 fi 226 done 227 #rm -f ${DEST_DIR}/${BUILD_DIST}/${PACKAGE}-*.rpm 201 228 202 229 if !(cp -a ${BUILD_ROOT}/usr/src/packages/RPMS/*/${PACKAGE}*${VERSION}-*.*.rpm ${DEST_DIR}/${BUILD_DIST} ); then 203 ERROR= 2230 ERROR=8 204 231 fi 205 232 -
trunk/technical/common/build/buildall.pl
r694 r695 40 40 getopts('xb:d:'); 41 41 42 42 my $skipped_last = 0; 43 43 44 44 if (!$opt_b && !$opt_d) { … … 105 105 $mypath = $src_root.$ArrayofBuilds[$i][0]; 106 106 107 if ($ArrayofBuilds[$i][2])107 if( $ArrayofBuilds[$i][2] && !$skipped_last ) 108 108 { 109 109 $ENV{'BUILD_MODE'}=$ArrayofBuilds[$i][2]; … … 111 111 else 112 112 { 113 $ENV{'BUILD_MODE'}="-- clean";113 $ENV{'BUILD_MODE'}="--verify"; 114 114 } 115 115 $ENV{'BUILD_DIST'}=$ArrayofBuilds[$i][1]; … … 160 160 print LOG_FD if $do_log; 161 161 } 162 close PIPE; my $retval=$? ;162 close PIPE; my $retval=$?>>8; 163 163 close LOG_FD if $do_log; 164 164 165 if ( $retval == 0 ) 166 { 165 if ( $retval == 0 ) { 167 166 $ArrayofBuilds[$i][3] = "OK"; 168 167 print"****** ******\n"; 169 168 print"****** building of $ArrayofBuilds[$i][0]: OK \n" ; 170 169 print"****** ******\n"; 171 } 172 else 173 { 170 } elsif ( $retval == 1 ) { 171 $ArrayofBuilds[$i][3] = "skipped"; 172 $skipped_last = 1; 173 } else { 174 174 $ArrayofBuilds[$i][3] = "*FAILED*"; 175 175 print"****** ******\n";
Note:
See TracChangeset
for help on using the changeset viewer.