Subject: Re: bin/37376: /etc/{daily,weekly,montly} shouldn't try to "dot in"
To: None <gnats-admin@netbsd.org, netbsd-bugs@netbsd.org, eric@cirr.com>
From: Jeremy C. Reed <reed@reedmedia.net>
List: netbsd-bugs
Date: 11/13/2007 19:35:02
The following reply was made to PR bin/37376; it has been noted by GNATS.

From: "Jeremy C. Reed" <reed@reedmedia.net>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: bin/37376: /etc/{daily,weekly,montly} shouldn't try to "dot in"
 {}.local 
Date: Tue, 13 Nov 2007 13:32:34 -0600 (CST)

 On Tue, 13 Nov 2007, Eric Schnoebelen wrote:
 
 > However, after investigation, the real issue may be that ${TMP}
 > is a relative path in /etc/weekly, and my weekly.local changes
 > directories (it's primary task is to update the pkgsrc tree and
 > rebuild.)
 > 
 > Perhaps the the {daily,weekly,monthly,security} scripts should
 > use absolute path names for their temporary files?
 
 That makes sense.
 
 Some ideas:
 
 1)  So for weekly use:
 
 TMP=${WEEKLYDIR}/weekly.$$
 
 or something like that.
 
 Note that it creates and cd's into that temporary directory for any work 
 it does.
 
 2) Maybe just have your weekly.local script cd to the WEEKLYDIR when done?
 
 3) Or maybe this should be done:
 
          . /etc/weekly.local > $TMP 2>&1
 +        cd ${WEEKLYDIR}
          if [ -s $TMP ] ; then
 
 
   Jeremy C. Reed