2
0
mirror of https://github.com/xcat2/xcat-core.git synced 2026-10-21 23:28:19 +00:00
Files
xcat-core/xCAT-test/integration/fixtures/dnf.pl
T
2026-09-22 23:15:42 -03:00

17 lines
598 B
Perl

#!/usr/bin/env perl
use strict;
use warnings;
use File::Glob qw(bsd_glob);
use JSON::PP qw(encode_json);
open(my $trace, '>>', $ENV{DNF_TRACE}) or die $!;
print {$trace} encode_json(\@ARGV) . "\n" or die $!;
close($trace) or die $!;
if (!grep({ $_ eq 'clean' } @ARGV) && $ENV{REMOVE_REPO}) {
unlink($_) or die $! for bsd_glob("/etc/yum.repos.d/$ENV{REMOVE_REPO}");
}
exec '/usr/bin/dnf', "--installroot=$ENV{TEST_ROOT}", '--releasever=1',
'--setopt=reposdir=/etc/yum.repos.d', '--setopt=install_weak_deps=False',
'--setopt=tsflags=noscripts', '--noplugins', @ARGV;
die "exec dnf: $!";