aboutsummaryrefslogtreecommitdiffstats
path: root/lib/Iurt/Chroot.pm
diff options
context:
space:
mode:
authorArnaud Patard <rtp@mageia.org>2012-09-07 20:39:03 +0000
committerArnaud Patard <rtp@mageia.org>2012-09-07 20:39:03 +0000
commit065eb66eeef50a285b65176ee450560c337a4b70 (patch)
tree021ef49273277b76588b283020d87fb7e0fae63d /lib/Iurt/Chroot.pm
parenta03db1ee456a2497481650975b094b1e659d36fc (diff)
downloadiurt-065eb66eeef50a285b65176ee450560c337a4b70.tar
iurt-065eb66eeef50a285b65176ee450560c337a4b70.tar.gz
iurt-065eb66eeef50a285b65176ee450560c337a4b70.tar.bz2
iurt-065eb66eeef50a285b65176ee450560c337a4b70.tar.xz
iurt-065eb66eeef50a285b65176ee450560c337a4b70.zip
fix check_chroot_need_update "regression", which was always telling to rebuild
the chroot. @available_pkgs was always empty, because of trying to write the new media.cfg in /var/cache/urpmi/partial/ as user.
Diffstat (limited to 'lib/Iurt/Chroot.pm')
-rw-r--r--lib/Iurt/Chroot.pm5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/Iurt/Chroot.pm b/lib/Iurt/Chroot.pm
index ba87464..ca0882e 100644
--- a/lib/Iurt/Chroot.pm
+++ b/lib/Iurt/Chroot.pm
@@ -278,10 +278,13 @@ sub check_mounted {
sub check_chroot_need_update {
my ($tmp_chroot, $run) = @_;
+ my $tmp_urpmi = mktemp("$tmp_chroot/tmp.XXXXXX");
my @installed_pkgs = grep { !/^gpg-pubkey/ } chomp_(cat_("$tmp_chroot/var/log/qa"));
- my @available_pkgs = chomp_(`urpmq --use-distrib $run->{urpmi}{distrib_url} --list -f 2>/dev/null`);
+ my @available_pkgs = chomp_(`urpmq --urpmi-root $tmp_urpmi --use-distrib $run->{urpmi}{distrib_url} --list -f 2>/dev/null`);
my @removed_pkgs = difference2(\@installed_pkgs, \@available_pkgs);
+ rm_rf($tmp_urpmi);
+
if (@installed_pkgs) {
if (@removed_pkgs) {
plog('DEBUG', "changed packages: @removed_pkgs");