summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSven Eden <yamakuzure@gmx.net>2018-05-16 07:01:59 +0200
committerSven Eden <yamakuzure@gmx.net>2018-05-16 07:05:40 +0200
commite83271e288268ff567828cb965608b7dc1753078 (patch)
treebe5377dd64b6c1f9cf426116ccc5c3f232b4341d
parentacc6b7f6d2b76e4919c130d26b3ae263b5bf7525 (diff)
check_tree.pl migrate_tree.pl: Move necessary eop stuff into END blocks.
-rwxr-xr-xpwx/check_tree.pl67
-rw-r--r--pwx/last_mutual_commits.csv25
-rwxr-xr-xpwx/migrate_tree.pl15
3 files changed, 57 insertions, 50 deletions
diff --git a/pwx/check_tree.pl b/pwx/check_tree.pl
index 5a261e227..20ec87891 100755
--- a/pwx/check_tree.pl
+++ b/pwx/check_tree.pl
@@ -319,37 +319,6 @@ for my $file_part (@source_files) {
}
} ## End of main loop
-# -------------------------------------------------------------------------
-# --- Print out the list of files that only exist here and not upstream ---
-# -------------------------------------------------------------------------
-if (scalar @only_here) {
- my $count = scalar @only_here;
- my $fmt = sprintf("%%d %d: %%s\n", length("$count"));
-
- printf("\n%d file%s only found in $WORKDIR:\n", $count, $count > 1 ? "s": "");
-
- for (my $i = 0; $i < $count; ++$i) {
- printf($fmt, $i + 1, $only_here[$i]);
- }
-}
-
-# -------------------------------------------------------------------------
-# --- Print out the list of failed hunks -> bug in hunk or program? ---
-# -------------------------------------------------------------------------
-if (scalar @lFails) {
- my $count = scalar @lFails;
-
- printf("\n%d file%s %s have at least one fishy hunk:\n", $count,
- $count > 1 ? "s" : "", $count > 1 ? "have" : "has");
-
- for (my $i = 0; $i < $count; ++$i) {
- print "=== $lFails[$i]{part} ===\n";
- print " => $lFails[$i]{msg} <=\n";
- print "---------------------------\n";
- print "$_\n" foreach(@{$lFails[$i]{hunk}});
- }
-}
-
# ===========================
# === END OF MAIN PROGRAM ===
# ===========================
@@ -358,7 +327,41 @@ if (scalar @lFails) {
# === ==> -------- Cleanup -------- <== ===
# ================================================================
-$do_stay or length($previous_commit) and checkout_upstream($previous_commit);
+END {
+ # -------------------------------------------------------------------------
+ # --- Print out the list of files that only exist here and not upstream ---
+ # -------------------------------------------------------------------------
+ if (scalar @only_here) {
+ my $count = scalar @only_here;
+ my $fmt = sprintf("%%d %d: %%s\n", length("$count"));
+
+ printf("\n%d file%s only found in $WORKDIR:\n", $count, $count > 1 ? "s": "");
+
+ for (my $i = 0; $i < $count; ++$i) {
+ printf($fmt, $i + 1, $only_here[$i]);
+ }
+ }
+
+ # -------------------------------------------------------------------------
+ # --- Print out the list of failed hunks -> bug in hunk or program? ---
+ # -------------------------------------------------------------------------
+ if (scalar @lFails) {
+ my $count = scalar @lFails;
+
+ printf("\n%d file%s %s have at least one fishy hunk:\n", $count,
+ $count > 1 ? "s" : "", $count > 1 ? "have" : "has");
+
+ for (my $i = 0; $i < $count; ++$i) {
+ print "=== $lFails[$i]{part} ===\n";
+ print " => $lFails[$i]{msg} <=\n";
+ print "---------------------------\n";
+ print "$_\n" foreach(@{$lFails[$i]{hunk}});
+ }
+ }
+
+ $do_stay or length($previous_commit) and checkout_upstream($previous_commit);
+}
+
# ================================================================
# === ==> ---- Function Implementations ---- <== ===
diff --git a/pwx/last_mutual_commits.csv b/pwx/last_mutual_commits.csv
index 6a5ad34f7..6e67488fa 100644
--- a/pwx/last_mutual_commits.csv
+++ b/pwx/last_mutual_commits.csv
@@ -1,11 +1,14 @@
-master 265710c2055254a98ed6dcd6aa172ca509a33553 src-efaa3176ad0e763a0fafd4519d4391813a88ba0e x
-v229-stable c7f5a7d897491ceea90138d412a641b3225a1936 x x
-v231-stable 33628598ef1af73f8f50f96b4ce18f8a95733913 x x
-v232-stable 79a5d862a7abe903f456a75d6d1ca3c11adfa379 x x
-v233-stable 589fa9087a49e4250099bb6a4cf00358379fa3a4 x x
-v234 d6d0473dc9688dbfcd9e9b6ed005de26dd1131b7 src-782c925f7fa2e6e716ca9ac901954f3349d07ad8 x
-v234-stable 782c925f7fa2e6e716ca9ac901954f3349d07ad8 x x
-v235-stable b3e823e43c45b6233405d62e5f095c11130e638f x x
-v236 83fefc8888620ce27ba39d906bd879bbcb6bc84e src-f78a88beca362e62ca242499950a097fbcdb10d2 x
-v236-stable b3e823e43c45b6233405d62e5f095c11130e638f x x
-v237 f1d34068ef8d657238235d04ea291ee1ca095129 src-f1d34068ef8d657238235d04ea291ee1ca095129 tgt-cd4eee64482187443a097b2ce297bab27503a840
+# Automatically generated commit information
+# Only edit if you know what these do!
+
+master 265710c20 src-efaa3176a x
+v229-stable c7f5a7d89 x x
+v231-stable 33628598e x x
+v232-stable 79a5d862a x x
+v233-stable 589fa9087 x x
+v234 d6d0473dc src-782c925f7 x
+v234-stable 782c925f7 x x
+v235-stable b3e823e43 x x
+v236 83fefc888 src-f78a88bec x
+v236-stable b3e823e43 x x
+v237 590171d1c src-6d8c71eb8 x
diff --git a/pwx/migrate_tree.pl b/pwx/migrate_tree.pl
index 977230101..9ecaee6b2 100755
--- a/pwx/migrate_tree.pl
+++ b/pwx/migrate_tree.pl
@@ -201,10 +201,10 @@ for ( my $i = 0 ; $i < $commit_count ; ++$i ) {
# ----------------------------------------------------------
if ( scalar @lFiles > 1 ) {
print "\nERROR: $fmt results in more than one patch!\n";
- return 0;
+ exit 1;
} elsif ( 1 > scalar @lFiles ) {
print "\nERROR: No patches found for $fmt!";
- return 0;
+ exit 1;
}
show_prg( sprintf("Reworking %s", basename( $lFiles[0] ) ) );
@@ -223,9 +223,6 @@ for ( my $i = 0 ; $i < $commit_count ; ++$i ) {
} ## end for ( my $i = 0 ; $i < ...)
show_prg("");
-# -----------------------------------------------------------------
-# --- 6) Write back the CSV file of mutual commits ---
-set_last_mutual;
# ===========================
# === END OF MAIN PROGRAM ===
@@ -235,7 +232,11 @@ set_last_mutual;
# === ==> -------- Cleanup -------- <== ===
# ================================================================
-length($previous_refid) and checkout_upstream($previous_refid);
+END {
+ set_last_mutual;
+ length($previous_refid) and checkout_upstream($previous_refid);
+}
+
# ================================================================
# === ==> ---- Function Implementations ---- <== ===
@@ -903,7 +904,7 @@ sub set_last_mutual {
defined($hMutuals{$refid}{src}) and length($hMutuals{$refid}{src})
and $hMutuals{$refid}{src} = "src-" . $hMutuals{$refid}{src}
or $hMutuals{$refid}{src} = "x";
- ($hMutuals{$refid}{src}) > $ref_len and $ref_len = length($hMutuals{$refid}{src});
+ length($hMutuals{$refid}{src}) > $ref_len and $ref_len = length($hMutuals{$refid}{src});
defined($hMutuals{$refid}{tgt}) and length($hMutuals{$refid}{tgt})
and $hMutuals{$refid}{tgt} = "tgt-" . $hMutuals{$refid}{tgt}
or $hMutuals{$refid}{tgt} = "x";