]> xenbits.xensource.com Git - people/iwj/osstest.git/commitdiff
TestSupport: Move `target_somefile_getleaf' earlier
authorIan Jackson <ian.jackson@eu.citrix.com>
Fri, 30 Nov 2018 16:41:14 +0000 (16:41 +0000)
committerIan Jackson <ian.jackson@eu.citrix.com>
Wed, 10 Apr 2019 14:14:15 +0000 (15:14 +0100)
We are going to make more use of this in intervening code.

Pure code motion.

Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Osstest/TestSupport.pm

index ce346097307ad43a0382dba340040e862d21a4e3..4e2f120ae7dbcb78b5af4182fd489aa434846b70 100644 (file)
@@ -504,6 +504,15 @@ sub remote_perl_script_done ($) {
     !$? or die "$thing->{What} $?";
 }
 
+sub target_somefile_getleaf ($$$) {
+    my ($lleaf_ref, $rdest, $ho) = @_;
+    if (!defined $$lleaf_ref) {
+        $$lleaf_ref= $rdest;
+        $$lleaf_ref =~ s,.*/,,;
+    }
+    $$lleaf_ref= hostnamepath($ho)."--$$lleaf_ref";
+}
+
 sub sshuho ($$) { my ($user,$ho)= @_; return "$user\@$ho->{Ip}"; }
 
 sub sshopts () {
@@ -591,15 +600,6 @@ sub target_install_packages_norec ($@) {
     target_run_pkgmanager_install($ho,\@packages,1);
 }
 
-sub target_somefile_getleaf ($$$) {
-    my ($lleaf_ref, $rdest, $ho) = @_;
-    if (!defined $$lleaf_ref) {
-        $$lleaf_ref= $rdest;
-        $$lleaf_ref =~ s,.*/,,;
-    }
-    $$lleaf_ref= hostnamepath($ho)."--$$lleaf_ref";
-}
-
 sub tpfcs_core {
     my ($tputfilef,$ho,$timeout,$filedata, $rdest,$lleaf) = @_;
     target_somefile_getleaf(\$lleaf,$rdest,$ho);