Send patches - preferably formatted by git format-patch - to patches at archlinux32 dot org.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Gregory <andrew.gregory.8@gmail.com>2015-10-16 20:28:29 -0400
committerAllan McRae <allan@archlinux.org>2015-10-18 10:59:23 +1000
commit4ceb1c5bf91dea2453d9b888138c40e4f97d408d (patch)
treecf0d661dce4c54bdd1e096d91026db6e8e46718b
parent60ebee7a6e1984f14ea3f88159c28fa9b99d7f5c (diff)
util.py: return the created path
Signed-off-by: Andrew Gregory <andrew.gregory.8@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
-rw-r--r--test/pacman/pmpkg.py3
-rw-r--r--test/pacman/pmtest.py3
-rw-r--r--test/pacman/util.py4
3 files changed, 5 insertions, 5 deletions
diff --git a/test/pacman/pmpkg.py b/test/pacman/pmpkg.py
index 31336610..9033dc61 100644
--- a/test/pacman/pmpkg.py
+++ b/test/pacman/pmpkg.py
@@ -174,8 +174,7 @@ class pmpkg(object):
def install_package(self, root):
"""Install the package in the given root."""
for f in self.files:
- util.mkfile(root, f, f)
- path = os.path.join(root, f)
+ path = util.mkfile(root, f, f)
if os.path.isfile(path):
os.utime(path, (355, 355))
diff --git a/test/pacman/pmtest.py b/test/pacman/pmtest.py
index d48c03f1..7774a7bf 100644
--- a/test/pacman/pmtest.py
+++ b/test/pacman/pmtest.py
@@ -180,8 +180,7 @@ class pmtest(object):
vprint(" Populating file system")
for f in self.filesystem:
vprint("\t%s" % f)
- util.mkfile(self.root, f, f)
- path = os.path.join(self.root, f)
+ path = util.mkfile(self.root, f, f)
if os.path.isfile(path):
os.utime(path, (355, 355))
for pkg in self.db["local"].pkgs:
diff --git a/test/pacman/util.py b/test/pacman/util.py
index aa9c63f7..e2acc52f 100644
--- a/test/pacman/util.py
+++ b/test/pacman/util.py
@@ -84,7 +84,7 @@ def mkfile(base, name, data=""):
if info["isdir"]:
if not os.path.isdir(path):
os.makedirs(path, 0o755)
- return
+ return path
dir_path = os.path.dirname(path)
if dir_path and not os.path.isdir(dir_path):
@@ -98,6 +98,8 @@ def mkfile(base, name, data=""):
if info["perms"]:
os.chmod(path, info["perms"])
+ return path
+
def writedata(filename, data):
if isinstance(data, list):
data = "\n".join(data)