[reprotest] 01/05: Use autopkgtest upstream paths, makes things easier to import

Ximin Luo infinity0 at debian.org
Wed Jul 19 15:13:12 UTC 2017


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch master
in repository reprotest.

commit b5051c55d0af777c01e45733e968274fc407a6fe
Author: Ximin Luo <infinity0 at debian.org>
Date:   Wed Jul 19 16:43:53 2017 +0200

    Use autopkgtest upstream paths, makes things easier to import
---
 reprotest/__init__.py                                | 10 +++++++---
 reprotest/virt/{chroot => autopkgtest-virt-chroot}   |  0
 reprotest/virt/{lxc => autopkgtest-virt-lxc}         |  0
 reprotest/virt/{lxd => autopkgtest-virt-lxd}         |  0
 reprotest/virt/{null => autopkgtest-virt-null}       |  0
 reprotest/virt/{qemu => autopkgtest-virt-qemu}       |  0
 reprotest/virt/{schroot => autopkgtest-virt-schroot} |  0
 reprotest/virt/{ssh => autopkgtest-virt-ssh}         |  0
 8 files changed, 7 insertions(+), 3 deletions(-)

diff --git a/reprotest/__init__.py b/reprotest/__init__.py
index 5e0842d..b4dc300 100644
--- a/reprotest/__init__.py
+++ b/reprotest/__init__.py
@@ -27,8 +27,11 @@ from reprotest import _shell_ast
 from reprotest import presets
 
 
+VIRT_PREFIX = "autopkgtest-virt-"
+
 def get_server_path(server_name):
-    return pkg_resources.resource_filename(__name__, os.path.join("virt", server_name))
+    return pkg_resources.resource_filename(
+        __name__, os.path.join("virt", (VIRT_PREFIX + server_name) if server_name else ""))
 
 def is_executable(parent, fn):
     path = os.path.join(parent, fn)
@@ -38,8 +41,9 @@ all_servers = None
 def get_all_servers():
     global all_servers
     if all_servers is None:
-        server_dir = get_server_path("")
-        all_servers = sorted(fn for fn in os.listdir(server_dir) if is_executable(server_dir, fn))
+        server_dir = get_server_path(None)
+        all_servers = sorted(fn[:-len(VIRT_PREFIX)] for fn in os.listdir(server_dir)
+                             if is_executable(server_dir, fn) and fn.startswith(VIRT_PREFIX))
     return all_servers
 
 
diff --git a/reprotest/virt/chroot b/reprotest/virt/autopkgtest-virt-chroot
similarity index 100%
rename from reprotest/virt/chroot
rename to reprotest/virt/autopkgtest-virt-chroot
diff --git a/reprotest/virt/lxc b/reprotest/virt/autopkgtest-virt-lxc
similarity index 100%
rename from reprotest/virt/lxc
rename to reprotest/virt/autopkgtest-virt-lxc
diff --git a/reprotest/virt/lxd b/reprotest/virt/autopkgtest-virt-lxd
similarity index 100%
rename from reprotest/virt/lxd
rename to reprotest/virt/autopkgtest-virt-lxd
diff --git a/reprotest/virt/null b/reprotest/virt/autopkgtest-virt-null
similarity index 100%
rename from reprotest/virt/null
rename to reprotest/virt/autopkgtest-virt-null
diff --git a/reprotest/virt/qemu b/reprotest/virt/autopkgtest-virt-qemu
similarity index 100%
rename from reprotest/virt/qemu
rename to reprotest/virt/autopkgtest-virt-qemu
diff --git a/reprotest/virt/schroot b/reprotest/virt/autopkgtest-virt-schroot
similarity index 100%
rename from reprotest/virt/schroot
rename to reprotest/virt/autopkgtest-virt-schroot
diff --git a/reprotest/virt/ssh b/reprotest/virt/autopkgtest-virt-ssh
similarity index 100%
rename from reprotest/virt/ssh
rename to reprotest/virt/autopkgtest-virt-ssh

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/reprotest.git



More information about the Reproducible-commits mailing list