ports/179723: Periodic PKG scripts don't work

fred at SUNBOT.Homedns.ORG fred at SUNBOT.Homedns.ORG
Wed Jun 19 16:40:01 UTC 2013


>Number:         179723
>Category:       ports
>Synopsis:       Periodic PKG scripts don't work
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Wed Jun 19 16:40:00 UTC 2013
>Closed-Date:
>Last-Modified:
>Originator:     Fred Gilham
>Release:        FreeBSD 9.1-PRERELEASE amd64
>Organization:
Home
>Environment:
System: FreeBSD sunbot.homedns.org 9.1-PRERELEASE FreeBSD 9.1-PRERELEASE #0: Wed Oct 24 15:47:09 PDT 2012 root at sunbot.homedns.org:/usr/local/obj/usr/src/sys/MYKERN amd64

>Description:
The scripts installed by the pkg port seem to be incorrect.

They have the following:

	if ${pkgcmd} -N >/dev/null 2>&1 ; then
		echo 'pkg-backup is enabled but pkg is not used'
		rc=2
 	else
		....

However, this means that if the script finds ${pkgcmd} it will simply exit
with an error message.


>How-To-Repeat:

If you have the pkg port installed, run a script installed by the pkg port,
such as
/usr/local/etc/periodic/daily/400.status-pkg

It will exit with the error message.

pkg is installed:

root at sunbot:/usr/local/etc/periodic/daily # /usr/local/sbin/pkg -N
pkg: 761 packages installed

The script exits with an error:

root at sunbot:/usr/local/etc/periodic/daily # ./400.status-pkg

Checking for out of date packages:
status-pkg is enabled but pkg is not used


>Fix:


Not sure. As a workaround I've been simply changing the line


if ${pkgcmd} -N >/dev/null 2>&1 ; then

to

if 0 -eq ${pkgcmd} -N > /dev/null 2>&1 ; then


but I think that defeats the purpose of this part of the script.

>Release-Note:
>Audit-Trail:
>Unformatted:


More information about the freebsd-ports-bugs mailing list