Mailinglist Archive: opensuse-buildservice (250 mails)

< Previous Next >
Re: [opensuse-buildservice] PATCH: updating the URL via "osc updatepacmetafromspec" (was: How to easily create OBS package from specfile)
  • From: Lenz Grimmer <lenz@xxxxxxxxxxx>
  • Date: Fri, 01 Aug 2008 14:54:47 +0200
  • Message-id: <48930797.9020200@xxxxxxxxxxx>
Hi,

On 07/29/2008 09:47 PM, Michal Marek wrote:

I'm asked to fill in the package title and description. Couldn't this step
be
avoided as the description and title are already available in the package
specfile?

run 'osc help' and look for the commandwiththelongestname ;)

(ok, it's "updatepacmetafromspec")

And with the patch attached it even updates the URL, based on the "URL:" tag
from the spec file :)

The patch also fixes a small bug in the spec file parsing. If a string after a
given tag contains a colon (like an URL), it would be truncated.

Can you please make sure this patch gets applied? Or should I rather submit a
bug report about this? Thanks!

Bye,
LenZ
--
------------------------------------------------------------------
Lenz Grimmer <lenz@xxxxxxxxxxx> -o)
[ICQ: 160767607 | Jabber: LenZGr@xxxxxxxxxx] /\\
http://www.lenzg.org/ V_V
--- core.py.org 2008-08-01 14:03:38.000000000 +0200
+++ core.py 2008-08-01 14:28:03.000000000 +0200
@@ -1030,8 +1030,9 @@
'with --specfile'
sys.exit(1)

- data = read_meta_from_spec(specfile, 'Summary:', '%description')
+ data = read_meta_from_spec(specfile, 'Summary:', 'URL:',
'%description')
self.summary = data['Summary:']
+ self.url = data['URL:']
self.descr = data['%description']


@@ -1052,6 +1054,7 @@
tree = ET.parse(filename)
tree.find('title').text = self.summary
tree.find('description').text = ''.join(self.descr)
+ tree.find('url').text = self.url
tree.write(filename)

print '*' * 36, 'old', '*' * 36
@@ -1814,7 +1817,7 @@
for tag in tags:
for line in lines:
if line.startswith(tag):
- spec_data[tag] = line.split(':')[1].strip()
+ spec_data[tag] = line.split(':',1)[1].strip()
break
if not spec_data.has_key(tag):
print >>sys.stderr, 'error - tag \'%s\' does not exist' % tag
< Previous Next >
Follow Ups