[csw-devel] SF.net SVN: gar:[18162] csw/mgar/gar/v2-solaris11/lib/python/system_pkgmap. py

Maciej (Matchek) Bliziński maciej at opencsw.org
Wed May 30 10:22:37 CEST 2012


2012/5/29 <chninkel at users.sourceforge.net>

> Revision: 18162
>          http://gar.svn.sourceforge.net/gar/?rev=18162&view=rev
> Author:   chninkel
> Date:     2012-05-29 21:59:21 +0000 (Tue, 29 May 2012)
> Log Message:
> -----------
> v2-solaris11: create a fake SVR4 pkg name for IPS package
>
> Modified Paths:
> --------------
>    csw/mgar/gar/v2-solaris11/lib/python/system_pkgmap.py
>
> Modified: csw/mgar/gar/v2-solaris11/lib/python/system_pkgmap.py
> ===================================================================
> --- csw/mgar/gar/v2-solaris11/lib/python/system_pkgmap.py       2012-05-29
> 19:29:11 UTC (rev 18161)
> +++ csw/mgar/gar/v2-solaris11/lib/python/system_pkgmap.py       2012-05-29
> 21:59:21 UTC (rev 18162)
> @@ -111,7 +111,7 @@
>
>   def _ParsePkgListLine(self, line):
>     fields = re.split(c.WS_RE, line)
> -    pkgname = fields[0]
> +    pkgname = self._IpsNameToPkgname(fields[0])
>     desc_field_start = 1
>     # The optional publisher field is always between
>     # parenthesis, we skip it if necessary
> @@ -144,7 +144,7 @@
>     f_owner = None
>     f_group = None
>     f_pkgname = None
> -    pkgnames = [ parts[2] ]
> +    pkgnames = [ self._IpsNameToPkgname(parts[2]) ]
>     if f_type == 's' or f_type == 'l':
>       f_target = parts[3]
>     else:
> @@ -385,8 +385,11 @@
>         packages_by_pkgname.setdefault(pkgname, pkg_desc)
>     logging.debug("<- _ParsePkginfoOutput()")
>     return packages_by_pkgname
> +
> +  def _IpsNameToPkgname(self, ips_name):
> +    """Create a fake Svr4 pkgname from an ips pkgname"""
> +    return "SUNW" + ips_name.replace("/", "_")
>

Underscores aren't legal in pkgnames. I'd suggest doing something more
strict: finding all the alphanumeric string segments and joining them with
dashes.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opencsw.org/pipermail/devel/attachments/20120530/f8629267/attachment-0001.html>


More information about the devel mailing list