summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2008-01-11 17:26:52 +0000
committerPascal Rigaux <pixel@mandriva.com>2008-01-11 17:26:52 +0000
commitd8314d9dd12f1bc40960ee9a498ded4ed9e917a3 (patch)
tree7c21d95e48ce824e36707cede847a1e014488306 /urpm.pm
parent8d2124bcbfd6f1d206035c95b2c88054bfae8612 (diff)
downloadurpmi-d8314d9dd12f1bc40960ee9a498ded4ed9e917a3.tar
urpmi-d8314d9dd12f1bc40960ee9a498ded4ed9e917a3.tar.gz
urpmi-d8314d9dd12f1bc40960ee9a498ded4ed9e917a3.tar.bz2
urpmi-d8314d9dd12f1bc40960ee9a498ded4ed9e917a3.tar.xz
urpmi-d8314d9dd12f1bc40960ee9a498ded4ed9e917a3.zip
- 5.0
- urpmf, urpmq: o use xml info instead of hdlist when possible o "urpmq -l" is faster (3x) o "urpmf -l" is slower (1.5x) o "urpmf --sourcerpm" is much faster o see "xml-info" option in urpmi.cfg(5) to see when those files are downloaded o new require: perl module XML::LibXML - urpmq: o use rpm file instead of hdlist/xml-info when file is local o use URPM::Package->changelogs (need perl-URPM 3.06) - urpmi.update, urpmi.addmedia, urpmi.removemedia: o drop hdlist support replaced with xml media_info (this imply file-deps are correctly handled, see genhdlist2(1)) - urpmi.addmedia o new --xml-info option
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm22
1 files changed, 21 insertions, 1 deletions
diff --git a/urpm.pm b/urpm.pm
index 1e7c5c26..250a9204 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -12,7 +12,7 @@ use urpm::sys;
use urpm::cfg;
use urpm::md5sum;
-our $VERSION = '4.10.19';
+our $VERSION = '5.0';
our @ISA = qw(URPM Exporter);
our @EXPORT_OK = 'file_from_local_url';
@@ -24,12 +24,15 @@ sub shunt_ignorearch {
eval q( sub URPM::Package::is_arch_compat { 1 } );
}
+sub xml_info_policies() { qw(never on-demand update-only always) }
+
sub default_options {
{
'split-level' => 1,
'split-length' => 8,
'verify-rpm' => 1,
'post-clean' => 1,
+ 'xml-info' => 'on-demand',
};
}
@@ -91,6 +94,23 @@ sub prefer_rooted {
-e "$root$file" ? "$root$file" : $file;
}
+sub userdir_prefix {
+ my ($_urpm) = @_;
+ '/tmp/.urpmi-';
+}
+sub userdir {
+ my ($urpm) = @_;
+ $< or return;
+
+ my $dir = ($urpm->{urpmi_root} || '') . userdir_prefix($urpm) . $<;
+ mkdir $dir, 0755; # try to create it
+
+ -d $dir && ! -l $dir or $urpm->{fatal}(N("fail to create directory %s", $dir));
+ -o $dir && -w $dir or $urpm->{fatal}(N("invalid owner for directory %s", $dir));
+
+ $dir;
+}
+
sub set_files {
my ($urpm, $urpmi_root) = @_;
my %h = (