From dc608f3ff0e841e33e04d9144c2681cd86acf658 Mon Sep 17 00:00:00 2001 From: Pascal Terjan Date: Wed, 30 Dec 2009 23:12:22 +0000 Subject: Try harder to decide which one is re-generated rpm --- lib/Iurt/Urpmi.pm | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm index a08c67b..042ec8f 100644 --- a/lib/Iurt/Urpmi.pm +++ b/lib/Iurt/Urpmi.pm @@ -676,16 +676,13 @@ sub recreate_srpm { # . # assigning '.' to $new_rpm. Now sorting the output. - # we should better perform a rpm -qp -qf "%{name}-%{version}-%{release}.src.rpm" $spec + # 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; - my $stat; foreach my $f (glob "$chroot_tmp/home/$luser/rpm/SRPMS/$name-*.src.rpm") { - my (@s) = stat $f; - if ($s[9] > $stat) { - $file = $f; - $stat = $s[9]; - } - } + $file = $f if $f ne $oldsrpm; + } my ($new_srpm) = basename($file); my $prefix = get_package_prefix($srpm); my $newfile = "$chroot_tmp/home/$luser/rpm/SRPMS/$prefix$new_srpm"; -- cgit v1.2.1