aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSebastian Parborg <darkdefende@gmail.com>2011-06-14 00:21:38 +0200
committerSebastian Parborg <darkdefende@gmail.com>2011-06-14 00:21:38 +0200
commit1960f9b0950430a419d740be62cce4488bdd3b54 (patch)
tree7c5c5e7fd7a32cbfbfb87770bbc1e9dac7c37c17 /scmprojects.py
parentAdded ARCH detection (diff)
downloadebuildgen-1960f9b0950430a419d740be62cce4488bdd3b54.tar.gz
ebuildgen-1960f9b0950430a419d740be62cce4488bdd3b54.tar.bz2
ebuildgen-1960f9b0950430a419d740be62cce4488bdd3b54.zip
Added basic SCM support
Diffstat (limited to 'scmprojects.py')
-rw-r--r--scmprojects.py21
1 files changed, 21 insertions, 0 deletions
diff --git a/scmprojects.py b/scmprojects.py
new file mode 100644
index 0000000..4ecedd0
--- /dev/null
+++ b/scmprojects.py
@@ -0,0 +1,21 @@
+from subprocess import call
+import sys
+
+cmdlineget = {
+ "svn" : "svn checkout ",
+ "git" : "git clone ",
+ "hg" : "hg clone ",
+ "www" : "wget ",
+ }
+
+def getsourcecode(adress,repotype):
+ callstr = cmdlineget[repotype]
+
+ try:
+ retcode = call(callstr + adress + " /tmp/ebuildgen/curproj",shell=True)
+ if retcode < 0:
+ print("Child was terminated by signal", -retcode, file=sys.stderr)
+ else:
+ print("Child returned", retcode, file=sys.stderr)
+ except OSError as e:
+ print("Execution failed:", e, file=sys.stderr)