Hi, Ok, I'll adapt osc to use "tar_scm" service. But how to use extrace_file service? For example, after using "tar_scm" service, I can get a _service:tar_scm:libzip-1282898421.tar from http://git.gitorious.org/libzip/libzip.git, And the filename of the tar file changes each time. How to pass the exact file name to extract_file service? Since I need extract a spec file from the tar file. ---------------- Best Regards, Brook Hong
-----Original Message----- From: ext Adrian Schröter [mailto:adrian@suse.de] Sent: Monday, September 20, 2010 5:46 PM To: OBS osc Cc: dl9pf@gmx.de; mls@suse.de; ludwig.nussel@suse.de; tschmidt@suse.de; coolo@kde.org; mvyskocil@suse.cz; vuntz@gnome.org; bg@suse.de; freitag@suse.de; jfunk@funktronics.ca; suse-tux@gmx.de; ro@suse.de; david@dgreaves.com; thomas@suse.de; nashif@linux.intel.com Subject: [opensuse-buildservice] Re: [PATCH] git_pull service osc support
Please adapt this to use "tar_scm" service instead.
I do not want to have two services by default for the same thing. (Please see my other mail).
bye adrian
Am Montag, 20. September 2010, 11:06:47 schrieb OBS osc:
From: brook hong
--- osc/commandline.py | 5 ++++- osc/core.py | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletions(-)
diff --git a/osc/commandline.py b/osc/commandline.py index 0e11913..d5432b3 100644 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -2880,7 +2880,10 @@ Please submit there instead, or use -- nodevelproject to force direct submission. # Do some magic here, when adding a url. We want that the server to download the tar ball and to verify it for arg in parseargs(args): if arg.startswith('http://') or arg.startswith('https://') or arg.startswith('ftp://'): - addDownloadUrlService(arg) + if arg.endswith('.git'): + addGitSource(arg) + else: + addDownloadUrlService(arg) else: addFiles([arg])
diff --git a/osc/core.py b/osc/core.py index 1bead66..47124ea 100644 --- a/osc/core.py +++ b/osc/core.py @@ -301,6 +301,12 @@ class Serviceinfo: r.append( s ) return r
+ def addGitUrl(self, serviceinfo_node, url_string): + r = serviceinfo_node + s = ET.Element( "service", name="git_pull" ) + ET.SubElement(s, "param", name="url").text = url_string + r.append( s ) + return r
def execute(self, dir): import tempfile @@ -5169,6 +5175,27 @@ def stripETxml(node): for child in node.getchildren(): stripETxml(child)
+def addGitSource(url): + service_file = os.path.join(os.getcwd(), '_service') + addfile = False + if os.path.exists( service_file ): + services = ET.parse(os.path.join(os.getcwd(), '_service')).getroot() + else: + services = ET.fromstring("<services />") + addfile = True + stripETxml( services ) + si = Serviceinfo() + s = si.addGitUrl(services, url) + si.read(s) + + # for pretty output + reparsed = minidom.parseString(ET.tostring(s)) + f = open(service_file, 'wb') + f.write(reparsed.toprettyxml(indent=" ")) + f.close() + if addfile: + addFiles( ['_service'] ) + def addDownloadUrlService(url): service_file = os.path.join(os.getcwd(), '_service') addfile = False
-- Adrian Schroeter SUSE Linux Products GmbH email: adrian@suse.de -- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org
-- To unsubscribe, e-mail: opensuse-buildservice+unsubscribe@opensuse.org For additional commands, e-mail: opensuse-buildservice+help@opensuse.org