aboutsummaryrefslogtreecommitdiff
blob: 4ecedd088f2cbaa4302bf9b939ab92b48c6be998 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
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)