[csw-maintainers] addition to CSWcommon?

Maciej (Matchek) Blizinski maciej at opencsw.org
Sat Jan 1 18:29:41 CET 2011


No dia 1 de Janeiro de 2011 14:00, Peter FELECAN
<pfelecan at opencsw.org> escreveu:
> "Maciej (Matchek) Blizinski" <maciej at opencsw.org> writes:
>
>> I agree that suggesting a gazillion unrelated looking packages might
>> be confusing.  We could stop doing that and only report missing base
>> directories, but... if the right choice is to add a dependency,
>> finding the right dependency by hand is a PITA.  (Unless you know
>> tricks such as "bin/pkgdb show filename /etc/opt/csw/init.d".)
>
> It's not a unknown trick if you give this exact information in your
> message helping the maintainer to find his way.

I still fiddle a lot with the interface of pkgdb, and I was a bit
reluctant of revealing it to the world.  This is a very good
suggestion, how about the following patch?

>From 4b04892ea243e9731930ed9086f92f45fe3860f1 Mon Sep 17 00:00:00 2001
From: Maciej Blizinski <m... at opencsw.org>
Date: Sat, 1 Jan 2011 11:48:44 +0100
Subject: [PATCH] checkpkg: Also suggest adding base dir to the pkg

There are cases where checkpkg suggests seeminly random packages as
dependencies.  It might be a good idea to suggest adding the base directory to
the package instead.

I'm still unclear about the symlinks case - whether it's always true
that if a base directory of a symlink is missing, pkgadd fails.  It's
been the case with coreutils, but I'm not sure whether it's a rule or
a coincidence.

http://lists.opencsw.org/pipermail/maintainers/2010-December/013567.html
---
 gar/v2/lib/python/package_checks.py |   19 +++++++++++++++----
 1 files changed, 15 insertions(+), 4 deletions(-)

diff --git a/gar/v2/lib/python/package_checks.py
b/gar/v2/lib/python/package_checks.py
index 9707b15..0d800ff 100644
--- a/gar/v2/lib/python/package_checks.py
+++ b/gar/v2/lib/python/package_checks.py
@@ -1172,10 +1172,21 @@ def CheckBaseDirs(pkg_data, error_mgr, logger,
messenger):
     if not pkgmap_entry["path"]: continue
     if pkgmap_entry["type"] == "s" or pkgmap_entry["class"] != "none":
       base_dir = os.path.dirname(pkgmap_entry["path"])
-      error_mgr.NeedFile(
-          base_dir,
-          "%s contains %s which needs a base directory: %s."
-          % (pkgname, repr(pkgmap_entry["path"]), repr(base_dir)))
+      error_mgr.ReportError(
+          "base-directory-missing",
+          "basedir=%s "
+          "file=%s "
+          % (base_dir, pkgmap_entry["path"]))
+      if pkgmap_entry["class"] != "none":
+        messenger.Message(
+            "File %s has class %s, which is handled by a script "
+            "which might not work when the base directory is missing. "
+            "%s can either depend on a package which provides %s, "
+            "or provide this directory itself. "
+            "To find packages providing this directory, execute the
following: "
+            "gar/bin/pkgdb show filename %s"
+            % (repr(pkgmap_entry["path"]), repr(pkgmap_entry["class"]),
+               pkgname, repr(base_dir), repr(base_dir)))


 def CheckDanglingSymlinks(pkg_data, error_mgr, logger, messenger):
-- 
1.7.1


More information about the maintainers mailing list