diff options
author | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-06-02 05:10:38 +0000 |
---|---|---|
committer | Rafael Garcia-Suarez <rgarciasuarez@mandriva.org> | 2005-06-02 05:10:38 +0000 |
commit | d247558cf3cac28d09814f04625f4c2f02e3d070 (patch) | |
tree | e92082d7f550c13b20e8157b3d8dedec041e06ba /urpm | |
parent | bb8190b63fbd965cf2e2add5a34822df0d871ea1 (diff) | |
download | urpmi-d247558cf3cac28d09814f04625f4c2f02e3d070.tar urpmi-d247558cf3cac28d09814f04625f4c2f02e3d070.tar.gz urpmi-d247558cf3cac28d09814f04625f4c2f02e3d070.tar.bz2 urpmi-d247558cf3cac28d09814f04625f4c2f02e3d070.tar.xz urpmi-d247558cf3cac28d09814f04625f4c2f02e3d070.zip |
A function to encapsulate calls to apply_delta_rpm
Diffstat (limited to 'urpm')
-rw-r--r-- | urpm/sys.pm | 15 |
1 files changed, 14 insertions, 1 deletions
diff --git a/urpm/sys.pm b/urpm/sys.pm index 02ba628b..b94aee48 100644 --- a/urpm/sys.pm +++ b/urpm/sys.pm @@ -119,11 +119,24 @@ sub check_fs_writable () { local *_; while (<$mounts>) { (undef, our $mountpoint, undef, my $opts) = split ' '; - if ($opts =~ /\bro\b/ && $mountpoint =~ m!^(/|/usr|/s?bin)$!) { + if ($opts =~ /\bro\b/ && $mountpoint =~ m!^(/|/usr|/s?bin)\z!) { return 0; } } 1; } +#- 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 +our $APPLYDELTARPM = '/usr/bin/applydeltarpm'; +sub apply_delta_rpm { + my ($deltarpm) = @_; + -x $APPLYDELTARPM or return 0; + -e $deltarpm or return 0; + my $rpm = qx(rpm -qp --qf '%{name}-%{version}-%{release}.%{arch}.rpm' '$deltarpm'); + $rpm or return 0; + warn "[$APPLYDELTARPM -vp $deltarpm $rpm]\n"; + (!system($APPLYDELTARPM, '-vp', $deltarpm, $rpm)) ? $rpm : 0; +} + 1; |