diff options
author | Pascal Rigaux <pixel@mandriva.com> | 2008-06-24 16:39:22 +0000 |
---|---|---|
committer | Pascal Rigaux <pixel@mandriva.com> | 2008-06-24 16:39:22 +0000 |
commit | 88c4b8e65b198d0908b4b0387436e7f46bc29064 (patch) | |
tree | fa52cef3c7c9ae21187d5345f06d08b9619e77b4 | |
parent | ad5bafb5f3e215165653c9c1f83e67bd08f482de (diff) | |
download | urpmi-88c4b8e65b198d0908b4b0387436e7f46bc29064.tar urpmi-88c4b8e65b198d0908b4b0387436e7f46bc29064.tar.gz urpmi-88c4b8e65b198d0908b4b0387436e7f46bc29064.tar.bz2 urpmi-88c4b8e65b198d0908b4b0387436e7f46bc29064.tar.xz urpmi-88c4b8e65b198d0908b4b0387436e7f46bc29064.zip |
- all tools:
o statedir files are now in /var/lib/urpmi/<medium-name>/
for eg: /var/lib/urpmi/synthesis.hdlist.<medium-name> is now
/var/lib/urpmi/<medium-name>/synthesis.hdlist.cz
it allows easier medium update without using urpmi.update (#31893)
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | urpm/media.pm | 26 |
2 files changed, 28 insertions, 3 deletions
@@ -1,3 +1,8 @@ +- all tools: + o statedir files are now in /var/lib/urpmi/<medium-name>/ + for eg: /var/lib/urpmi/synthesis.hdlist.<medium-name> is now + /var/lib/urpmi/<medium-name>/synthesis.hdlist.cz + it allows easier medium update without using urpmi.update (#31893) - urpmi: o set connection timeout for rsync as well (Anssi) o fix --replacepkgs when a same package appears more than once in urpmi db diff --git a/urpm/media.pm b/urpm/media.pm index c9bff53d..9b3f3bc6 100644 --- a/urpm/media.pm +++ b/urpm/media.pm @@ -321,10 +321,25 @@ sub statedir_media_info_basename { $medium->{name} && "$prefix.$medium->{name}$suffix"; } -sub statedir_media_info_file { +sub statedir_media_info_dir { + my ($urpm, $medium) = @_; + $medium->{name} && "$urpm->{statedir}/$medium->{name}"; +} + +sub old_statedir_media_info_file { my ($urpm, $medium, $prefix, $suffix) = @_; $medium->{name} && "$urpm->{statedir}/" . statedir_media_info_basename($medium, $prefix, $suffix); } +sub new_statedir_media_info_file { + my ($urpm, $medium, $prefix, $suffix) = @_; + my $dir = statedir_media_info_dir($urpm, $medium); + $dir && "$dir/$prefix$suffix"; +} +sub statedir_media_info_file { + my ($urpm, $medium, $prefix, $suffix) = @_; + my $dir = statedir_media_info_dir($urpm, $medium); + -d $dir ? "$dir/$prefix$suffix" : old_statedir_media_info_file($urpm, $medium, $prefix, $suffix); +} sub statedir_synthesis { my ($urpm, $medium) = @_; statedir_media_info_file($urpm, $medium, 'synthesis.hdlist', '.cz'); @@ -335,7 +350,7 @@ sub statedir_descriptions { } sub statedir_names { my ($urpm, $medium) = @_; - statedir_media_info_file($urpm, $medium, 'names', ''); + old_statedir_media_info_file($urpm, $medium, 'names', ''); } sub statedir_MD5SUM { my ($urpm, $medium) = @_; @@ -710,6 +725,7 @@ sub add_medium { #- those files must not be there (cf mdvbz#36267) _clean_statedir_medium_files($urpm, $medium); + mkdir statedir_media_info_dir($urpm, $medium), 0755 if !$options{virtual} || !_local_file($medium); if ($options{virtual}) { $medium->{virtual} = 1; @@ -952,7 +968,11 @@ sub _clean_statedir_medium_files { my ($urpm, $medium) = @_; #- remove files associated with this medium. - unlink grep { $_ } map { statedir_media_info_file($urpm, $medium, $_->[0], $_->[1]) } @media_info_prefix_suffix; + unlink grep { $_ } map { old_statedir_media_info_file($urpm, $medium, $_->[0], $_->[1]) } @media_info_prefix_suffix; + + my $dir = statedir_media_info_dir($urpm, $medium); + -d $dir and urpm::sys::clean_dir($dir); + remove_user_media_info_files($urpm, $medium); } |