[CentOS-devel] Advice on compiling multiple packages with mock

Ljubomir Ljubojevic office at plnet.rs
Tue Sep 27 15:48:19 EDT 2011


Време: 09/27/2011 06:49 PM, R P Herrold пише:
> On Tue, 27 Sep 2011, Ljubomir Ljubojevic wrote:
>
>> Can someone point me in the right direction? How do you compile multiple
>> packages continuously with mock?
>>
>> I have some 50 srpms waiting to be recompiled via mock for both i386 and
>> x86_64 (again).
>>
>> 1. Is there a command I can give so all the packages are compiled in one go?
>>
>> 2. Do I have to sort them in proper order (dependencies) or can I just
>> command to mock to check and sort them?
>
> A naiive build algorithm simply submits and checks the return
>
> Build Requirements are readily queriable, and testable as to
> whether they are met; as such one need not pay the time cost
> of enqueuing a build that is pre-ordained to fail by doing
> minimal checking first
>
> Driving such a system off of versioned BR's require a bit more
> logic than that of the last paragraph, and may not always be
> 'correct'
>
> Mutual cross-dependant BR's require manual solution 'out of
> band' of a submission engine, usually by 'short circuiting'
> around one missing 'leg' of such a cross-dependency; this kind
> of issue can also solved in .spec file conditionals logic,
> keyed on '--defines', although this is not seen in the CentOS
> project's upstream very often
>
>> From my notes on the topic:
>

<snip>

Thanks, I will look at those.

For manual rpmbuild, , I created following script (needs root or sudo 
access for yum) for automatic installation of dependency rpms:

#!/bin/bash

# rpm-depinstaller
# Author: Ljubomir Ljubojevic <office a plnet.rs>
# 31.01.2010



ls -C -1 -R -p $1 > 1_prelist-in.txt
cat 1_prelist-in.txt | grep "src.rpm" | grep -v "/" > 2_list-in.txt

#exit
# list=""
# list=`ls *.rpm -R`
list=`cat 2_list-in.txt`
#list=$@
echo Lista je $list
for i in $list; do
    rpmbuild --rebuild --nobuild -ba $i >& 3_text-in.txt
    cat 3_text-in.txt | grep needed >> 4_for_install-in.txt
done

cat 4_for_install-in.txt | sort > 5_sorted_install_list.txt
cat 4_for_install-in.txt | sort | cut -d " " -f1 | awk '{print $4 " " 
$1}' | sort | uniq > 6_sortedlist-in.txt
cat 6_sortedlist-in.txt | awk '/^[0-9]/ { print ""; printf $0} !/^[0-9]/ 
{printf $0} END {print ""}' > 7_yumlist-in.txt
#rm text.txt

yum install $(cat 7_yumlist-in.txt)

I deliberately avoided deleting log files, so I can debug or harvest data.

-- 

Ljubomir Ljubojevic
(Love is in the Air)
PL Computers
Serbia, Europe

Google is the Mother, Google is the Father, and traceroute is your
trusty Spiderman...
StarOS, Mikrotik and CentOS/RHEL/Linux consultant


More information about the CentOS-devel mailing list