|
From: | Stuart Hughes |
Subject: | Re: [Ltib] zero-length patches from "-m patchmerge".... |
Date: | Sun, 25 Jul 2010 12:11:34 +0100 |
User-agent: | Thunderbird 2.0.0.16 (X11/20080707) |
Hi Peter, Thanks again for the patch. I ended up checking in this, which is functionally the same: Regards, Stuart Stuart Hughes wrote: > Hi Peter, > > Looks good to me, I will apply when I get a chance. > > Thanks for the patch. > > Regards, Stuart > > Peter Barada wrote: >> Stuart, >> >> Here's a patch that makes "./ltib -p <pkg> -m patchmerge" an effective >> no-op if resultant patch is zero-length, moving the >> $pkg_dir_name.modivied back to the original $pkg_dir_name, so you can do >> "./ltib -p <pkg> -m patchmerge; ./ltib -p <pkg> -m scbuild; ./ltib -p >> <pkg> -m patchmerge" successfully if the results are zero-length.... >> >> My perl "fu" is pretty weak so I'm sure there's got to be a better way >> to do it. :) >> >> >> address@hidden:~/work/logic/eps_svn/software/products/linux/LTIB/trunk/ltib-20091102$ >> svn diff ltib >> Index: ltib >> =================================================================== >> --- ltib (revision 10693) >> +++ ltib (working copy) >> @@ -1170,7 +1170,18 @@ >> diff --exclude CVS --exclude .git -uNr $pkg_dir_name >> $pkg_dir_name.modified > $cf->{lpp}/$pname >> rm -rf $cf->{rpmdir}/BUILD/$pkg_dir_name >> TXT >> + my $filesize = (stat("$cf->{lpp}/$pname"))[7]; >> + if ($filesize == 0) { >> + print <<TXT; >> >> +Resultant patch is zero-length, ignoring. >> + >> +TXT >> + system_nb("rm $cf->{lpp}/$pname"); >> + system_nb("mv $cf->{rpmdir}/BUILD/$pkg_dir_name.modified >> $cf->{rpmdir}/BUILD/$pkg_dir_name"); >> + return 1; >> + } >> + >> open(SPEC, ">$spec.bak") or die("can't open $spec.bak for writing: >> $!"); >> print SPEC $_; >> close SPEC; >> >> >> ------------------------------------------------------------------------
--- Begin Message ---Subject: ltib ltib Date: Sun, 25 Jul 2010 11:08:10 +0000 CVSROOT: /sources/ltib Module name: ltib Changes by: Stuart Hughes <seh> 10/07/25 11:08:09 Modified files: . : ltib Log message: When running patchmerge, test and ignore the no-changes scenario. Adapted from an idea sent to the mailing list be Peter Barada on the LTIB mailing list (20th July 2010) CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/ltib/ltib?cvsroot=ltib&r1=1.68&r2=1.69 Patches: Index: ltib =================================================================== RCS file: /sources/ltib/ltib/ltib,v retrieving revision 1.68 retrieving revision 1.69 diff -u -b -r1.68 -r1.69 --- ltib 4 May 2010 12:59:33 -0000 1.68 +++ ltib 25 Jul 2010 11:08:08 -0000 1.69 @@ -115,7 +115,7 @@ TOOLCHAIN_CFLAGS DISTRO PKG_UCLIBC PKG_GLIBC LIBC_HACKING", app_version => "10.1.1", - cvs_version => '$Revision: 1.68 $', + cvs_version => '$Revision: 1.69 $', config_dir => "$top/config", platforms_dir => "$top/config/platform", plat_dir => "", @@ -1173,7 +1173,20 @@ cd $cf->{rpmdir}/BUILD diff --exclude CVS --exclude .git -uNr $pkg_dir_name $pkg_dir_name.modified > $cf->{lpp}/$pname rm -rf $cf->{rpmdir}/BUILD/$pkg_dir_name + +# check to see if any changes were made +if [ ! -s $cf->{lpp}/$pname ] +then + rm $cf->{lpp}/$pname + mv $cf->{rpmdir}/BUILD/$pkg_dir_name.modified $cf->{rpmdir}/BUILD/$pkg_dir_name +fi TXT + # if no changes were detected, then return + if(! -e "$cf->{lpp}/$pname") { + print "\nNo changes have been made to $cf->{sn}, ", + "proeject state has not been changed.\n\n"; + return 1; + } open(SPEC, ">$spec.bak") or die("can't open $spec.bak for writing: $!"); print SPEC $_;
--- End Message ---
[Prev in Thread] | Current Thread | [Next in Thread] |