From 36cc55b6fdbd2a8bfd625178312cebbdb4e83a9d Mon Sep 17 00:00:00 2001 From: "Dr. Peter Poeml" Date: Thu, 10 Aug 2006 16:39:13 +0000 Subject: [PATCH] - rename subcommand 'history' (which was not implemented yet) to 'buildhistory', and make it work. It still gives out raw xml, which might be changed - add some help text to the linkpac documentation - add '.git' to exclude_stuff --- osc/commandline.py | 36 ++++++++++++++++++++++++++---------- osc/core.py | 9 +++------ 2 files changed, 29 insertions(+), 16 deletions(-) diff --git a/osc/commandline.py b/osc/commandline.py index 33130f43..81502aae 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -111,7 +111,12 @@ usage: osc linkpac SOURCEPRJ SOURCEPAC DESTPRJ [DESTPAC] The DESTPAC name is optional; the source packages' name will be used if DESTPAC is omitted. -Afterwards, you will want to 'co DESTPRJ DESTPAC' and edit _link and/or add patches. +Afterwards, you will want to 'checkout DESTPRJ DESTPAC'. + +To add a patch, add the patch as file and add it to the _link file. +You can also specify text which will be inserted at the top of the spec file. + +See the examples in the _link file. """ @@ -689,18 +694,29 @@ and set su-wrapper to 'sudo' in .oscrc. +def buildhistory(args): + """buildhistory (buildhist): Shows the build history of a package -def history(args): - """history: Shows the build history of a package (NOT IMPLEMENTED YET) - -usage: osc history +usage: osc buildhistory """ - args = parseargs(args) - pacs = findpacs(args) - for p in pacs: - print ''.join(get_history(p.prjname, p.name)) + wd = os.curdir + package = store_read_package(wd) + project = store_read_project(wd) + if args is None or len(args) < 2: + print 'missing argument' + print + print buildhistory.func_doc + print 'Valid arguments for this package are:' + print + repos(None) + print + sys.exit(1) + + platform = args[0] + arch = args[1] + print ''.join(get_buildhistory(project, package, platform, arch)) def rebuildpac(args): """rebuildpac: Triggers a package rebuild for all repositories/architectures of the package @@ -759,7 +775,7 @@ cmd_dict = { diff: ['diff'], editmeta: ['editmeta'], help: ['help'], - history: ['history', 'hist'], + buildhistory: ['buildhistory', 'buildhist'], linkpac: ['linkpac'], userid: ['id'], # <- small difference here init: ['init'], # depracated diff --git a/osc/core.py b/osc/core.py index f919ae15..07aca3ad 100755 --- a/osc/core.py +++ b/osc/core.py @@ -22,7 +22,7 @@ scheme = 'http' BUFSIZE = 1024*1024 store = '.osc' -exclude_stuff = [store, '.svn', 'CVS'] +exclude_stuff = [store, '.svn', 'CVS', '.git'] new_project_templ = """\ @@ -1138,11 +1138,8 @@ def get_buildconfig(prj, package, platform, arch): return f.read() -def get_history(prj, package): - # http://api.opensuse.org/rpm/Apache/factory/i586/apache2/history ? - # http://api.opensuse.org/package/Apache/apache2/history ? - u = makeurl(['package', prj, package, 'history']) - print u +def get_buildhistory(prj, package, platform, arch): + u = makeurl(['rpm', prj, platform, arch, package, 'history']) f = urlopen(u) return f.readlines()