pkgsrc-WIP-discuss archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

one warning left in pkglint for logrotate



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 ?


Regards,

Nils

------------------------------------------------------------------------------
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
_______________________________________________
pkgsrc-wip-discuss mailing list
pkgsrc-wip-discuss%lists.sourceforge.net@localhost
https://lists.sourceforge.net/lists/listinfo/pkgsrc-wip-discuss


Home | Main Index | Thread Index | Old Index