[csw-devel] SF.net SVN: gar:[14874] csw/mgar/gar/v2/lib/python

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Fri Jun 24 03:23:51 CEST 2011


Revision: 14874
          http://gar.svn.sourceforge.net/gar/?rev=14874&view=rev
Author:   wahwah
Date:     2011-06-24 01:23:51 +0000 (Fri, 24 Jun 2011)

Log Message:
-----------
pkgdb: Support for pipe file types

Patch by Igor Gali?\196?\135.

Signed-off-by: Maciej Blizi?\197?\132ski <maciej at opencsw.org>

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/pkgmap.py
    csw/mgar/gar/v2/lib/python/pkgmap_test.py
    csw/mgar/gar/v2/lib/python/system_pkgmap.py
    csw/mgar/gar/v2/lib/python/system_pkgmap_test.py

Modified: csw/mgar/gar/v2/lib/python/pkgmap.py
===================================================================
--- csw/mgar/gar/v2/lib/python/pkgmap.py	2011-06-24 01:11:40 UTC (rev 14873)
+++ csw/mgar/gar/v2/lib/python/pkgmap.py	2011-06-24 01:23:51 UTC (rev 14874)
@@ -26,7 +26,8 @@
       "s": "symlink",
       "l": "link",
       "i": "script",
-      "e": "editable file"
+      "e": "editable file",
+      "p": "pipe"
   }
 
   def __init__(self, input, permissions=False,
@@ -62,7 +63,7 @@
     target = None
     if len(fields) < 2:
       return None
-    elif line_type in ('f', 'd'):
+    elif line_type in ('f', 'd', 'p'):
       # Files and directories
       line_to_add = fields[3]
       installed_path = fields[3]

Modified: csw/mgar/gar/v2/lib/python/pkgmap_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/pkgmap_test.py	2011-06-24 01:11:40 UTC (rev 14873)
+++ csw/mgar/gar/v2/lib/python/pkgmap_test.py	2011-06-24 01:23:51 UTC (rev 14874)
@@ -23,6 +23,7 @@
 1 e build /opt/csw/apache2/ap2mod/suexec ? ? ? 1472 50478 1289099700
 1 d none /opt/csw/apache2/libexec 0755 root bin
 1 f none /opt/csw/apache2/libexec/mod_suexec.so 0755 root bin 6852 52597 1289092061
+1 p none /etc/scn/scn_aa_read 0600 root sys
 """
 
 class PkgmapUnitTest(unittest.TestCase):

Modified: csw/mgar/gar/v2/lib/python/system_pkgmap.py
===================================================================
--- csw/mgar/gar/v2/lib/python/system_pkgmap.py	2011-06-24 01:11:40 UTC (rev 14873)
+++ csw/mgar/gar/v2/lib/python/system_pkgmap.py	2011-06-24 01:23:51 UTC (rev 14874)
@@ -148,7 +148,7 @@
     elif file_type == 'l':
       # ftype l: path l class package
       f_path, f_type, f_class, f_pkgname = parts
-    elif file_type in ('d', 'x'):
+    elif file_type in ('d', 'x', 'p'):
       # ftype d: path d class mode owner group package(s)
       # ftype x: path x class mode owner group package
       f_path, f_type, f_class, f_mode, f_owner, f_group = parts[:6]

Modified: csw/mgar/gar/v2/lib/python/system_pkgmap_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/system_pkgmap_test.py	2011-06-24 01:11:40 UTC (rev 14873)
+++ csw/mgar/gar/v2/lib/python/system_pkgmap_test.py	2011-06-24 01:23:51 UTC (rev 14874)
@@ -26,6 +26,7 @@
                  "1250803966 SUNWcsl")
 PKGMAP_LINE_7 = ("/opt/csw/include/mozilla/accessibility/nsAccessNode.h "
                  "f none 0644 root bin 5557 10685 1068611657 !CSWmozilla")
+PKGMAP_LINE_8 = ("/etc/scn/scn_aa_read p none 0600 root sys SUNWscn-agentfacade-r")
 
 
 class IndexerUnitTest(unittest.TestCase):
@@ -85,6 +86,27 @@
     }
     self.assertEqual(expected, spi._ParsePkgmapLine(PKGMAP_LINE_5))
 
+  def test_ParsePkgmapLineTypePipe(self):
+    """A pipe is a valid type and we have to cope with it."""
+    spi = system_pkgmap.Indexer()
+    expected = {
+        'modtime': None,
+        'major': None,
+        'pkgnames': ['SUNWscn-agentfacade-r'],
+        'cksum': None,
+        'owner': 'root',
+        'path': '/etc/scn/scn_aa_read',
+        'line': PKGMAP_LINE_8,
+        'class': 'none',
+        'size': None,
+        'group': 'sys',
+        'target': None,
+        'mode': '0600',
+        'type': 'p',
+        'minor': None,
+    }
+    self.assertEqual(expected, spi._ParsePkgmapLine(PKGMAP_LINE_8))
+
   def test_ParsePkgmapLibc(self):
     """A question mark is not a valid type, but we have to cope with it."""
     spi = system_pkgmap.Indexer()


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.


More information about the devel mailing list