summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Gallagher <sgallagh@redhat.com>2010-01-20 11:55:44 -0500
committerStephen Gallagher <sgallagh@redhat.com>2010-01-20 11:55:44 -0500
commit41059ebc2aec817c5535b3de4270f50dc40fcdcd (patch)
treeebb7982f63a4252752e3aee647264d441dc050e1
parente05a5197c4b578fda549b7aa6a5e79b59ae7e06d (diff)
downloadbuild_tools-41059ebc2aec817c5535b3de4270f50dc40fcdcd.zip
build_tools-41059ebc2aec817c5535b3de4270f50dc40fcdcd.tar.gz
build_tools-41059ebc2aec817c5535b3de4270f50dc40fcdcd.tar.xz
Use repomanage to keep track of older RPMs
-rwxr-xr-xsssd-nightly.sh47
1 files changed, 23 insertions, 24 deletions
diff --git a/sssd-nightly.sh b/sssd-nightly.sh
index 1552f1d..268708e 100755
--- a/sssd-nightly.sh
+++ b/sssd-nightly.sh
@@ -117,6 +117,29 @@ cp /var/lib/mock/epel-6-i386/result/sssd-debuginfo-$rpmversion.el6.i386.rpm $rep
cp /var/lib/mock/epel-6-i386/result/*.el6.i386.rpm $repodir/rhel6/i386/RPMS
rm -f $repodir/rhel6/i386/RPMS/sssd-debuginfo-$rpmversion.el6.i386.rpm
+echo "===== CREATING RHEL 6 x86_86 YUM REPOSITORY ====" >> $LOGFILE
+mkdir -p $repodir/rhel6/x86_64/DEBUGINFO
+mkdir -p $repodir/rhel6/x86_64/RPMS
+cp /var/lib/mock/epel-6-x86_64/result/sssd-debuginfo-$rpmversion.el6.x86_64.rpm $repodir/rhel6/x86_64/DEBUGINFO
+cp /var/lib/mock/epel-6-i386/result/sssd-debuginfo-$rpmversion.el6.i386.rpm $repodir/rhel6/x86_64/DEBUGINFO
+cp /var/lib/mock/epel-6-x86_64/result/*.el6.x86_64.rpm $repodir/rhel6/x86_64/RPMS
+rm -f $repodir/rhel6/x86_64/RPMS/sssd-debuginfo-$rpmversion.el6.i386.rpm
+cp /var/lib/mock/epel-6-i386/result/sssd-client-$rpmversion.el6.i386.rpm $repodir/rhel6/x86_64/RPMS
+
+echo "===== Removing Source Tree =====" >> $LOGFILE
+cd /local/sgallagh && rm -Rf sssd-$datestamp
+
+#Save the commit id for the next time
+if [ x$scratch_build == x ]; then
+ echo $commit_id > /local/sgallagh/.commit
+fi
+
+echo "===== Cleaning old logs =====" >> $LOGFILE
+find /local/sgallagh/logs -type f -daystart -ctime +6 -name "nightly-*.log" -exec rm -f {} \;
+
+echo "===== Cleaning old RPMS =====" >> $LOGFILE
+rm -f `repomanage -k2 --old /repos/rhel6`
+
createrepo --update -s sha1 $repodir/rhel6/SRPMS > /dev/null
if [ $? -eq 0 ]; then
echo "RHEL6 SRPM Repo updated" >> $LOGFILE
@@ -138,15 +161,6 @@ else
echo "RHEL6 i386 RPM Repo not updated" >> $LOGFILE
fi
-echo "===== CREATING RHEL 6 x86_86 YUM REPOSITORY ====" >> $LOGFILE
-mkdir -p $repodir/rhel6/x86_64/DEBUGINFO
-mkdir -p $repodir/rhel6/x86_64/RPMS
-cp /var/lib/mock/epel-6-x86_64/result/sssd-debuginfo-$rpmversion.el6.x86_64.rpm $repodir/rhel6/x86_64/DEBUGINFO
-cp /var/lib/mock/epel-6-i386/result/sssd-debuginfo-$rpmversion.el6.i386.rpm $repodir/rhel6/x86_64/DEBUGINFO
-cp /var/lib/mock/epel-6-x86_64/result/*.el6.x86_64.rpm $repodir/rhel6/x86_64/RPMS
-rm -f $repodir/rhel6/x86_64/RPMS/sssd-debuginfo-$rpmversion.el6.i386.rpm
-cp /var/lib/mock/epel-6-i386/result/sssd-client-$rpmversion.el6.i386.rpm $repodir/rhel6/x86_64/RPMS
-
createrepo --update -s sha1 $repodir/rhel6/x86_64/DEBUGINFO > /dev/null
if [ $? -eq 0 ]; then
echo "RHEL6 x86_64 DEBUGINFO Repo updated" >> $LOGFILE
@@ -161,21 +175,6 @@ else
echo "RHEL6 x86_64 RPM Repo not updated" >> $LOGFILE
fi
-echo "===== Removing Source Tree =====" >> $LOGFILE
-cd /local/sgallagh && rm -Rf sssd-$datestamp
-
-#Save the commit id for the next time
-if [ x$scratch_build == x ]; then
- echo $commit_id > /local/sgallagh/.commit
-fi
-
-echo "===== Cleaning old logs =====" >> $LOGFILE
-find /local/sgallagh/logs -type f -daystart -ctime +6 -name "nightly-*.log" -exec rm -f {} \;
-
-echo "===== Cleaning old RPMS =====" >> $LOGFILE
-find /local/sgallagh/repos/rhel6 -type f -daystart -ctime +6 -name "sssd-*" -exec rm -f {} \;
-find /local/sgallagh/repos/rhel6 -type f -daystart -ctime +6 -name "lib*" -exec rm -f {} \;
-
echo "===== BUILD CONCLUDED AT `date` =====" >> $LOGFILE
finish 0