From: Till Maas Date: Fri, 12 Feb 2010 15:26:29 +0000 (+0100) Subject: smock: add --overwrite option X-Git-Url: http://git.annexia.org/?p=fedora-mingw.git;a=commitdiff_plain;h=966f55f8692da3f842da077e57c22ff501e380e1 smock: add --overwrite option With --overwrite it is possible to rebuild a package, that is already in the localrepo, instead of skipping the build. --- diff --git a/smock/smock.pl b/smock/smock.pl index dc12440..d0d0042 100755 --- a/smock/smock.pl +++ b/smock/smock.pl @@ -32,6 +32,7 @@ my $help = 0; my $keepgoing = 0; my $localrepo = $ENV{HOME} . "/public_html/smock/yum"; my $man = 0; +my $overwrite = 0; my $suffix = ""; GetOptions ( @@ -43,6 +44,7 @@ GetOptions ( "keepgoing" => \$keepgoing, "localrepo=s" => \$localrepo, "man" => \$man, + "overwrite" => \$overwrite, "suffix=s" => \$suffix, ) or pod2usage (2); pod2usage (1) if $help; @@ -124,6 +126,15 @@ Local repository. Defaults to C<$HOME/public_html/smock/yum> Show this help using man. +=item B<--overwrite> + +Overwrite existing files that are already in the repository. By default the +build of an SRPM is skipped if there is already a package with the same name, +version and release in the localrepo. With this option, the new build +overwrites the old one. This may lead to unexpected results, if the new build +does not create the same subpackages as the old one, because then the old +subpackages will still be accessible in the repository. + =item B<--suffix> Append a suffix to the mock configuration file in order to use @@ -358,7 +369,11 @@ foreach my $arch (@arches) { #print "pattern = $pattern\n"; my @binaries = glob $pattern; - if (@binaries == 0) + if (@binaries != 0 && $overwrite) { + print "*** overwriting $name-$version-$release $arch $distro ***\n"; + } + + if (@binaries == 0 || $overwrite) { # Rebuild the package. print "*** building $name-$version-$release $arch $distro ***\n";