From: Ian Jackson Date: Tue, 31 Dec 2019 12:45:50 +0000 (+0000) Subject: catacomb-import-update: Write conversion output to cat/ subdir X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ian/git?a=commitdiff_plain;h=d82ef1bab6e2b3ee2050be9886b9637f4d5929b8;p=secnet.git catacomb-import-update: Write conversion output to cat/ subdir This avoids mixing this automunged stuff from Catacomb with normal secnet code and will thereby avoid accidental manual edits. Signed-off-by: Ian Jackson --- diff --git a/catacomb-import-update b/catacomb-import-update index b02cbdb..7c41c96 100755 --- a/catacomb-import-update +++ b/catacomb-import-update @@ -25,12 +25,14 @@ use autodie; use IPC::System::Simple qw{runx capturex $EXITVAL}; use Data::Dumper; +use POSIX; my $DOCONVERT; my $DONOR_VERSION = "UNKNOWN"; my $DONOR_REVISION = "UNKNOWN"; my $DONOR_DIR; my $DONOR_IMPORT_DIR = "catacomb-import"; +my $RECIP_DIR = 'cat'; (my $PROG = $0) =~ s{^.*/}{}; @@ -895,10 +897,13 @@ chomp ($DONOR_REVISION = capturex @with_dir, $DONOR_DIR, note_path 'debian/copyright', undef; +do { no autodie; mkdir $RECIP_DIR; } +or $!==EEXIST or die "mkdir $RECIP_DIR: $!" if $DOCONVERT; + for my $f (@WANT_C) { (my $base = $f) =~ s{^.*/}{}; note_path $f, $base; - convert_c "$DONOR_DIR/$f", $base; + convert_c "$DONOR_DIR/$f", "$RECIP_DIR/$base"; } for (my $i = 0; $i < @WANT_TEST; $i += 2) { @@ -921,7 +926,7 @@ for (my $i = 0; $i < @WANT_TEST; $i += 2) { note_path $j, "$base-tests.in"; push @in, $pre . "$DONOR_DIR/$j"; } - convert_test \@in, "$base-tests.in", $varmap; + convert_test \@in, "$RECIP_DIR/$base-tests.in", $varmap; } commit_changes() if !$DOCONVERT;