summaryrefslogtreecommitdiffstats
path: root/urpm/sys.pm
diff options
context:
space:
mode:
Diffstat (limited to 'urpm/sys.pm')
-rw-r--r--urpm/sys.pm12
1 files changed, 10 insertions, 2 deletions
diff --git a/urpm/sys.pm b/urpm/sys.pm
index 8c7ffb97..c8d65313 100644
--- a/urpm/sys.pm
+++ b/urpm/sys.pm
@@ -128,12 +128,20 @@ sub check_fs_writable () {
#- create a plain rpm from an installed rpm and a delta rpm (in the current directory)
#- returns the new rpm filename in case of success
+#- params :
+#- $deltarpm : full pathname of the deltarpm
+#- $pkg : URPM::Package object corresponding to the deltarpm (optional)
our $APPLYDELTARPM = '/usr/bin/applydeltarpm';
sub apply_delta_rpm {
- my ($deltarpm) = @_;
+ my ($deltarpm, $pkg) = @_;
-x $APPLYDELTARPM or return 0;
-e $deltarpm or return 0;
- my $rpm = qx(rpm -qp --qf '%{name}-%{version}-%{release}.%{arch}.rpm' '$deltarpm');
+ my $rpm;
+ if ($pkg) {
+ $rpm = $pkg->name . '-' . $pkg->version . '-' . $pkg->release . '.' . $pkg->arch . '.rpm';
+ } else {
+ $rpm = qx(rpm -qp --qf '%{name}-%{version}-%{release}.%{arch}.rpm' '$deltarpm');
+ }
$rpm or return 0;
unlink $rpm;
system($APPLYDELTARPM, '-vp', $deltarpm, $rpm);