conf/129697: [patch] fix misbehavior of periodic/daily/100.clean-disks vs. port lang/sbcl

V.Chukharev chukharev at mail.ru
Thu Feb 26 14:20:03 PST 2009


The following reply was made to PR conf/129697; it has been noted by GNATS.

From: "V.Chukharev" <chukharev at mail.ru>
To: bug-followup at freebsd.org
Cc: bf2006a at yahoo.com, stas at freebsd.org
Subject: Re: conf/129697: [patch] fix misbehavior of
 periodic/daily/100.clean-disks vs. port lang/sbcl
Date: Thu, 26 Feb 2009 22:15:44 +0200

 ------------xXxCcXc7yyywJqmosxGFwo
 Content-Type: text/plain; charset=koi8-r
 Content-Transfer-Encoding: 7bit
 
 I have made a new patch. Now it uses full path to the preserved files.
 Among other files, sbcl installs two a.out files, and preserving all
 files with this name like the original patch did is too much I think.
 
 I've used the patch with the following lines in /etc/periodic.conf for few days now.
 
 daily_clean_disks_enable="YES"				# Delete files daily
 #daily_clean_disks_files="[#,]* .#* a.out *.core *.CKP .emacs_[0-9]*"
 daily_clean_disks_days=2				# If older than this
 daily_clean_disks_ignore="$daily_clean_disks_ignore /usr/local/lib/sbcl/sbcl.core"		# lang/sbcl
 daily_clean_disks_ignore="$daily_clean_disks_ignore /usr/local/lib/sbcl/sb-bsd-sockets/a.out"	# lang/sbcl
 daily_clean_disks_ignore="$daily_clean_disks_ignore /usr/local/lib/sbcl/sb-posix/a.out"		# lang/sbcl
 daily_clean_disks_ignore="$daily_clean_disks_ignore /usr/local/lib/maxima/5.*/binary-sbcl/maxima.core"	# math/maxima
 
 
 Of course, all these changes to periodic is actially only a temporary amendment. The real 
 solution is to enforce the ports policy of renaming all files corresponding to the special 
 cases. I have filed another PR ports/131790 with a feature request to portlint that it warns 
 about the name collisions like these.
 
 I CC to port maintainers of math/maxima and lang/sbcl so that they know about the issue
 and might try to rename the offending files.
 
 -- 
 V. Chukharev
 ------------xXxCcXc7yyywJqmosxGFwo
 Content-Disposition: attachment; filename=100.clean-disks.patch2.txt
 Content-Type: text/plain; name=100.clean-disks.patch2.txt
 Content-Transfer-Encoding: 7bit
 
 --- /etc/periodic/daily/100.clean-disks.orig	2007-12-24 12:11:21.000000000 +0200
 +++ /etc/periodic/daily/100.clean-disks	2009-02-25 15:12:53.000000000 +0200
 @@ -29,10 +29,18 @@
  	    echo ""
  	    echo "Cleaning disks:"
  	    set -f noglob
 -	    args="$args -name "`echo "$daily_clean_disks_files" |
 +	    args="$args ( -name "`echo "$daily_clean_disks_files" |
  		sed -e 's/^[ 	]*//' \
  		    -e 's/[ 	]*$//' \
 -		    -e 's/[ 	][ 	]*/ -o -name /g'`
 +		    -e 's/[ 	][ 	]*/ -o -name /g'`" )"
 +
 +	    if ! [ -z "$daily_clean_disks_ignore" ]
 +		then
 +			args="$args -a ! ( -path "`echo "$daily_clean_disks_ignore" |
 +			sed -e 's/^[ 	]*//' \
 +				-e 's/[ 	]*$//' \
 +				-e 's/[ 	][ 	]*/ -o -path /g'`" )"
 +		fi
  
  	    case "$daily_clean_disks_verbose" in
  		[Yy][Ee][Ss])
 @@ -41,9 +49,9 @@
  		    print=;;
  	    esac
  
 -	    rc=$(find / \( ! -fstype local -o -fstype rdonly \) -a -prune -o \
 -		\( $args \) -atime +$daily_clean_disks_days -delete $print |
 -		tee /dev/stderr | wc -l)
 +	    command="find / ( ! -fstype local -o -fstype rdonly ) -a -prune -o ( \
 +		( $args ) -atime +$daily_clean_disks_days -delete $print )"
 +	    rc=$($command | tee /dev/stderr | wc -l)
  	    [ -z "$print" ] && rc=0
  	    [ $rc -gt 1 ] && rc=1
  	    set -f glob
 
 ------------xXxCcXc7yyywJqmosxGFwo--
 


More information about the freebsd-bugs mailing list