[csw-devel] proposed checkpkg test

Maciej Bliziński maciej at opencsw.org
Sat Jun 18 08:43:33 CEST 2011


2011/6/18 Ben Walton <bwalton at opencsw.org>:
> After noticing that bacula wanted to gzip manpages by default, I took
> a look through the file database and noticed that several other
> packages[1] provide gzipped manpages.  As solaris man can't handle
> these, I'd consider it a bug in the packaging.  I propose this
> addition to checkpkg:
>
>
> $ svn diff
> Index: package_checks.py
> ===================================================================
> --- package_checks.py   (revision 14836)
> +++ package_checks.py   (working copy)
> @@ -220,6 +220,12 @@
>       if re.search(perllocal_re, entry["path"]):
>         error_mgr.ReportError("perllocal-pod-in-pkgmap",
>         entry["path"])
>
> +def CheckGzippedManpages(pkg_data, error_mgr, logger, messenger):
> +  gzipman_re = re.compile(r'share/man/man.*/.*\.gz$')
> +  for entry in pkg_data["pkgmap"]:
> +    if entry["path"]:
> +      if re.search(gzipman_re, entry["path"]):
> +        error_mgr.ReportError("gzipped-manpage-in-pkgmap",
> entry["path"])

The code looks good.   A unit test would be a good thing to have. I
can think of three test cases:

- a non .gz manpage (no error)
- a .gz manpage (error)
- a .gz manpage outside of share/man (no error?)

Do you need any help with the unit test?

Maciej


More information about the devel mailing list