ports/125627: [ PATCH ] ports-mgmt/portupgrade: don't change +CONTENTS mtime when file not changed
Dan Lukes
dan at obluda.cz
Tue Jul 15 08:50:03 UTC 2008
>Number: 125627
>Category: ports
>Synopsis: [ PATCH ] ports-mgmt/portupgrade: don't change +CONTENTS mtime when file not changed
>Confidential: no
>Severity: non-critical
>Priority: low
>Responsible: freebsd-ports-bugs
>State: open
>Quarter:
>Keywords:
>Date-Required:
>Class: change-request
>Submitter-Id: current-users
>Arrival-Date: Tue Jul 15 08:50:02 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator: Dan Lukes
>Release: FreeBSD 6.3-STABLE i386
>Organization:
Obludarium
>Environment:
portupgrade-2.4.3.2,2
>Description:
The portupgrade during update of the port touch all the /var/db/pkg/*/+CONTENTS files
despite they are really modified or not.
It make hard to track which ports changes and needs to be repackaged (via pkg_create -b) to reflect latest changes.
The portupgrade try to track changes and rebuild packages by self, but if portupgrade ends prematurely for a reason,
then some packages may not be repackaged. There are no easy way to found them and make package later.
The simple script may be used to repair it - for example ...
-------------------
for i in /var/db/pkg/* ; do
i=$( basename "$i" )
[ -f "/var/db/pkg/$i/+CONTENTS" ] || continue
if [ ! -r "/usr/ports/packages/All/$i.tbz" -o "/var/db/pkg/$i/+CONTENTS" -nt "/usr/ports/packages/All/$i.tbz" ] ; then
pkg_create -v -b "$i" "/usr/ports/packages/All/$i.tbz"
fi
done
------------------
... but it depend on the fact that +CONTENTS file doesn't become "new" when not changed.
With +CONTENTS's times changing every portupgrade's run it is very hard to find which packages are obsolete according current system state and need to be repackaged.
>How-To-Repeat:
N/A
>Fix:
Simple - ask 'install' not to change 'times' when content not changed. The option -C is dedicated for such request:
--- lib/pkgtools.rb.ORIG 2008-07-14 22:02:30.000000000 +0200
+++ lib/pkgtools.rb 2008-07-14 22:03:47.000000000 +0200
@@ -565,6 +565,7 @@
def install_data(src, dst, backup = false)
cmd = ['/usr/bin/install']
cmd.push('-b') if backup
+ cmd.push('-C')
cmd.push('-m', '644', src, dst)
begin
>Release-Note:
>Audit-Trail:
>Unformatted:
More information about the freebsd-ports-bugs
mailing list