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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Thu Jan 6 15:38:52 CET 2011


Revision: 12223
          http://gar.svn.sourceforge.net/gar/?rev=12223&view=rev
Author:   wahwah
Date:     2011-01-06 14:38:52 +0000 (Thu, 06 Jan 2011)

Log Message:
-----------
checkpkg: Allow a file names license${suffix}

If a package has a file named 'license.html', allow it.

Modified Paths:
--------------
    csw/mgar/gar/v2/lib/python/package_checks.py
    csw/mgar/gar/v2/lib/python/package_checks_test.py

Modified: csw/mgar/gar/v2/lib/python/package_checks.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks.py	2011-01-06 14:22:07 UTC (rev 12222)
+++ csw/mgar/gar/v2/lib/python/package_checks.py	2011-01-06 14:38:52 UTC (rev 12223)
@@ -1141,9 +1141,9 @@
             % (binary_info["soname"], binary_info["base_name"]))
 
 
-def CheckDocDir(pkg_data, error_mgr, logger, messenger):
+def CheckLicenseFilePlacement(pkg_data, error_mgr, logger, messenger):
   pkgname = pkg_data["basic_stats"]["pkgname"]
-  docpath_re = re.compile(r"/opt/csw/share/doc/(?P<docname>[^/]+)/license")
+  docpath_re = re.compile(r"/opt/csw/share/doc/(?P<docname>[^/]+)/license$")
   for pkgmap_entry in pkg_data["pkgmap"]:
     if "path" not in pkgmap_entry: continue
     if not pkgmap_entry["path"]: continue

Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py	2011-01-06 14:22:07 UTC (rev 12222)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py	2011-01-06 14:38:52 UTC (rev 12223)
@@ -1444,8 +1444,9 @@
         'soname=libneon.so.27 filename=foo.so.1')
 
 
-class TestCheckDocDirLicense(CheckpkgUnitTestHelper, unittest.TestCase):
-  FUNCTION_NAME = 'CheckDocDir'
+class TestCheckLicenseFilePlacementLicense(CheckpkgUnitTestHelper,
+                                           unittest.TestCase):
+  FUNCTION_NAME = 'CheckLicenseFilePlacement'
   def CheckpkgTest(self):
     self.pkg_data = copy.deepcopy(neon_stats[0])
     self.pkg_data["pkgmap"].append({
@@ -1459,9 +1460,23 @@
         'in-package=/opt/csw/share/doc/alien/license')
 
 
-class TestCheckDocDirRandomFile(CheckpkgUnitTestHelper, unittest.TestCase):
+class TestCheckLicenseFilePlacementLicenseDifferentSuffix(
+    CheckpkgUnitTestHelper, unittest.TestCase):
+  """A differently suffixed file should not trigger an error."""
+  FUNCTION_NAME = 'CheckLicenseFilePlacement'
+  def CheckpkgTest(self):
+    self.pkg_data = copy.deepcopy(neon_stats[0])
+    self.pkg_data["pkgmap"].append({
+      "class": "none", "type": "f", "line": "",
+      "user": "root", "group": "bin", "mode": '0755',
+      "path": "/opt/csw/share/doc/alien/license.html",
+    })
+
+
+class TestCheckLicenseFilePlacementRandomFile(
+    CheckpkgUnitTestHelper, unittest.TestCase):
   "A random file should not trigger the message; only license files."
-  FUNCTION_NAME = 'CheckDocDir'
+  FUNCTION_NAME = 'CheckLicenseFilePlacement'
   def CheckpkgTest(self):
     self.pkg_data = copy.deepcopy(neon_stats[0])
     self.pkg_data["pkgmap"].append({


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