index : pacman | |
Archlinux32 fork of pacman | gitolite user |
summaryrefslogtreecommitdiff |
author | Aaron Griffin <aaron@archlinux.org> | 2007-03-05 18:06:12 +0000 |
---|---|---|
committer | Aaron Griffin <aaron@archlinux.org> | 2007-03-05 18:06:12 +0000 |
commit | 2caadb33bf60167401f7dd316e704bc42e32a1a9 (patch) | |
tree | d7c349246b591073b91a5b6635503cfafda3bd52 /pactest/util.py | |
parent | 714a414e72591f3273583cb4970e1515c94e5887 (diff) |
-rwxr-xr-x | pactest/util.py | 10 |
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 |