Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 May 2011 02:35:12 +0000 (UTC)
From:      Doug Barton <dougb@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r221475 - head/etc/periodic/daily
Message-ID:  <201105050235.p452ZCZ0077771@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: dougb
Date: Thu May  5 02:35:11 2011
New Revision: 221475
URL: http://svn.freebsd.org/changeset/base/221475

Log:
  1. If PKG_DBDIR cannot be determined from make, set the default
  2. Add the -H flag to tar in case /var/db/pkg itself is a symlink
  3. Direct stderr to /dev/null to suppress the leading slash warning [1]
  
  PR:		ports/156810 [1]
  Submitted by:	Jeremy Chadwick <freebsd@jdc.parodius.com> [1]

Modified:
  head/etc/periodic/daily/220.backup-pkgdb

Modified: head/etc/periodic/daily/220.backup-pkgdb
==============================================================================
--- head/etc/periodic/daily/220.backup-pkgdb	Thu May  5 02:04:56 2011	(r221474)
+++ head/etc/periodic/daily/220.backup-pkgdb	Thu May  5 02:35:11 2011	(r221475)
@@ -18,7 +18,8 @@ case "$daily_backup_pkgdb_enable" in
 	bak="${daily_backup_pkgdb_dir:-/var/backups}"
 	bak_file="${bak}/pkgdb.bak.tbz"
 
-	pkg_dbdir=`make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR 2>/dev/null`
+	pkg_dbdir=`make -f/usr/share/mk/bsd.port.mk -V PKG_DBDIR 2>/dev/null` ||
+	  pkg_dbdir=/var/db/pkg
 
 	if [ ! -d "$bak" ]
 	then
@@ -33,7 +34,7 @@ case "$daily_backup_pkgdb_enable" in
 
 	new_bak_file=`mktemp ${bak_file}-XXXXX`
 
-	if tar -cjf "${new_bak_file}" "$pkg_dbdir"; then
+	if tar -cjHf "${new_bak_file}" "$pkg_dbdir" 2>/dev/null; then
 	    chmod 644 "${new_bak_file}"
 
 	    if [ -e "${bak_file}.2" -a -e "${bak_file}" ]; then



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201105050235.p452ZCZ0077771>