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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Wed Jun 2 12:37:25 CEST 2010


Revision: 10070
          http://gar.svn.sourceforge.net/gar/?rev=10070&view=rev
Author:   wahwah
Date:     2010-06-02 10:37:25 +0000 (Wed, 02 Jun 2010)

Log Message:
-----------
mGAR v2: checkpkg, throwing an error for init files under /opt, and pointing to the thread on maintainers mailing list.

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	2010-06-02 09:08:55 UTC (rev 10069)
+++ csw/mgar/gar/v2/lib/python/package_checks.py	2010-06-02 10:37:25 UTC (rev 10070)
@@ -171,15 +171,16 @@
 
     # This is not an error, in fact, putting files into
     # /opt/csw/etc/init.d breaks packages.
-    #
-    # if "/etc/opt/csw/init.d" in entry["path"]:
-    #   messenger.Message("Init files should go into /opt/csw/etc/init.d, "
-    #                     "not /etc/opt/csw/init.d.")
-    #   error_mgr.ReportError(
-    #       "init-file-wrong-location",
-    #       entry["path"])
 
+    if "/opt/csw/etc/init.d" in entry["path"]:
+      messenger.Message("Init files under /opt result in broken packages, "
+                        "see http://lists.opencsw.org/pipermail/maintainers/"
+                        "2010-June/012145.html")
+      error_mgr.ReportError(
+          "init-file-wrong-location",
+          entry["path"])
 
+
 def SetCheckLibraries(pkgs_data, error_mgr, logger, messenger):
   """Second version of the library checking code.
 

Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py	2010-06-02 09:08:55 UTC (rev 10069)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py	2010-06-02 10:37:25 UTC (rev 10070)
@@ -109,12 +109,12 @@
       "group": "bin",
       "line": "1 f none /opt/csw/etc/init.d/foo 0644 root bin 36372 24688 1266395027",
       "mode": '0755',
-      "path": "/opt/csw/etc/init.d/foo",
+      "path": "/etc/opt/csw/init.d/foo",
       "type": "f",
       "user": "root"
     })
     self.error_mgr_mock.ReportError('init-file-missing-cswinitsmf-class',
-                                    '/opt/csw/etc/init.d/foo class=none')
+                                    '/etc/opt/csw/init.d/foo class=none')
 
 class TestCheckCheckSmfIntegrationGood(CheckpkgUnitTestHelper, unittest.TestCase):
   FUNCTION_NAME = 'CheckSmfIntegration'
@@ -124,7 +124,7 @@
       "group": "bin",
       "line": "1 f none /opt/csw/etc/init.d/foo 0644 root bin 36372 24688 1266395027",
       "mode": '0755',
-      "path": "/opt/csw/etc/init.d/foo",
+      "path": "/etc/opt/csw/init.d/foo",
       "type": "f",
       "user": "root"
     })
@@ -138,12 +138,11 @@
       "group": "bin",
       "line": "1 f none /etc/opt/csw/init.d/foo 0644 root bin 36372 24688 1266395027",
       "mode": '0755',
-      "path": "/etc/opt/csw/init.d/foo",
+      "path": "/opt/csw/etc/init.d/foo",
       "type": "f",
       "user": "root"
     })
-    # This is not an error.
-    # self.error_mgr_mock.ReportError('init-file-wrong-location', '/etc/opt/csw/init.d/foo')
+    self.error_mgr_mock.ReportError('init-file-wrong-location', '/opt/csw/etc/init.d/foo')
 
 
 class TestCatalognameLowercase_1(CheckpkgUnitTestHelper, unittest.TestCase):


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