X-Git-Url: http://git.annexia.org/?p=fedora-mingw.git;a=blobdiff_plain;f=smock%2Fsmock.pl;fp=smock%2Fsmock.pl;h=d0d0042883c8298476bd9c4c489530a7ae001a3b;hp=dc12440aafc0f62213562bdc80ff58784c9770ca;hb=966f55f8692da3f842da077e57c22ff501e380e1;hpb=54f01230d70c8dfa996e0dafe38e178aac4ef5fb 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";