From 2e223ffdf6ecb888a45ec5675017bf1d9e463cde Mon Sep 17 00:00:00 2001 From: Jiri Slaby Date: Jan 26 2022 06:40:57 +0000 Subject: scripts/stableids: allow machine to be localhost And do not attempt to ssh anywhere in that case. --- diff --git a/scripts/stableids b/scripts/stableids index 3297581..5bd3e95 100755 --- a/scripts/stableids +++ b/scripts/stableids @@ -151,11 +151,13 @@ exit 0 if ($dump_only); store(\%ids, $idsfile) or die "cannot write $idsfile"; push @to_delete, $idsfile; -system("tar -cC $patchpar $patchdir|ssh -C $machine -o StrictHostKeyChecking=no 'tar -xC $patchpar'") == 0 || - die "ssh didn't start"; -print "Written patches and ids to $machine:$patchpath\n"; +if ($machine ne 'localhost') { + system("tar -cC $patchpar $patchdir|ssh -C $machine -o StrictHostKeyChecking=no 'tar -xC $patchpar'") == 0 || + die "ssh didn't start"; + unlink(@to_delete) or print STDERR "cannot delete some temp files\n"; + rmdir("$patchpath") or print STDERR "cannot remove $patchpath\n"; +} -unlink(@to_delete) or print STDERR "cannot delete some temp files\n"; -rmdir("$patchpath") or print STDERR "cannot remove $patchpath\n"; +print "Written patches and ids to $machine:$patchpath\n"; 0;