my $keepgoing = 0;
 my $localrepo = $ENV{HOME} . "/public_html/smock/yum";
 my $man = 0;
+my $overwrite = 0;
 my $suffix = "";
 
 GetOptions (
     "keepgoing" => \$keepgoing,
     "localrepo=s" => \$localrepo,
     "man" => \$man,
+    "overwrite" => \$overwrite,
     "suffix=s" => \$suffix,
     ) or pod2usage (2);
 pod2usage (1) if $help;
 
 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
             #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";