aboutsummaryrefslogtreecommitdiff
path: root/ipsbuild-setuptree.py
diff options
context:
space:
mode:
authorJoseph Hunkeler <jhunkeler@gmail.com>2013-04-17 09:06:52 -0400
committerJoseph Hunkeler <jhunkeler@gmail.com>2013-04-17 09:06:52 -0400
commita332d3db796261e5cc5dec457c8ae0997c7257b4 (patch)
tree44427c4643642ef3dbbeda4da2fc069f02a35c1b /ipsbuild-setuptree.py
parentedf6846069effba5b7c88bc96bd4cd852a4d7f2f (diff)
downloadipsutils-a332d3db796261e5cc5dec457c8ae0997c7257b4.tar.gz
IPC should be IPS. I was tired.
Diffstat (limited to 'ipsbuild-setuptree.py')
-rw-r--r--ipsbuild-setuptree.py37
1 files changed, 37 insertions, 0 deletions
diff --git a/ipsbuild-setuptree.py b/ipsbuild-setuptree.py
new file mode 100644
index 0000000..135c4e9
--- /dev/null
+++ b/ipsbuild-setuptree.py
@@ -0,0 +1,37 @@
+import os
+import sys
+
+try:
+ if sys.platform == 'linux' or sys.platform == 'darwin':
+ home = os.path.normpath(os.environ['HOME'])
+ elif sys.platform == 'win32':
+ home = os.path.normpath(os.environ['USERPROFILE'])
+except:
+ Exception("Unsupported platform: {0:s}".format(sys.platform))
+
+head = os.path.join(home, 'ipsbuild')
+tree = ['BUILDROOT',
+ 'BUILD',
+ 'SPECS',
+ 'SOURCES',
+ 'PKGS',
+ 'SPKGS']
+
+def create_dir(dirent):
+ print("Creating directory: {0:s}".format(dirent))
+ os.mkdir(dirent)
+
+def main():
+ try:
+ self.create_dir(head)
+ except:
+ print("{0:s} already exists, please remove it.".format(head))
+
+ try:
+ for d in tree:
+ self.create_dir(os.path.join(head, d))
+ except:
+ pass
+
+if __name__ == '__main__':
+ main()