On 02/16/2012 09:13 AM, Peter Barada wrote: > On 02/16/2012 03:08 AM, Stuart Hughes wrote: >> Maybe the best thing would be to allow this per project using a setting in >> the .ltibrc file. That way a user would knowingly turn off clobber >> protection. > That would work perfectly! > > Then if someone tries using --clobber w/o the appropriate flag set in > .ltibrc it will ignore it (and spit out an appropirate message). > > I'll code something up against the current LTIB and send it out. Attached. To enable it you need both %allow_clobber in .ltibrc set to non-zero *and* --clobber on the command line. To test you can try:
./ltib -p skell -m prep touch dist/lfs-5.1/skell/*.spec ./ltib --clobber -p skell In my case I have a OMAP-specific skell-omap-logic.spec. If I have %allow_clobber enabled I see: peter@turbo:~/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0$ ./ltib --clobber -p skell Processing platform: Logic OMAP3530/03&DM3730/03 reference boards =================================================================== using config/platform/omap_logic/.config Processing: skell-omap_logic ============================== Build path taken because: directory build, spec file newer than rpm, Clobber forces removal of /home/peter/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0/rpm/BUILD/skell-1.19 rpmbuild --dbpath /home/peter/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0/rootfs//var/lib/rpm --target arm --define '_unpackaged_files_terminate_build 0' --define '_target_cpu arm' --define '__strip strip' --define '_topdir /home/peter/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0/rpm' --define '_prefix /usr' --define '_tmppath /home/peter/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0/tmp' --define '_rpmdir /home/peter/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0/rpm/RPMS' --define '_mandir /usr/share/man' --define '_sysconfdir /etc' --define '_localstatedir /var' -bb --clean --rmsource /home/peter/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0/dist/lfs-5.1/skell/skell-omap_logic.spec Building target platforms: arm Building for target arm Executing(%prep): /bin/sh -e /home/peter/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0/tmp/rpm-tmp.63989 + umask 022 + cd /home/peter/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0/rpm/BUILD + cd /home/peter/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0/rpm/BUILD + rm -rf skell-1.19 + tar -xvvf - + /bin/gzip -dc /home/peter/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0/rpm/SOURCES/skell-1.19.tar.gz ... And if %allow_clobber is not set I get: peter@turbo:~/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0$ ./ltib --clobber -p skell Processing platform: Logic OMAP3530/03&DM3730/03 reference boards =================================================================== using config/platform/omap_logic/.config Processing: skell-omap_logic ============================== Build path taken because: directory build, no prebuilt rpm, Package skell-omap_logic specfile is updated but package build source exists. --clobber specified but %allow_clobber not enabled in .ltibrc; Cowardly refusing to to clobber existing build source: /home/peter/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-3.0/rpm/BUILD/skell-1.19 Enable %allow_clobber in .ltibrc if you really want to automatically remove package build source if specfile is updated scbuild/scdeploy already unpacked package Processing: skell-omap_logic ============================== Build path taken because: directory build, build key set, no prebuilt rpm, Mike, can you try this patch to see if it works in your continuous integration server? Note that the patch does *note* enable %allow_clobber in .ltibrc; you need to uncomment %allow_clobber (and the value following it) *and* set the value to non-zero. -- Peter Barada peter.bar...@logicpd.com
Index: .ltibrc =================================================================== RCS file: /sources/ltib/ltib/.ltibrc,v retrieving revision 1.16 diff -u -r1.16 .ltibrc --- .ltibrc 17 Aug 2010 18:18:00 -0000 1.16 +++ .ltibrc 16 Feb 2012 15:22:49 -0000 @@ -100,6 +100,11 @@ #%use_localtime #0 +# control whether --clobber will remove package build directory if +# package specfile has been updated +#%allow_clobber +#0 + # This is used to trigger re-running the host install package # pass. Bump this number up if you update a host support # package and you want to force others to install this update Index: ltib =================================================================== RCS file: /sources/ltib/ltib/ltib,v retrieving revision 1.78 diff -u -r1.78 ltib --- ltib 29 Nov 2011 07:43:55 -0000 1.78 +++ ltib 16 Feb 2012 15:22:50 -0000 @@ -198,6 +198,7 @@ no_sudo_check => 0, # fc9 work-around help => 0, + clobber => 0, }; use strict 'vars'; @@ -343,6 +344,7 @@ --rcfile|r <f>: use this resource file --batch|b : batch mode, assume yes to all questions --force|f : force rebuilds even if they are up to date + --clobber|K : clobber a package build source if its specfile is updated --reinstall|e : re-install rpms (but don't force rebuild) --erase|E : remove (erase) rpm --nodeps|n : turn off install/uninstall dependency checks @@ -399,6 +401,7 @@ "verbose|v" => \$verbose, "batch|b" => \$cf->{batch}, "force|f" => \$cf->{force}, + "clobber|K" => \$cf->{clobber}, "reinstall|e"=> \$cf->{reinstall}, "erase|E" => \$cf->{erase}, "nodeps|n" => \$cf->{nodeps}, @@ -839,6 +842,28 @@ return 1 if $cf->{download_only}; return 1 if $cf->{dltest}; + # if --clobber set (and spec file is updated, remove package source + # unless %allow_clobber is not set in ~/.ltibrc + if ($cf->{clobber} && $dir_bld && $unpack eq 'yes' && ( $spec_upd || ! @rpms)) { + if ($cf->{allow_clobber}) { + print "Clobber forces removal of $cf->{rpmdir}/BUILD/$tok->{pkg_dir_name}\n"; + system_nb("rm -rf $cf->{rpmdir}/BUILD/$tok->{pkg_dir_name}"); + # force prep + $dir_bld = 0; + } else { + warn(<<TXT); + +Package $sn specfile is updated but package build source exists. +--clobber specified but %allow_clobber not enabled in .ltibrc; +Cowardly refusing to to clobber existing build source: + $cf->{rpmdir}/BUILD/$tok->{pkg_dir_name} +Enable %allow_clobber in .ltibrc if you really want to automatically remove +package build source if specfile is updated + +TXT + } + } + if( $dir_bld ) { # Don't allow scbuild/scdeploy of host rpms if($cf->{hostinst} || $cf->{mode} ne 'buildrpms') {
_______________________________________________ LTIB home page: http://ltib.org Ltib mailing list Ltib@nongnu.org https://lists.nongnu.org/mailman/listinfo/ltib