Skip to contentSkip to conversation

target_editfile: Improve doc comment

PATCH In review Ian Jackson 2 participants 4 messages Nov 14, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/2 target_editfile: Improve doc comment

More clearly state which arguments are optional.

---
 Osstest/TestSupport.pm |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Osstest/TestSupport.pm +2 -1
index 45ceee9..46b6720 100644
@@ -521,7 +521,8 @@ sub teditfileex {
 sub target_editfile_root ($$$;$$) { teditfileex('root',@_); }
 sub target_editfile      ($$$;$$) { teditfileex('osstest',@_); }
     # my $code= pop @_;
-    # my ($ho,$rfile,$lleaf,$rdest) = @_;
+    # my ($ho,$rfile, $lleaf,$rdest) = @_;
+    #                 ^^^^^^^^^^^^^ optional
 
 sub target_cmd_build ($$$$) {
     my ($ho,$timeout,$builddir,$script) = @_;
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 2/2 cs-adjust-flight: runvar-perlop: Do not report non-changes

With -v, runvar-perlop would unconditionally print a message about the changed variable. Instead, only call runvar_set if the value is to change.

---
 cs-adjust-flight |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
cs-adjust-flight +2 -1
index 7ec17e3..d6cab1a 100755
@@ -268,7 +268,8 @@ sub change__runvar_perlop {
         my ($job, $name, $varrow) = @_;
 	my $oldval = $varrow->{val};
 	my $newval = perlop_value($job, $name, $op, $oldval);
-        runvar_set($job, $name, $newval, " (modified from \`$oldval')");
+        runvar_set($job, $name, $newval, " (modified from \`$oldval')")
+	    if $newval ne $oldval;
     }, 'IGNORE');
 }
 
Signature · 1 line
1.7.10.4
Acked-by on v1 2/2
#2 lore raw

Re: [OSSTEST PATCH 2/2] cs-adjust-flight: runvar-perlop: Do not report non-changes

Quoted 5 lines · Ian Jackson

With -v, runvar-perlop would unconditionally print a message about the changed variable. Instead, only call runvar_set if the value is to change.

Quoted 18 lines
---
 cs-adjust-flight |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
cs-adjust-flight +2 -1
index 7ec17e3..d6cab1a 100755
@@ -268,7 +268,8 @@ sub change__runvar_perlop {
         my ($job, $name, $varrow) = @_;
 	my $oldval = $varrow->{val};
 	my $newval = perlop_value($job, $name, $op, $oldval);
-        runvar_set($job, $name, $newval, " (modified from \`$oldval')");
+        runvar_set($job, $name, $newval, " (modified from \`$oldval')")
+	    if $newval ne $oldval;
     }, 'IGNORE');
 }
 
Acked-by on v1 1/2
#3 lore raw
In reply to Ian Jackson
Quoted 3 lines · Ian Jackson

More clearly state which arguments are optional.

Quoted 18 lines
---
 Osstest/TestSupport.pm |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
Osstest/TestSupport.pm +2 -1
index 45ceee9..46b6720 100644
@@ -521,7 +521,8 @@ sub teditfileex {
 sub target_editfile_root ($$$;$$) { teditfileex('root',@_); }
 sub target_editfile      ($$$;$$) { teditfileex('osstest',@_); }
     # my $code= pop @_;
-    # my ($ho,$rfile,$lleaf,$rdest) = @_;
+    # my ($ho,$rfile, $lleaf,$rdest) = @_;
+    #                 ^^^^^^^^^^^^^ optional
 
 sub target_cmd_build ($$$$) {
     my ($ho,$timeout,$builddir,$script) = @_;