|
From: | Stuart Hughes |
Subject: | Re: [Ltib] Handling PKG_KERNEL_LEAVESRC? |
Date: | Sun, 04 Mar 2012 19:01:20 +0000 |
User-agent: | Mozilla/5.0 (X11; Linux i686; rv:10.0.2) Gecko/20120216 Thunderbird/10.0.2 |
Hi Peter, I've checked in your patch with some minor changes (attached): * Change tabs to spaces * Add a quick exit when refusing to clobber (prevents double message output). Thanks for the patch. Regards, Stuart On 16/02/12 15:18, Peter Barada wrote: > 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: > > address@hidden:~/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: > > address@hidden:~/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. > > > > > _______________________________________________ > LTIB home page: http://ltib.org > > Ltib mailing list > address@hidden > https://lists.nongnu.org/mailman/listinfo/ltib
--- Begin Message ---Subject: ltib .ltibrc ltib Date: Sun, 04 Mar 2012 18:59:39 +0000 CVSROOT: /sources/ltib Module name: ltib Changes by: Stuart Hughes <seh> 12/03/04 18:59:39 Modified files: . : .ltibrc ltib Log message: Add --clobber option. Submitted by Peter Barada on 20120212 CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/ltib/.ltibrc?cvsroot=ltib&r1=1.17&r2=1.18 http://cvs.savannah.gnu.org/viewcvs/ltib/ltib?cvsroot=ltib&r1=1.81&r2=1.82 Patches: Index: .ltibrc =================================================================== RCS file: /sources/ltib/ltib/.ltibrc,v retrieving revision 1.17 retrieving revision 1.18 diff -u -b -r1.17 -r1.18 --- .ltibrc 4 Mar 2012 17:56:10 -0000 1.17 +++ .ltibrc 4 Mar 2012 18:59:39 -0000 1.18 @@ -102,6 +102,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.81 retrieving revision 1.82 diff -u -b -r1.81 -r1.82 --- ltib 4 Mar 2012 18:24:30 -0000 1.81 +++ ltib 4 Mar 2012 18:59:39 -0000 1.82 @@ -115,7 +115,7 @@ TOOLCHAIN_CFLAGS DISTRO PKG_UCLIBC PKG_GLIBC LIBC_HACKING", app_version => "11.4.1", - cvs_version => '$Revision: 1.81 $', + cvs_version => '$Revision: 1.82 $', config_dir => "$top/config", platforms_dir => "$top/config/platform", plat_dir => "", @@ -198,6 +198,7 @@ no_sudo_check => 0, # fc9 work-around help => 0, + clobber => 0, }; use strict 'vars'; @@ -350,6 +351,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 @@ -406,6 +408,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}, @@ -846,6 +849,30 @@ 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 + $cf->{pkg_build_failures} .= "$sn "; + return; + } + } + if( $dir_bld ) { # Don't allow scbuild/scdeploy of host rpms if($cf->{hostinst} || $cf->{mode} ne 'buildrpms') {
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |