aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt/Urpmi.pm
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@gmail.org>2014-10-12 12:57:40 +0100
committerPascal Terjan <pterjan@gmail.com>2014-10-12 11:59:05 +0000
commitab201ebc3d8b92a77f204634e22566b8351f9319 (patch)
treee65921d0d6ced2b912b11a181d49d17982e62cd2 /lib/Iurt/Urpmi.pm
parent50a2ca1a336a4dc1da6cc97dac313c7fa70b1c00 (diff)
downloadiurt-ab201ebc3d8b92a77f204634e22566b8351f9319.tar
iurt-ab201ebc3d8b92a77f204634e22566b8351f9319.tar.gz
iurt-ab201ebc3d8b92a77f204634e22566b8351f9319.tar.bz2
iurt-ab201ebc3d8b92a77f204634e22566b8351f9319.tar.xz
iurt-ab201ebc3d8b92a77f204634e22566b8351f9319.zip
Remove old src.rpm before recreating it (mga#14243)
Diffstat (limited to 'lib/Iurt/Urpmi.pm')
-rw-r--r--lib/Iurt/Urpmi.pm14
1 files changed, 6 insertions, 8 deletions
diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm
index e2f305d..c8f3bbd 100644
--- a/lib/Iurt/Urpmi.pm
+++ b/lib/Iurt/Urpmi.pm
@@ -629,7 +629,11 @@ sub recreate_srpm {
$spec = $file;
}
}
- }
+ }
+
+ # Delete old src.rpm, we will create it again
+ sudo($config, '--rm', $oldsrpm) or die "$program_name: could not delete $oldsrpm ($!)";
+
# 20060515 This should not be necessairy any more if urpmi *.spec works, but it doesn't
#
my $ret = perform_command(qq(chroot $chroot_tmp su $luser -c "rpmbuild --nodeps -bs $with_flags /home/$luser/rpmbuild/SPECS/$spec"),
@@ -645,13 +649,7 @@ sub recreate_srpm {
#
return 0 unless $ret;
- # we can not ask rpm the generated srpm name
- # we can not rely on build time (one of the src.rpm may have been built on a machine with wrong time)
- # let's say that if we have several one, we want the non original one
- my $file = $oldsrpm;
- foreach my $f (glob "$chroot_tmp/home/$luser/rpmbuild/SRPMS/$name-*.src.rpm") {
- $file = $f if $f ne $oldsrpm;
- }
+ my $file = (glob "$chroot_tmp/home/$luser/rpmbuild/SRPMS/$name-*.src.rpm")[0];
my ($new_srpm) = basename($file);
my $prefix = get_package_prefix($srpm);
my $newfile = "$chroot_tmp/home/$luser/rpmbuild/SRPMS/$prefix$new_srpm";