Skip to content

Commit

Permalink
debug doesn't support format strings
Browse files Browse the repository at this point in the history
  • Loading branch information
jrha committed Jul 25, 2023
1 parent c31fd58 commit e43c644
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions ncm-spma/src/main/perl/spma/apt.pm
Original file line number Diff line number Diff line change
Expand Up @@ -85,16 +85,16 @@ our $NoActionSupported = 1;
sub _call_apt
{
my ($self, $cmd, $ok) = @_;
$self->debug(5, '_call_apt: Called with args(%s)', $cmd);
$self->debug(5, '_call_apt: Called with args', Dumper($cmd));

my $proc = CAF::Process->new($cmd);
my $output = $proc->output();
my $exitstatus = $? >> 8; # Get exit status from highest 8-bits
$self->debug(5, '_call_apt: %s exited with %s', $proc, $exitstatus);
$self->debug(5, "_call_apt: $proc exited with $exitstatus");
if ($exitstatus > 0) {
$output =~ tr{\n}{ };
my $method = $ok ? 'warn' : 'error';
$self->$method('_call_apt: %s failed with "%s"', $proc, $output);
$self->$method("_call_apt: $proc failed with \"$output\"");
}
return $ok || $exitstatus == 0;
}
Expand All @@ -104,7 +104,7 @@ sub _call_apt
sub cleanup_old_sources
{
my ($self, $sources_dir, $allowed_sources) = @_;
$self->debug(5, 'cleanup_old_sources: Called with args(%s, %s)', $sources_dir, $allowed_sources);
$self->debug(5, "cleanup_old_sources: Called with args($sources_dir, $allowed_sources)");

if ($self->directory_exists($sources_dir)) {
my $current = Set::Scalar->new(@{$self->listdir($sources_dir, filter => qr{\.list$}, adddir => 1)});
Expand All @@ -129,7 +129,7 @@ sub cleanup_old_sources
sub initialize_sources_dir
{
my ($self, $sources_dir) = @_;
$self->debug(5, 'initialize_sources_dir: Called with args(%s)', $sources_dir);
$self->debug(5, "initialize_sources_dir: Called with args($sources_dir)");

if (! $self->directory($sources_dir)) {
$self->error("Unable to create source dir $sources_dir: $self->{fail}");
Expand All @@ -145,7 +145,7 @@ sub initialize_sources_dir
sub generate_sources
{
my ($self, $sources_dir, $sources, $template) = @_;
$self->debug(5, 'generate_sources: Called with args(%s, %s, %s)', $sources_dir, $sources, $template);
$self->debug(5, "generate_sources: Called with args($sources_dir, $sources, $template)");

my $changes = 0;

Expand All @@ -169,7 +169,7 @@ sub generate_sources
sub configure_apt
{
my ($self, $config) = @_;
$self->debug(5, 'configure_apt: Called with args(%s)', Dumper $config);
$self->debug(5, 'configure_apt: Called with args', Dumper($config));

my $tr = EDG::WP4::CCM::TextRender->new($TEMPLATE_CONFIG, $config, relpath => 'spma');
if ($tr) {
Expand Down Expand Up @@ -240,7 +240,7 @@ sub apply_package_version_arch
{
my ($self, $packagelist, $packagetree) = @_;

$self->debug(5, 'apply_package_version_arch: Called with args(%s, %s)', $packagelist, $packagetree);
$self->debug(5, "apply_package_version_arch: Called with args", $packagelist, Dumper($packagetree));

my @results;
my @notfound;
Expand All @@ -264,7 +264,7 @@ sub apply_package_version_arch
sub get_desired_pkgs
{
my ($self, $pkgs) = @_;
$self->debug(5, 'get_desired_pkgs: Called with args(%s)', $pkgs);
$self->debug(5, "get_desired_pkgs: Called with args", Dumper($pkgs));

my $packages = Set::Scalar->new();

Expand Down Expand Up @@ -306,7 +306,7 @@ sub upgrade_packages
sub install_packages
{
my ($self, $packages) = @_;
$self->debug(5, 'install_packages: Called with args(', Dumper($packages), ')');
$self->debug(5, 'install_packages: Called with args', Dumper($packages));

return $self->_call_apt([@$CMD_APT_INSTALL, @$packages]);
}
Expand All @@ -317,7 +317,7 @@ sub install_packages
sub mark_packages_auto
{
my ($self, $packages) = @_;
$self->debug(5, 'mark_packages_auto: Called with args(%s)', $packages);
$self->debug(5, "mark_packages_auto: Called with args", Dumper($packages));

return $self->_call_apt([@$CMD_APT_MARK, 'auto', @$packages]);
}
Expand Down

0 comments on commit e43c644

Please sign in to comment.