Cut out /etc/cron.daily/update.
authorlace <>
Fri, 22 Jan 2010 23:23:43 +0000 (23:23 +0000)
committerlace <>
Fri, 22 Jan 2010 23:23:43 +0000 (23:23 +0000)
bin/mockupdate [new file with mode: 0755]

diff --git a/bin/mockupdate b/bin/mockupdate
new file mode 100755 (executable)
index 0000000..820c8e6
--- /dev/null
@@ -0,0 +1,55 @@
+#! /bin/bash
+set -x
+
+opts=
+if [ "$1" = "-v" ];then
+       opts="-v"
+       shift
+fi
+
+for i in "$@";do
+       if [ "$i" = "${i#/var/lib/mock/}" ];then
+               echo >&2 "$i not /var/lib/mock/*"
+               exit 1
+       fi
+       if [ "$i" != "${i#*/root}" ];then
+               echo >&2 "$i contains /root"
+               exit 1
+       fi
+       if [ "$i" != "${i%-intel}" ];then
+               continue
+       fi
+       set +x
+       l=""
+       b=""
+       for p in /proc/*/root;do
+               l="`readlink $p`"
+               if [ "${l#$i/}" != "$l" ];then
+                       p="${p#/proc/}"
+                       p="${p%/root}"
+                       b="$b $p"
+               fi
+       done
+       set -x
+       if [ -n "$b" ];then
+               echo >&2 "$i has existing processes: $b"
+               continue
+       fi
+
+       /usr/local/sbin/mocksetup -u `basename $i`
+       mock $opts -r `basename $i` --update
+       mock $opts -r `basename $i` --install `cat ~/src/INSTALL`
+       # Run: yum groupinstall buildsys-build
+       # Cleaning would undo the changes above.
+       # file /lib/libnssutil3.so conflicts between attempted installs of nss-3.12.3.99.3-10.fc12.i686 and nss-util-3.12.3.99.3-9.fc12.i686
+       # rpmdb: Build signature doesn't match environment
+       # on: fedora-{11,12}-i386
+       #if [ "$i" = "${i#*/fedora-rawhide-}" ];then
+       #       mock $opts -r `basename $i` --no-clean --no-cleanup-after --rebuild /usr/local/share/empty-0.1-1.src.rpm
+       #fi
+       # Just rpmbuild would error with:
+       # error: cannot open Packages index using db3 - Invalid argument (22)
+       rpm -r $i/root --rebuilddb
+done
+
+       echo done mockupdate "$*"