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

wahwah at users.sourceforge.net wahwah at users.sourceforge.net
Mon Apr 19 12:17:43 CEST 2010


Revision: 9705
          http://gar.svn.sourceforge.net/gar/?rev=9705&view=rev
Author:   wahwah
Date:     2010-04-19 10:17:43 +0000 (Mon, 19 Apr 2010)

Log Message:
-----------
mGAR v2: checkpkg, checking for /etc/opt/csw/init.d files, suggesting /opt/csw/etc/init.d/.

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-04-19 09:53:08 UTC (rev 9704)
+++ csw/mgar/gar/v2/lib/python/package_checks.py	2010-04-19 10:17:43 UTC (rev 9705)
@@ -160,6 +160,12 @@
       error_mgr.ReportError(
           "init-file-missing-cswinitsmf-class",
           "%s class=%s" % (entry["path"], entry["class"]))
+    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"])
 
 
 def SetCheckLibraries(pkgs_data, error_mgr, logger, messenger):

Modified: csw/mgar/gar/v2/lib/python/package_checks_test.py
===================================================================
--- csw/mgar/gar/v2/lib/python/package_checks_test.py	2010-04-19 09:53:08 UTC (rev 9704)
+++ csw/mgar/gar/v2/lib/python/package_checks_test.py	2010-04-19 10:17:43 UTC (rev 9705)
@@ -101,33 +101,48 @@
     self.pkg_data["pkginfo"]["NAME"] = 'libsigc++_devel - This catalog name is good'
 
 
-class TestCheckSmfIntegration(CheckpkgUnitTestHelper, unittest.TestCase):
+class TestCheckSmfIntegrationBad(CheckpkgUnitTestHelper, unittest.TestCase):
   FUNCTION_NAME = 'CheckSmfIntegration'
   def CheckpkgTest(self):
     self.pkg_data["pkgmap"].append({
       "class": "none",
       "group": "bin",
-      "line": "1 f none /etc/opt/csw/init.d/foo 0644 root bin 36372 24688 1266395027",
+      "line": "1 f none /opt/csw/etc/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"
     })
     self.error_mgr_mock.ReportError('init-file-missing-cswinitsmf-class',
-                                    '/etc/opt/csw/init.d/foo class=none')
+                                    '/opt/csw/etc/init.d/foo class=none')
 
-class TestCheckCatalognameGood(CheckpkgUnitTestHelper, unittest.TestCase):
+class TestCheckCheckSmfIntegrationGood(CheckpkgUnitTestHelper, unittest.TestCase):
   FUNCTION_NAME = 'CheckSmfIntegration'
   def CheckpkgTest(self):
     self.pkg_data["pkgmap"].append({
       "class": "cswinitsmf",
       "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",
+      "type": "f",
+      "user": "root"
+    })
+
+
+class TestCheckCheckSmfIntegrationWrongLocation(CheckpkgUnitTestHelper, unittest.TestCase):
+  FUNCTION_NAME = 'CheckSmfIntegration'
+  def CheckpkgTest(self):
+    self.pkg_data["pkgmap"].append({
+      "class": "cswinitsmf",
+      "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",
       "type": "f",
       "user": "root"
     })
+    self.error_mgr_mock.ReportError('init-file-wrong-location', '/etc/opt/csw/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