Subject: Re: config.status.overriden on solaris
To: Manuel Bouyer <bouyer@antioche.eu.org>
From: Johnny C. Lam <jlam@NetBSD.org>
List: tech-pkg
Date: 02/26/2004 00:43:53
--OXfL5xGRrasGEqWY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline

On Wed, Feb 25, 2004 at 10:49:46PM +0100, Manuel Bouyer wrote:
> 
> Index: bsd.pkg.mk
> ===================================================================
> RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
> retrieving revision 1.1412
> diff -u -r1.1412 bsd.pkg.mk
> --- bsd.pkg.mk	25 Feb 2004 09:24:52 -0000	1.1412
> +++ bsd.pkg.mk	25 Feb 2004 21:15:34 -0000
> @@ -2487,7 +2487,7 @@
>  			 ${ECHO} 'case $$pkgsrc_override in';		\
>  			 ${ECHO} 'yes) exit 0 ;;';			\
>  			 ${ECHO} 'esac';				\
> -			 ${ECHO} ". ${WRKSRC}/$$file.overridden";	\
> +			 ${ECHO} "${CONFIG_SHELL} ${WRKSRC}/$$file.overridden";	\
>  			) > $$file;					\
>  			${CHMOD} +x $$file;				\
>  		fi;							\

The reason that the generated config.status file sources the overridden
file instead of executing is is so that the overridden script can
transparently use the same argument list.  If the above patch is applied,
the overridden script will know it's called config.status.overridden and
will be able to bypass config.status when calling --recheck.  Could you
test the attached patch instead?

	Cheers,

	-- Johnny Lam <jlam@NetBSD.org>

--OXfL5xGRrasGEqWY
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename=diff

Index: bsd.pkg.mk
===================================================================
RCS file: /cvsroot/pkgsrc/mk/bsd.pkg.mk,v
retrieving revision 1.1412
diff -u -r1.1412 bsd.pkg.mk
--- bsd.pkg.mk	25 Feb 2004 09:24:52 -0000	1.1412
+++ bsd.pkg.mk	26 Feb 2004 00:42:35 -0000
@@ -2474,21 +2474,13 @@
 	for file in ${_pattern_}; do					\
 		if [ -f "$$file" ]; then				\
 			${MV} -f $$file $$file.overridden;		\
-			(${ECHO} '#!${CONFIG_SHELL}';			\
-			 ${ECHO} '${ECHO} "$$0 $$@" >> ${WRKLOG}';	\
-			 ${ECHO} 'pkgsrc_override=no';			\
-			 ${ECHO} 'for arg';				\
-			 ${ECHO} 'do';					\
-			 ${ECHO} '	case $$arg in';			\
-			 ${ECHO} '	--recheck) pkgsrc_override=yes ;;'; \
-			 ${ECHO} '	*) ;;';				\
-			 ${ECHO} '	esac';				\
-			 ${ECHO} 'done';				\
-			 ${ECHO} 'case $$pkgsrc_override in';		\
-			 ${ECHO} 'yes) exit 0 ;;';			\
-			 ${ECHO} 'esac';				\
-			 ${ECHO} ". ${WRKSRC}/$$file.overridden";	\
-			) > $$file;					\
+			${AWK} '/if *\$$ac_cs_recheck/ {		\
+					print "if \$$ac_cs_recheck; then"; \
+					print "  exit 0";		\
+					print "fi";			\
+				}					\
+				{ print }				\
+			       ' $$file.overridden > $$file;		\
 			${CHMOD} +x $$file;				\
 		fi;							\
 	done

--OXfL5xGRrasGEqWY--