<div class="gmail_quote">2012/5/29 <span dir="ltr"><<a href="mailto:chninkel@users.sourceforge.net" target="_blank">chninkel@users.sourceforge.net</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Revision: 18162<br>
<a href="http://gar.svn.sourceforge.net/gar/?rev=18162&view=rev" target="_blank">http://gar.svn.sourceforge.net/gar/?rev=18162&view=rev</a><br>
Author: chninkel<br>
Date: 2012-05-29 21:59:21 +0000 (Tue, 29 May 2012)<br>
Log Message:<br>
-----------<br>
v2-solaris11: create a fake SVR4 pkg name for IPS package<br>
<br>
Modified Paths:<br>
--------------<br>
csw/mgar/gar/v2-solaris11/lib/python/system_pkgmap.py<br>
<br>
Modified: csw/mgar/gar/v2-solaris11/lib/python/system_pkgmap.py<br>
===================================================================<br>
--- csw/mgar/gar/v2-solaris11/lib/python/system_pkgmap.py 2012-05-29 19:29:11 UTC (rev 18161)<br>
+++ csw/mgar/gar/v2-solaris11/lib/python/system_pkgmap.py 2012-05-29 21:59:21 UTC (rev 18162)<br>
@@ -111,7 +111,7 @@<br>
<br>
def _ParsePkgListLine(self, line):<br>
fields = re.split(c.WS_RE, line)<br>
- pkgname = fields[0]<br>
+ pkgname = self._IpsNameToPkgname(fields[0])<br>
desc_field_start = 1<br>
# The optional publisher field is always between<br>
# parenthesis, we skip it if necessary<br>
@@ -144,7 +144,7 @@<br>
f_owner = None<br>
f_group = None<br>
f_pkgname = None<br>
- pkgnames = [ parts[2] ]<br>
+ pkgnames = [ self._IpsNameToPkgname(parts[2]) ]<br>
if f_type == 's' or f_type == 'l':<br>
f_target = parts[3]<br>
else:<br>
@@ -385,8 +385,11 @@<br>
packages_by_pkgname.setdefault(pkgname, pkg_desc)<br>
logging.debug("<- _ParsePkginfoOutput()")<br>
return packages_by_pkgname<br>
+<br>
+ def _IpsNameToPkgname(self, ips_name):<br>
+ """Create a fake Svr4 pkgname from an ips pkgname"""<br>
+ return "SUNW" + ips_name.replace("/", "_")<br></blockquote><div><br></div><div>Underscores aren't legal in pkgnames. I'd suggest doing something more strict: finding all the alphanumeric string segments and joining them with dashes.</div>
</div>