[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [OSSTEST PATCH 42/62] preseed_hook_command: allow specifying di keys other than preseed/*



Ie, only add preseed/ if there is not already a slash.

No functional change with existing call sites other than urls and
temporary filenames.

Signed-off-by: Ian Jackson <ian.jackson@xxxxxxxxxxxxx>
---
 Osstest/Debian.pm | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/Osstest/Debian.pm b/Osstest/Debian.pm
index 78d242e4..f8ff4f46 100644
--- a/Osstest/Debian.pm
+++ b/Osstest/Debian.pm
@@ -1472,9 +1472,12 @@ END
 
 sub preseed_hook_command ($$$$) {
     my ($ho, $di_key, $sfx, $text) = @_;
+    $di_key = "preseed/$di_key" unless $di_key =~ m{/};
+    my $basename = $di_key;
+    $basename =~ s{/}{--};
     my $ix= $#{ $preseed_cmds{$di_key} } + 1;
-    my $url= create_webfile($ho, "$di_key-$ix$sfx", $text);
-    my $file= "/tmp/$di_key-$ix";
+    my $url= create_webfile($ho, "$basename-$ix$sfx", $text);
+    my $file= "/tmp/$basename-$ix";
     my $cmd_cmd= "$preseed_wget -O $file '$url' && chmod +x $file && $file";
     push @{ $preseed_cmds{$di_key} }, $cmd_cmd;
 }
@@ -1521,7 +1524,7 @@ END
 sub preseed_hook_cmds () {
     my $preseed;
     foreach my $di_key (keys %preseed_cmds) {
-        $preseed .= "d-i preseed/$di_key string ".
+        $preseed .= "d-i $di_key string ".
             (join ' && ', @{ $preseed_cmds{$di_key} }). "\n";
     }
     return $preseed;
-- 
2.11.0


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.