[opensuse-buildservice] [PATCH]: optimize _link files
Hi, please merge. Thanks, Dirk From ac737b9ff8205fe3c320ee0b41b093c7ad92c348 Mon Sep 17 00:00:00 2001 From: Dirk Mueller <dmueller@suse.de> Date: Thu, 4 Nov 2010 11:01:08 +0100 Subject: [PATCH] linkpac: Only include src_project if it differs osc copypac copies _link files verbatim, so if they refer to the same project, copying them should make them also refer to the new project. This can be done by leaving out the project part if it is the same like the destination project --- osc/core.py | 10 ++++++++-- 1 files changed, 8 insertions(+), 2 deletions(-) diff --git a/osc/core.py b/osc/core.py index 22ad8b0..de3c6aa 100644 --- a/osc/core.py +++ b/osc/core.py @@ -3850,8 +3850,14 @@ def link_pac(src_project, src_package, dst_project, dst_package, force, rev='', cicount = '' print 'Creating _link...', + + # only include project if it is different + src_project_snippet=" project=\"%s\"" % (src_project) + if src_project == dst_project: + src_project_snippet = "" + link_template = """\ -<link project="%s" package="%s" %s %s> +<link%s package="%s" %s %s> <patches> <!-- <apply name="patch" /> apply a patch on the source directory --> <!-- <topadd>%%define build_with_feature_x 1</topadd> add a line on the top (spec file only) --> @@ -3859,7 +3865,7 @@ def link_pac(src_project, src_package, dst_project, dst_package, force, rev='', <!-- <delete>filename</delete> delete a file --> </patches> </link> -""" % (src_project, src_package, rev, cicount) +""" % (src_project_snippet, src_package, rev, cicount) u = makeurl(apiurl, ['source', dst_project, dst_package, '_link']) http_PUT(u, data=link_template) -- 1.7.3.1 -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Thursday 04 November 2010 11:05:05 Dirk Müller wrote:
Hi,
please merge.
Could you please send a patch file? -- Mit freundlichen Grüßen, Sascha Peilicke http://saschpe.wordpress.com
Hi, On 2010-11-04 11:05:05 +0100, Dirk Müller wrote:
please merge.
Thanks, Dirk
From ac737b9ff8205fe3c320ee0b41b093c7ad92c348 Mon Sep 17 00:00:00 2001 From: Dirk Mueller <dmueller@suse.de> Date: Thu, 4 Nov 2010 11:01:08 +0100 Subject: [PATCH] linkpac: Only include src_project if it differs
osc copypac copies _link files verbatim, so if they refer to the same project, copying them should make them also refer to the new project. This can be done by leaving out the project part if it is the same like the destination project Is there a specific reason why you need this change?
Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On Thursday 04 November 2010, Marcus Hüwe wrote:
osc copypac copies _link files verbatim, so if they refer to the same project, copying them should make them also refer to the new project. This can be done by leaving out the project part if it is the same like the destination project Is there a specific reason why you need this change?
Sure, it is for packages with multiple spec files, e.g. libqt4 and libqt4- devel-doc. so the setup is like KDE:Qt / libqt4 /libqt4.spec KDE:Qt / libqt4-devel-doc / _link pointing to "libqt4" when I use linkpac, it hardcodes "KDE:Qt" in the _link file. so, next step, I copy the project to elsewhere (e.g. KDE:Qt to home:dirkmueller:playground:qt). then in that new project it builds libqt4-devel-doc against the sources in KDE:Qt, while in this case I want them to be built from home:dirkmueller:playground:qt By not specifying the project, it does exactly that. Greetings, Dirk -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
On 2010-11-11 17:57:41 +0100, Dirk Müller wrote:
On Thursday 04 November 2010, Marcus Hüwe wrote:
osc copypac copies _link files verbatim, so if they refer to the same project, copying them should make them also refer to the new project. This can be done by leaving out the project part if it is the same like the destination project Is there a specific reason why you need this change?
Sure, it is for packages with multiple spec files, e.g. libqt4 and libqt4- devel-doc.
so the setup is like
KDE:Qt / libqt4 /libqt4.spec KDE:Qt / libqt4-devel-doc / _link pointing to "libqt4"
when I use linkpac, it hardcodes "KDE:Qt" in the _link file.
so, next step, I copy the project to elsewhere (e.g. KDE:Qt to home:dirkmueller:playground:qt).
then in that new project it builds libqt4-devel-doc against the sources in KDE:Qt, while in this case I want them to be built from home:dirkmueller:playground:qt
By not specifying the project, it does exactly that.
I just committed your patch. Thanks! Marcus -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
participants (3)
-
Dirk Müller
-
Marcus Hüwe
-
Sascha Peilicke