5 if [ "$1" = "-v" ];then
11 if [ "$1" = "-q" ];then
16 if [ -z "$HOME" -o "$HOME" = "/" ];then
21 if [ "$i" = "${i#/var/lib/mock/}" ];then
22 echo >&2 "$i not /var/lib/mock/*"
25 if [ "$i" != "${i#*/root}" ];then
26 echo >&2 "$i contains /root"
29 if [ "$i" != "${i%-intel}" ];then
35 for p in /proc/*/root;do
37 if [ "${l#$i/}" != "$l" ];then
45 echo >&2 "$i has existing processes: $b"
49 r="$(basename $i|sed 's/\(-x86_64\|-i.86\)-.*$/\1/')"
50 r="$r$(basename $i|sed -n 's/^.*\(-x86_64\|-i.86\)-\(.*\)$/ --uniqueext=\2/p')"
51 /usr/local/sbin/mocksetup -u `basename $i`
53 rm -f $i/root/var/lib/rpm/__db.*
54 mock $opts -r $r --update
55 mock $opts -r $r --install `cat $HOME/src/INSTALL`
56 # Otherwise: error: cannot open Packages index using db3 - Invalid argument (22)
57 if [ "${i#*/epel-[45]-}" = "$i" ];then
58 rm -f $i/root/var/lib/rpm/__db.*
59 mock $opts -r $r --shell 'package-cleanup --cleandupes'
60 rm -f $i/root/var/lib/rpm/__db.*
61 mock $opts -r $r --update
62 mock $opts -r $r --install `cat $HOME/src/INSTALL`
65 # Otherwise: error: cannot open Packages index using db3 - Invalid argument (22)
66 if [ "${i#*/epel-[45]-}" = "$i" ];then
67 rm -f $i/root/var/lib/rpm/__db.*
68 mock $opts -r $r --shell 'package-cleanup --cleandupes'
70 rm -f $i/root/var/lib/rpm/__db.*
71 # Run: yum groupinstall buildsys-build
72 # Cleaning would undo the changes above.
73 # 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
74 # rpmdb: Build signature doesn't match environment
75 # on: fedora-{11,12}-i386
76 #if [ "$i" = "${i#*/fedora-rawhide-}" ];then
77 # mock $opts -r `basename $i` --no-clean --no-cleanup-after --rebuild /usr/local/share/empty-0.1-1.src.rpm
79 # Just rpmbuild would error with:
80 # error: cannot open Packages index using db3 - Invalid argument (22)
81 rpm -r $i/root --rebuilddb
82 # Leftover usually just removing vital system packages:
83 rm -f $i/root/var/lib/yum/transaction-*
85 rpm -r $i/root --qf '%{name}.%{arch}\n' -qa|sort|uniq -d|grep -v '^kernel\.'|sed -e '1s/^/ror duplicity:\n/' -e '1s/^/mockupdate er/'
88 echo done mockupdate "$*"