aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2017-10-03 23:45:10 +0100
committerPascal Terjan <pterjan@mageia.org>2017-10-03 23:45:18 +0100
commiteaa10d73da3e73091949f9a4d6df66a19b03a8e8 (patch)
treeea7b6e3165667de2271ebb78f0df8ec8d3eda480 /lib
parentcfe971a6e3f3260dc64c36db2eae0b3330bfdbde (diff)
downloadiurt-eaa10d73da3e73091949f9a4d6df66a19b03a8e8.tar
iurt-eaa10d73da3e73091949f9a4d6df66a19b03a8e8.tar.gz
iurt-eaa10d73da3e73091949f9a4d6df66a19b03a8e8.tar.bz2
iurt-eaa10d73da3e73091949f9a4d6df66a19b03a8e8.tar.xz
iurt-eaa10d73da3e73091949f9a4d6df66a19b03a8e8.zip
Do not use chroot urpmi
Either use urpmi --root or urpmi --urpmi-root so that packages can be installed without networking inside the chroot.
Diffstat (limited to 'lib')
-rw-r--r--lib/Iurt/Urpmi.pm12
1 files changed, 6 insertions, 6 deletions
diff --git a/lib/Iurt/Urpmi.pm b/lib/Iurt/Urpmi.pm
index 401ae91..ff702bd 100644
--- a/lib/Iurt/Urpmi.pm
+++ b/lib/Iurt/Urpmi.pm
@@ -38,7 +38,12 @@ sub new {
sub set_command {
my ($self, $_chroot_tmp) = @_;
- $self->{use__urpmi_root} ? &set_command__urpmi_root : &set_command__use_distrib;
+ if ($run->{chrooted_urpmi}) {
+ # FIXME chrooted_urpmi should always use urpmi_root and not support local media
+ $self->{use__urpmi_root} ? &set_command__urpmi_root : &set_command__use_distrib;
+ } else {
+ &set_command__use_distrib;
+ }
}
sub set_command__urpmi_root {
my ($self, $chroot_tmp) = @_;
@@ -50,10 +55,6 @@ sub set_command__use_distrib {
$self->{use_iurt_root_command} = 1;
$self->{urpmi_command} = "urpmi $self->{urpmi_options} --use-distrib $self->{distrib_url} --root $chroot_tmp";
}
-sub set_command__chrooted {
- my ($self, $chroot_tmp) = @_;
- $self->{urpmi_command} = "chroot $chroot_tmp urpmi $self->{urpmi_options} ";
-}
sub set_local_media {
my ($self, $local_media) = @_;
@@ -164,7 +165,6 @@ sub urpmi_command {
add_media($self, $chroot_tmp, 'iurt_group', "iurt_group file:///iurt_media") or next;
}
- $self->set_command__chrooted($chroot_tmp);
return 1;
} else {
$self->set_command($chroot_tmp);
>, 'attributes', 'is_upper_case_name', 'creation_time_low', #- milliseconds 'creation_time_high', 'creation_date', 'access_date', 'first_cluster_high', #- for FAT32 'time', 'date', 'first_cluster', 'length', ); my $psizeof_format = psizeof($format); 1; sub entry_size() { $psizeof_format } #- call `f' for each entry of the directory #- if f return true, then modification in the entry are taken back sub traverse($$$) { my ($directory, $curr_dir_name, $f) = @_; for (my $i = 0;; $i++) { my $raw = \substr($directory, $i * $psizeof_format, $psizeof_format); #- empty entry means end of directory $$raw =~ /^\0*$/ and return $directory; my $entry; @$entry{@fields} = unpack $format, $$raw; &$f($curr_dir_name, $entry) and $$raw = pack $format, @$entry{@fields}; } $directory; } sub traverse_all($$) { my ($fs, $f) = @_; my $traverse_all; $traverse_all = sub { my ($curr_dir_name, $entry) = @_; &$f($curr_dir_name, $entry); resize_fat::dir_entry::is_directory($entry) and traverse(resize_fat::io::read_file($fs, resize_fat::dir_entry::get_cluster($entry)), "$curr_dir_name/$entry->{name}", $traverse_all); undef; #- no need to write back (cf traverse) }; my $directory = $resize_fat::isFAT32 ? resize_fat::io::read_file($fs, $fs->{fat32_root_dir_cluster}) : resize_fat::io::read($fs, $fs->{root_dir_offset}, $fs->{root_dir_size}); traverse($directory, "", $traverse_all); undef $traverse_all; #- circular reference is no good for perl's poor GC :( } #- function used by construct_dir_tree to translate the `cluster' fields in each #- directory entry sub remap($$) { my ($_fs, $directory) = @_; traverse($directory, "", \&resize_fat::dir_entry::remap); }