Re: one warning left in pkglint for logrotate

"OBATA Akio" <[email protected]>
Newsgroups gmane.os.netbsd.devel.pkgsrc.wip.general
Message-ID <[email protected]>
Hi,

On Mon, 04 Jul 2011 18:21:37 +0900, Nils Ratusznik <[email protected]> wrote:

> Hi all,
>
>
> I have one last warning when running pkglint -Wall in wip/logrotate, and I don't know how to get rid of it.
>
> Here is the thing :
> root@dev:/usr/pkgsrc/wip/logrotate# pkglint -Wall
> WARN: patches/patch-af:14: Found absolute pathname: /usr/bin/logger
> 0 errors and 1 warnings found.
> root@dev:/usr/pkgsrc/wip/logrotate# cat patches/patch-af
> $NetBSD$
>
> Add pkgsrc paths compatibility
>
> --- examples/logrotate.cron.orig        2010-06-28 08:04:56.000000000 +0000
> +++ examples/logrotate.cron
> @@ -1,6 +1,6 @@
>  #!/bin/sh
>
> -/usr/sbin/logrotate /etc/logrotate.conf >/dev/null 2>&1
> +@PREFIX@/sbin/logrotate @PREFIX@/etc/logrotate.conf >/dev/null 2>&1
>  EXITVALUE=$?
>  if [ $EXITVALUE != 0 ]; then
>      /usr/bin/logger -t logrotate "ALERT exited abnormally with [$EXITVALUE]"
>
>
>
> In logrotate, there is an example script for a cron job. I decided to patch this script (you can see @PREFIX@) and to display in the MESSAGE file it can be used. I did not altered the logger's path in the script.
>
> I agree with pkglint's warning but I'm not sure how to handle this :
> - I can decide to do nothing (I really hate that option) ;
> - I can decide not to patch the script and remove this part of MESSAGE, but this script is used in Linux distributions such as Red Hat and Fedora, so pkgsrc version would lack a feature in comparison ;
> - I can change /usr/bin/logger to logger and trust $PATH (I hate this option as much as the first) ;
> - I thought about writing a script from scratch, using which, whereis, find ou type, but 3 of them are binaries (with the same problem : absolute path makes pkglint angry or trusting $PATH) and the other, available in /bin/sh, displays in output "logger is a tracked alias for /usr/bin/logger" which would make me use cut or awk, with the problem of trusting $PATH, or the version of awk/gawk following the operating system; I also could use type from bash, with the same problem as using cut or awk (dependencies, version, $PATH)
>
>
> Does anyone have an idea ?

It's a harmless warning, just ignore it.
(unless we will introduce `logger' as TOOLS and/or add packages providing logger command)

Apart from that, you could consider to honor VARBASE (!= /var) and PKG_SYSCONFBASE (!=${PREFIX}/etc) settings.

-- 
OBATA Akio / [email protected]

------------------------------------------------------------------------------
All of the data generated in your IT infrastructure is seriously valuable.
Why? It contains a definitive record of application performance, security 
threats, fraudulent activity, and more. Splunk takes this data and makes 
sense of it. IT sense. And common sense.
http://p.sf.net/sfu/splunk-d2d-c2
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.