create-packagegroup.py: add script to create packagegroup from website

Signed-off-by: Stefan Herbrechtsmeier <stefan@herbrechtsmeier.net>
This commit is contained in:
Stefan Herbrechtsmeier 2013-02-15 16:11:08 +01:00
parent e9233125c0
commit 35a59f4ead
1 changed files with 36 additions and 0 deletions

36
scripts/create-packagegroup.py Executable file
View File

@ -0,0 +1,36 @@
#!/usr/bin/env python
#
# Copyright (c) 2013 Stefan Herbrechtsmeier, Bielefeld University
#
import sys
import httplib
import re
name = 'ros_comm'
if len(sys.argv) > 1:
name = sys.argv[1]
conn = httplib.HTTPConnection('packages.ros.org')
conn.request('GET', '/web/rosinstall/generate/raw/groovy/' + name)
res = conn.getresponse()
data = res.read()
conn.close()
packages = []
for p in re.findall('local-name:.(\w+)' ,data):
packages.append(p.replace('_', '-'))
name = name.replace('_', '-')
print('packagegroup-' + name + '.bb')
print('')
print('DESCRIPTION = "' + name + ' package group"');
print('LICENSE = "MIT"')
print('')
print('inherit packagegroup')
print('')
print('PACKAGES = "${PN}"')
print('')
print('RDEPENDS_${PN} = "\\\n ' + ' \\\n '.join(packages) + ' \\\n "')