From 2caadb33bf60167401f7dd316e704bc42e32a1a9 Mon Sep 17 00:00:00 2001 From: Aaron Griffin Date: Mon, 5 Mar 2007 18:06:12 +0000 Subject: * Fixed an issue with globbing the --test argument * Added a custom 'mkdir' function which makes parents and doesn't fail on existence * Added output for 'SKIP' messages (it did not indicate WHY it was skipped) * Added the ability to generate DB packages in the sync dir (not the cache dir) for testing downloading. (self.cachepkgs = False) * Added pmtest.path for the full path to the package file --- pactest/util.py | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'pactest/util.py') diff --git a/pactest/util.py b/pactest/util.py index 2b384098..1cdb4018 100755 --- a/pactest/util.py +++ b/pactest/util.py @@ -247,6 +247,16 @@ def grep(filename, pattern): fd.close() return found +def mkdir(dir): + if os.path.isdir(dir): + return + elif os.path.isfile(dir): + raise OSError("'%s' already exists and is not a directory" % dir) + else: + parent, thisdir = os.path.split(dir) + if parent: mkdir(parent) #recurse to make all parents + print "making dir %s" % thisdir + if thisdir: os.mkdir(dir) if __name__ == "__main__": pass -- cgit v1.2.3-24-g4f1b