NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: PR/54730 CVS commit: src/usr.sbin/postinstall



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

From: Izumi Tsutsui <tsutsui%ceres.dti.ne.jp@localhost>
To: gnats-bugs%netbsd.org@localhost
Cc: christos%netbsd.org@localhost, tsutsui%ceres.dti.ne.jp@localhost
Subject: Re: PR/54730 CVS commit: src/usr.sbin/postinstall
Date: Wed, 4 Dec 2019 20:44:21 +0900

 >  Module Name:	src
 >  Committed By:	christos
 >  Date:		Wed Dec  4 04:45:42 UTC 2019
 >  
 >  Modified Files:
 >  	src/usr.sbin/postinstall: postinstall.in
 >  
 >  Log Message:
 >  PR/54730: Izumi Tsutsui: Use /var/db/obsolete/<set> to remove obsolete rc.d
 >  files when not in $SOURCEMODE.
 
 ---
 -# $3: filename
 +# $3: setname
  select_obsolete_files()
  {
 -	${SED} -n -e "/obsolete/s@\.$1$2[[:space:]].*@\1@p" $3
 +	if $SOURCEMODE; then
 +		${SED} -n -e "/obsolete/s@\.$1$2[[:space:]].*@\1@p" \
 +		    ${SRC_DIR}/distrib/sets/lists/$3/mi
 +	else
 +		${SED} -n -e "s@\.$1$2\$@\1@p" "${DEST_DIR}/var/db/obsolete/$3"
 +	fi
  }
 ---
 
 Sorry, my previous comment was incomplete and
 this does not work as expected.
 
 /var/db/obsolete/etc is not extracted into ${DESTDIR}
 as other sets but prepared in ${ETCTGZDIR}:
 
 --- postinstall.in.orig	2019-12-04 20:36:27.562323424 +0900
 +++ postinstall.in	2019-12-04 20:37:31.591546076 +0900
 @@ -1465,11 +1465,18 @@
  # $3: setname
  select_obsolete_files()
  {
 +	local obsolete_dir
 +	if [ $3 = "etc" ] ;then
 +		obsolete_dir=${SRC_DIR}/var/db/obsolete
 +	else
 +		obsolete_dir=${DEST_DIR}/var/db/obsolete
 +	fi
 +
  	if $SOURCEMODE; then
  		${SED} -n -e "/obsolete/s@\.$1$2[[:space:]].*@\1@p" \
  		    ${SRC_DIR}/distrib/sets/lists/$3/mi
  	else
 -		${SED} -n -e "s@\.$1$2\$@\1@p" "${DEST_DIR}/var/db/obsolete/$3"
 +		${SED} -n -e "s@\.$1$2\$@\1@p" "${obsolete_dir}/$3"
  	fi
  }
  
 


Home | Main Index | Thread Index | Old Index