summaryrefslogtreecommitdiffstats
path: root/urpm.pm
diff options
context:
space:
mode:
authorPascal Rigaux <pixel@mandriva.com>2006-11-14 15:25:27 +0000
committerPascal Rigaux <pixel@mandriva.com>2006-11-14 15:25:27 +0000
commit93cf48ac37d07ad5084b165914f02568545b9010 (patch)
tree59ca1f354a8181e125332b1332aab9d77fcd8772 /urpm.pm
parent23870113be2ae81ea14c89def359d9bc848dc5fa (diff)
downloadurpmi-93cf48ac37d07ad5084b165914f02568545b9010.tar
urpmi-93cf48ac37d07ad5084b165914f02568545b9010.tar.gz
urpmi-93cf48ac37d07ad5084b165914f02568545b9010.tar.bz2
urpmi-93cf48ac37d07ad5084b165914f02568545b9010.tar.xz
urpmi-93cf48ac37d07ad5084b165914f02568545b9010.zip
create $urpm->{md5sum_modified} which is a finer flag than $urpm->{modified},
write_config is no more called because md5sum changed :)
Diffstat (limited to 'urpm.pm')
-rw-r--r--urpm.pm25
1 files changed, 14 insertions, 11 deletions
diff --git a/urpm.pm b/urpm.pm
index 75ac2a2a..ae03e367 100644
--- a/urpm.pm
+++ b/urpm.pm
@@ -463,6 +463,10 @@ sub write_MD5SUM {
my $s = basename(statedir_hdlist_or_synthesis($urpm, $medium));
print $fh "$medium->{md5sum} $s\n";
}
+
+ $urpm->{log}(N("wrote %s", "$urpm->{statedir}/MD5SUM"));
+
+ delete $urpm->{md5sum_modified};
}
#- Writes the urpmi.cfg file.
@@ -789,11 +793,9 @@ sub add_medium {
#- need getting the fresh datastructure after read_config
$medium = name2medium($urpm, $name); #- need getting the fresh datastructure after read_config
- #- Remember that the database has been modified and base files need to
- #- be updated. This will be done automatically by transferring the
- #- "modified" flag from medium to global.
+ #- Remember that the database has been modified and base files need to be updated.
$medium->{modified} = 1;
- $urpm->{modified} = 1;
+ $urpm->{md5sum_modified} = 1;
}
if ($has_password) {
$medium->{url} = $url;
@@ -1124,21 +1126,19 @@ sub _update_media__virtual {
_parse_synthesis($urpm, $medium, $with_hdlist_dir);
delete $medium->{modified};
$medium->{synthesis} = 1;
- $urpm->{modified} = 1;
+ $urpm->{md5sum_modified} = 1;
if (!is_valid_medium($medium)) {
_parse_hdlist($urpm, $medium, $with_hdlist_dir);
delete @$medium{qw(modified synthesis)};
- $urpm->{modified} = 1;
}
} else {
_parse_hdlist($urpm, $medium, $with_hdlist_dir);
delete @$medium{qw(modified synthesis)};
- $urpm->{modified} = 1;
+ $urpm->{md5sum_modified} = 1;
if (!is_valid_medium($medium)) {
_parse_synthesis($urpm, $medium, $with_hdlist_dir);
delete $medium->{modified};
$medium->{synthesis} = 1;
- $urpm->{modified} = 1;
}
}
_check_after_reading_hdlist_or_synthesis($urpm, $medium);
@@ -1838,7 +1838,7 @@ sub _update_medium_first_pass {
} else {
#- make sure to rebuild base files and clear medium modified state.
$medium->{modified} = 0;
- $urpm->{modified} = 1;
+ $urpm->{md5sum_modified} = 1;
#- but use newly created file.
unlink statedir_hdlist($urpm, $medium);
@@ -1899,7 +1899,7 @@ sub _update_medium_second_pass {
$urpm->{log}(N("built hdlist synthesis file for medium \"%s\"", $medium->{name}));
}
#- keep in mind we have a modified database, sure at this point.
- $urpm->{modified} = 1;
+ $urpm->{md5sum_modified} = 1;
} elsif ($medium->{synthesis}) {
if ($second_pass) {
if ($medium->{virtual}) {
@@ -1931,7 +1931,7 @@ sub _update_medium_second_pass {
}
}
#- keep in mind we have modified database, sure at this point.
- $urpm->{modified} = 1;
+ $urpm->{md5sum_modified} = 1;
}
}
$callback && $callback->('done', $medium->{name});
@@ -2024,6 +2024,9 @@ sub update_media {
#- write config files in any case
$urpm->write_config;
dump_proxy_config();
+ } elsif ($urpm->{md5sum_modified}) {
+ #- NB: in case of $urpm->{modified}, write_MD5SUM is called in write_config above
+ write_MD5SUM($urpm);
}
generate_media_names($urpm);