summaryrefslogtreecommitdiffstats
path: root/perl-install/install
diff options
context:
space:
mode:
authorPascal Terjan <pterjan@mageia.org>2018-09-14 02:18:41 +0000
committerPascal Terjan <pterjan@mageia.org>2018-09-14 02:19:02 +0000
commit0343f1bfc6d9fd76ba6bf911def836a47026a97a (patch)
treeffced59fd115923cbab53aeff2df1343091dc468 /perl-install/install
parent851454ef7de30c75818c19920bd80bda6df2242f (diff)
downloaddrakx-0343f1bfc6d9fd76ba6bf911def836a47026a97a.tar
drakx-0343f1bfc6d9fd76ba6bf911def836a47026a97a.tar.gz
drakx-0343f1bfc6d9fd76ba6bf911def836a47026a97a.tar.bz2
drakx-0343f1bfc6d9fd76ba6bf911def836a47026a97a.tar.xz
drakx-0343f1bfc6d9fd76ba6bf911def836a47026a97a.zip
Only modify %__dbi_cdb if it is defined
This should avoid a misleading 'Too many levels of recursion in macro expansion' message as seen in mga#23531
Diffstat (limited to 'perl-install/install')
-rw-r--r--perl-install/install/NEWS1
-rw-r--r--perl-install/install/pkgs.pm12
2 files changed, 11 insertions, 2 deletions
diff --git a/perl-install/install/NEWS b/perl-install/install/NEWS
index 759d15cd0..a18d6dcce 100644
--- a/perl-install/install/NEWS
+++ b/perl-install/install/NEWS
@@ -1,5 +1,6 @@
- drakx-in-chroot:
o do not run monitor-edid with drakx-in-chroot (timeout)
+- do not try to add nofsync to __dbi_cdb if it is not defined
Version 18.0 - 25 August 2018
diff --git a/perl-install/install/pkgs.pm b/perl-install/install/pkgs.pm
index 3317f0fbe..1512cf4f6 100644
--- a/perl-install/install/pkgs.pm
+++ b/perl-install/install/pkgs.pm
@@ -770,6 +770,12 @@ sub _filter_packages {
} @packages;
}
+sub _set_dbi_cdb_nofsync {
+ if ((my $dbi_cdb = URPM::expand('%__dbi_cdb')) ne '%__dbi_cdb') {
+ URPM::add_macro("__dbi_cdb $dbi_cdb nofsync");
+ }
+}
+
sub install {
my ($isUpgrade, $toInstall, $packages, $callback) = @_;
my %packages;
@@ -798,7 +804,9 @@ sub install {
URPM::read_config_files();
# force loading libnss*
getgrent();
- URPM::add_macro(join(' ', '__dbi_cdb', URPM::expand('%__dbi_cdb'), 'nofsync'));
+
+ _set_dbi_cdb_nofsync();
+
my $LOG = _openInstallLog();
$packages->{log} = $packages->{info} = $packages->{print} = sub {
@@ -1063,7 +1071,7 @@ sub _remove_raw {
log::l("removing: " . join(' ', @$to_remove));
URPM::read_config_files();
- URPM::add_macro(URPM::expand('__dbi_cdb %__dbi_cdb nofsync'));
+ _set_dbi_cdb_nofsync();
my $db = open_rpm_db_rw() or die "error opening RPM database: ", URPM::rpmErrorString();
my $trans = $db->create_transaction;