Skip to contentSkip to conversation

cs-adjust-flight: Allow runvar-build-set new value to be just "."

PATCH New Ian Jackson 1 participant 1 message Jul 6, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 cs-adjust-flight: Allow runvar-build-set new value to be just "."

This is useful because if you say new: for the flight to be adjusted, you don't have the flight number.

---
 cs-adjust-flight | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
cs-adjust-flight +4 -2
index 4f036f4..ee1d917 100755
@@ -14,7 +14,7 @@
 #   runvar-del <job-spec> <var-spec>
 #   runvar-change <job-spec> <var-spec> <old-value> <new-value>
 #   runvar-perlop <job-spec> <var-spec> <perl-expr>
-#   runvar-build-set <job-spec> <var-spec> <old-meaning> <new-value>|<flight>.
+#   runvar-build-set <job-spec> <var-spec> <old-meaning> <new-value>|<flight>.|.
 #   recipe-set <job-spec> <new-value>
 #   intended-blessing <intended-blessing>
 #   branch-set <new-branch>
@@ -35,6 +35,7 @@
 #                    omits it
 #                   and, if <new-value> ends in ., it is
 #                    completed with the <old-value>'s job name
+#                    (and if it is just `.' it means just that job name)
 #
 # <dst-flight>:
 #   <flight>
@@ -369,7 +370,8 @@ sub change__runvar_build_set {
 	return unless $oldvalok_fn->("$oldflt.$oldjob");
 
 	$matches++;
-	my $newval = $specval =~ m/\.$/ ? "$specval$oldjob": $specval;
+	my $newval = $specval eq '.' ? $oldjob :
+	    $specval =~ m/\.$/ ? "$specval$oldjob": $specval;
         runvar_set($job, $name, $newval, " (modified from \`$oldval')")
 	    if $newval ne $oldval;
     }, 'IGNORE');
Signature · 7 lines
2.1.4


_______________________________________________
Xen-devel mailing list
[email protected]
https://lists.xenproject.org/mailman/listinfo/xen-devel