Bug 179723 - ports-mgmt/pkg: Periodic PKG scripts don't work
Summary: ports-mgmt/pkg: Periodic PKG scripts don't work
Status: Closed FIXED
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: Normal Affects Only Me
Assignee: Bryan Drewery
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-06-19 17:40 UTC by fred
Modified: 2013-06-19 22:50 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description fred 2013-06-19 17:40:00 UTC
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.

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.
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@sunbot:/usr/local/etc/periodic/daily # /usr/local/sbin/pkg -N
pkg: 761 packages installed

The script exits with an error:

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

Checking for out of date packages:
status-pkg is enabled but pkg is not used
Comment 1 Edwin Groothuis freebsd_committer freebsd_triage 2013-06-19 19:38:19 UTC
Responsible Changed
From-To: freebsd-ports-bugs->portmgr

Over to maintainer (via the GNATS Auto Assign Tool)
Comment 2 Bryan Drewery freebsd_committer freebsd_triage 2013-06-19 22:41:10 UTC
Responsible Changed
From-To: portmgr->bdrewery

I'll take it.
Comment 3 Bryan Drewery freebsd_committer freebsd_triage 2013-06-19 22:45:52 UTC
State Changed
From-To: open->closed

Fixed in 1.0.14 update.
Comment 4 dfilter service freebsd_committer freebsd_triage 2013-06-19 22:45:55 UTC
Author: bdrewery
Date: Wed Jun 19 21:45:43 2013
New Revision: 321337
URL: http://svnweb.freebsd.org/changeset/ports/321337

Log:
  - Update to 1.0.14, bringing minor fixes before the 1.1 release.
  
  Changes:
    - 'pkg update' fix [already in port]
    - Crash fix on i386 [already in port]
    - Fix for periodic scripts [1]
  
  PR:		ports/179723 [1]
  Reported by:	fred@SUNBOT.Homedns.ORG [1]

Deleted:
  head/ports-mgmt/pkg/files/
Modified:
  head/ports-mgmt/pkg/Makefile
  head/ports-mgmt/pkg/distinfo

Modified: head/ports-mgmt/pkg/Makefile
==============================================================================
--- head/ports-mgmt/pkg/Makefile	Wed Jun 19 21:44:36 2013	(r321336)
+++ head/ports-mgmt/pkg/Makefile	Wed Jun 19 21:45:43 2013	(r321337)
@@ -1,8 +1,7 @@
 # $FreeBSD$
 
 PORTNAME=	pkg
-DISTVERSION=	1.0.13
-PORTREVISION=	1
+DISTVERSION=	1.0.14
 CATEGORIES=	ports-mgmt
 MASTER_SITES=	LOCAL/portmgr \
 		http://files.etoilebsd.net/pkg/ \

Modified: head/ports-mgmt/pkg/distinfo
==============================================================================
--- head/ports-mgmt/pkg/distinfo	Wed Jun 19 21:44:36 2013	(r321336)
+++ head/ports-mgmt/pkg/distinfo	Wed Jun 19 21:45:43 2013	(r321337)
@@ -1,2 +1,2 @@
-SHA256 (pkg-1.0.13.tar.xz) = 29d2f477f30aff8dd394ffbcdc9e75f3b88ba43d99da71b2a5ad9e171241271b
-SIZE (pkg-1.0.13.tar.xz) = 1458576
+SHA256 (pkg-1.0.14.tar.xz) = ded2c91b0e13fb34da36868328e9b5f3700c634c1fa4962ce3910f20d66a0a53
+SIZE (pkg-1.0.14.tar.xz) = 1458472
_______________________________________________
svn-ports-all@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-ports-all
To unsubscribe, send any mail to "svn-ports-all-unsubscribe@freebsd.org"