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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Thu Apr 18 09:44:59 CEST 2013


Revision: 20771
          http://gar.svn.sourceforge.net/gar/?rev=20771&view=rev
Author:   wahwah
Date:     2013-04-18 07:44:55 +0000 (Thu, 18 Apr 2013)
Log Message:
-----------
checkpkg: Disable bad content check /opt/csw/share

In most cases it's just documentation. We worry mostly about binaries and
libraries.

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	2013-04-18 07:43:58 UTC (rev 20770)
+++ csw/mgar/gar/v2/lib/python/package_checks.py	2013-04-18 07:44:55 UTC (rev 20771)
@@ -774,6 +774,9 @@
 def CheckBadContent(pkg_data, error_mgr, logger, messenger):
   for regex in pkg_data["bad_paths"]:
     for file_name in pkg_data["bad_paths"][regex]:
+      if "opt/csw/share" in file_name:
+        # We don't want to throw this error on documentation.
+        continue
       messenger.Message(
           "File %s contains bad content: %s. "
           "If it's a legacy file you can't modify, "

Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py	2013-04-18 07:43:58 UTC (rev 20770)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py	2013-04-18 07:44:55 UTC (rev 20771)
@@ -2004,6 +2004,24 @@
                                            packages_to_be_installed))
 
 
+class TestCheckBadContent(CheckTestHelper, unittest.TestCase):
+  FUNCTION_NAME = 'CheckBadContent'
 
+  def testGoodFiles(self):
+    self.pkg_data = copy.deepcopy(neon_stats[0])
+    self.pkg_data['bad_paths'] = {
+        'bad-regex': ['root/opt/csw/share/doc/foo'],
+    }
+
+  def testBadFiles(self):
+    self.pkg_data = copy.deepcopy(neon_stats[0])
+    self.pkg_data['bad_paths'] = {
+        'bad-regex': ['root/opt/csw/bin/foo'],
+    }
+    self.error_mgr_mock.ReportError(
+        'file-with-bad-content',
+        'bad-regex root/opt/csw/bin/foo')
+
+
 if __name__ == '__main__':
   unittest.main()

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