aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-06-01 09:39:44 +0000
committerRafael Garcia-Suarez <rgarciasuarez@mandriva.org>2005-06-01 09:39:44 +0000
commitd1ef0f4ab33fc7230ed303af92d4613da796dc66 (patch)
treee71d44ea563121812662d65522f4c21341a48bff
parent1d01d5ba0b3d05b45d9d0dd4bbc37e73e665372e (diff)
downloadperl-URPM-d1ef0f4ab33fc7230ed303af92d4613da796dc66.tar
perl-URPM-d1ef0f4ab33fc7230ed303af92d4613da796dc66.tar.gz
perl-URPM-d1ef0f4ab33fc7230ed303af92d4613da796dc66.tar.bz2
perl-URPM-d1ef0f4ab33fc7230ed303af92d4613da796dc66.tar.xz
perl-URPM-d1ef0f4ab33fc7230ed303af92d4613da796dc66.zip
Warning fixes and documentation
-rw-r--r--URPM/Build.pm18
1 files changed, 13 insertions, 5 deletions
diff --git a/URPM/Build.pm b/URPM/Build.pm
index 073eaa8..6debbc0 100644
--- a/URPM/Build.pm
+++ b/URPM/Build.pm
@@ -31,7 +31,8 @@ sub parse_rpms_build_headers {
#- examine cache if it contains any headers which will be much faster to read
#- than parsing rpm file directly.
unless ($options{clean}) {
- opendir my $dirh, $dir;
+ my $dirh;
+ opendir $dirh, $dir;
while (defined (my $file = readdir $dirh)) {
my ($fullname, $filename) = $file =~ /(.+?-[^:\-]+-[^:\-]+\.[^:\-\.]+)(?::(\S+))?$/ or next;
my @stat = stat "$dir/$file";
@@ -527,13 +528,20 @@ sub build_base_files {
}
our $MAKEDELTARPM = '/usr/bin/makedeltarpm';
+
+=item make_delta_rpm($old_rpm_file, $new_rpm_file)
+
+Creates a delta rpm in the current directory.
+
+=cut
+
sub make_delta_rpm ($$) {
- my (@files) = @_;
- -e $files[0] && -e $files[1] && -x $MAKEDELTARPM or return 0;
+ @_ == 2 or return 0;
+ -e $_[0] && -e $_[1] && -x $MAKEDELTARPM or return 0;
my @id;
my $urpm = new URPM;
foreach my $i (0, 1) {
- ($id[$i]) = $urpm->parse_rpm($files[$i]);
+ ($id[$i]) = $urpm->parse_rpm($_[$i]);
defined $id[$i] or return 0;
}
my $oldpkg = $urpm->{depslist}[$id[0]];
@@ -541,7 +549,7 @@ sub make_delta_rpm ($$) {
$oldpkg->arch eq $newpkg->arch or return 0;
#- construct filename of the deltarpm
my $patchrpm = $oldpkg->name . '-' . $oldpkg->version . '-' . $oldpkg->release . '_' . $newpkg->version . '-' . $newpkg->release . '.' . $oldpkg->arch . '.delta.rpm';
- !system($MAKEDELTARPM, $files[0], $files[1], $patchrpm);
+ !system($MAKEDELTARPM, @_, $patchrpm);
}
1;