aboutsummaryrefslogtreecommitdiffstats
path: root/RepSys
diff options
context:
space:
mode:
authorOlivier Blin <oblin@mandriva.com>2006-09-27 13:45:38 +0000
committerOlivier Blin <oblin@mandriva.com>2006-09-27 13:45:38 +0000
commit3c632697bd604933d3284acdc79eb3178ddd77ef (patch)
treebb4d29e4d63ce2e876fdf2244ca238edd3b05533 /RepSys
parentc9cddb1f54760c5c3aabfd1b637ca07fa89bc91a (diff)
downloadmgarepo-3c632697bd604933d3284acdc79eb3178ddd77ef.tar
mgarepo-3c632697bd604933d3284acdc79eb3178ddd77ef.tar.gz
mgarepo-3c632697bd604933d3284acdc79eb3178ddd77ef.tar.bz2
mgarepo-3c632697bd604933d3284acdc79eb3178ddd77ef.tar.xz
mgarepo-3c632697bd604933d3284acdc79eb3178ddd77ef.zip
merge 1.6.2b changes
Diffstat (limited to 'RepSys')
-rw-r--r--RepSys/commands/submit.py6
-rw-r--r--RepSys/rpmutil.py4
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)