Subject: pkg/21228: work directories are getting included in backups
To: None <gnats-bugs@gnats.netbsd.org>
From: None <rneswold@earthlink.net>
List: netbsd-bugs
Date: 04/18/2003 11:56:22
>Number:         21228
>Category:       pkg
>Synopsis:       work directories are getting included in backups
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    pkg-manager
>State:          open
>Class:          change-request
>Submitter-Id:   net
>Arrival-Date:   Fri Apr 18 16:57:00 UTC 2003
>Closed-Date:
>Last-Modified:
>Originator:     Rich Neswold
>Release:        NetBSD 1.6.1_RC2
>Organization:
	
>Environment:
	
	
System: NetBSD groucho.neswold.local 1.6.1_RC2 NetBSD 1.6.1_RC2 (GROUCHO) #0: Mon Mar 17 15:41:54 CST 2003     toor@groucho.neswold.local:/usr/src/sys/arch/i386/compile/GROUCHO i386
Architecture: i386
Machine: i386
>Description:

I use 'dump' to backup my disks. It would be nice to be able to ignore
package work directories in the backup (since some of them expand quite large.)
Typically I 'make clean' after a build, but occasionally I'll leave them
around if I'm tracking down a problem.

>How-To-Repeat:
	
>Fix:

I've applied the following patches in /usr/pkgsrc/mk. These patches turn on
the 'nodump' bit of the work directory, which can be used by 'dump' to ignore
'work/' and all its contents. I conditionally do this based on whether the
CHFLAGS symbol has been defined. I only have access to NetBSD and FreeBSD
machines, so only those platforms get this behavior.


--- defs.NetBSD.mk.orig	Fri Apr 18 11:31:48 2003
+++ defs.NetBSD.mk	Fri Apr 18 11:33:10 2003
@@ -8,6 +8,7 @@
 CHMOD?=		/bin/chmod
 CHOWN?=		/usr/sbin/chown
 CHGRP?=		/usr/bin/chgrp
+CHFLAGS?=	/usr/bin/chflags
 CMP?=		/usr/bin/cmp
 CP?=		/bin/cp
 CUT?=		/usr/bin/cut


--- defs.FreeBSD.mk.orig	Fri Apr 18 11:31:57 2003
+++ defs.FreeBSD.mk	Fri Apr 18 11:34:00 2003
@@ -8,6 +8,7 @@
 CHMOD?=		/bin/chmod
 CHOWN?=		/usr/sbin/chown
 CHGRP?=		/usr/bin/chgrp
+CHFLAGS?=	/usr/bin/chflags
 CMP?=		/usr/bin/cmp
 CP?=		/bin/cp
 CUT?=		/usr/bin/cut


--- bsd.pkg.mk.orig	Fri Apr 18 11:31:42 2003
+++ bsd.pkg.mk	Fri Apr 18 11:35:35 2003
@@ -1486,6 +1486,9 @@
 .  endif
 .endif
 	${_PKG_SILENT}${_PKG_DEBUG}${MKDIR} ${WRKDIR}
+.if defined(CHFLAGS)
+	${_PKG_SILENT}${_PKG_DEBUG}${CHFLAGS} nodump ${WRKDIR}
+.endif
 .ifdef WRKOBJDIR
 .  if ${PKGSRC_LOCKTYPE} == "sleep" || ${PKGSRC_LOCKTYPE} == "once"
 .    if !exists(${LOCKFILE})
>Release-Note:
>Audit-Trail:
>Unformatted: