diff options
Diffstat (limited to 'RepSys')
-rw-r--r-- | RepSys/commands/submit.py | 6 | ||||
-rw-r--r-- | RepSys/rpmutil.py | 4 |
2 files changed, 9 insertions, 1 deletions
diff --git a/RepSys/commands/submit.py b/RepSys/commands/submit.py index 6e9eb0f..380391a 100644 --- a/RepSys/commands/submit.py +++ b/RepSys/commands/submit.py @@ -39,6 +39,7 @@ def parse_options(): parser.add_option("-t", dest="target", default="Cooker") parser.add_option("-l", dest="list", action="store_true") parser.add_option("-r", dest="revision", type="string", nargs=1) + parser.add_option("--define", action="append") opts, args = parser.parse_args() if not args: name, rev = get_submit_info(".") @@ -63,7 +64,7 @@ def parse_options(): raise Error, "provide -l or a revision number" return opts -def submit(pkgdirurl, revision, target, list=0): +def submit(pkgdirurl, revision, target, list=0, define=[]): #if not NINZ: # raise Error, "you must have NINZ installed to use this command" type, rest = urllib.splittype(pkgdirurl) @@ -113,10 +114,13 @@ def submit(pkgdirurl, revision, target, list=0): createsrpm = get_helper("create-srpm") command = "ssh %s %s '%s' -r %s -t %s" % ( host, createsrpm, pkgdirurl, revision, target) + if define: + command += " " + " ".join([ "--define " + x for x in define ]) status, output = execcmd(command) if status == 0: print "Package submitted!" else: + sys.stderr.write(output) sys.exit(status) diff --git a/RepSys/rpmutil.py b/RepSys/rpmutil.py index 83d0051..9c0018a 100644 --- a/RepSys/rpmutil.py +++ b/RepSys/rpmutil.py @@ -90,9 +90,13 @@ def get_srpm(pkgdirurl, srpm = glob.glob(os.path.join(srpmsdir, "*.src.rpm"))[0] if not targetdirs: targetdirs = (".",) + targetsrpms = [] for targetdir in targetdirs: + targetsrpm = os.path.join(os.path.realpath(targetdir), os.path.basename(srpm)) + targetsrpms.append(targetsrpm) execcmd("cp -f", srpm, targetdir) os.unlink(srpm) + return targetsrpms finally: if os.path.isdir(tmpdir): shutil.rmtree(tmpdir) |