Run also `package-cleanup --cleandupes'.
authorlace <>
Fri, 23 Apr 2010 13:37:38 +0000 (13:37 +0000)
committerlace <>
Fri, 23 Apr 2010 13:37:38 +0000 (13:37 +0000)
 - It seems to be only a workaround of mock.

bin/mockupdate

index c03a5be..fc22ef6 100755 (executable)
@@ -49,11 +49,25 @@ for i in "$@";do
        r="$(basename $i|sed 's/\(-x86_64\|-i.86\)-.*$/\1/')"
        r="$r$(basename $i|sed -n 's/^.*\(-x86_64\|-i.86\)-\(.*\)$/ --uniqueext=\2/p')"
        /usr/local/sbin/mocksetup -u `basename $i`
-       rm -f $i/root/var/lib/rpm/__db.*
        if ! $quick;then
+               rm -f $i/root/var/lib/rpm/__db.*
                mock $opts -r $r --update
                mock $opts -r $r --install `cat $HOME/src/INSTALL`
+               # Otherwise: error: cannot open Packages index using db3 - Invalid argument (22)
+               if [ "${i#*/epel-[45]-}" = "$i" ];then
+                       rm -f $i/root/var/lib/rpm/__db.*
+                       mock $opts -r $r --shell 'package-cleanup --cleandupes'
+                       rm -f $i/root/var/lib/rpm/__db.*
+                       mock $opts -r $r --update
+                       mock $opts -r $r --install `cat $HOME/src/INSTALL`
+               fi
        fi
+       # Otherwise: error: cannot open Packages index using db3 - Invalid argument (22)
+       if [ "${i#*/epel-[45]-}" = "$i" ];then
+               rm -f $i/root/var/lib/rpm/__db.*
+               mock $opts -r $r --shell 'package-cleanup --cleandupes'
+       fi
+       rm -f $i/root/var/lib/rpm/__db.*
        # 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