Subject: Re: show example file name if config exists
To: Jeremy C. Reed <reed@reedmedia.net>
From: Greg A. Woods <woods@weird.com>
List: tech-pkg
Date: 08/05/2006 15:48:23
--pgp-sign-Multipart_Sat_Aug__5_15:48:21_2006-1
Content-Type: text/plain; charset=US-ASCII
Content-Transfer-Encoding: quoted-printable
At Thu, 3 Aug 2006 21:45:13 -0500 (CDT),
Jeremy C. Reed wrote:
>=20
> I had this for maybe a year...
>=20
> Index: mk/pkginstall/files
> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
> RCS file: /cvsroot/pkgsrc/mk/pkginstall/files,v
> retrieving revision 1.2
> diff -u -r1.2 files
> --- mk/pkginstall/files 19 Jul 2006 22:26:26 -0000 1.2
> +++ mk/pkginstall/files 4 Aug 2006 02:27:52 -0000
> @@ -167,6 +167,9 @@
> if ${TEST} -f "$file"; then
> ${ECHO} ""
> ${ECHO} " $file already exists."
> + if ${TEST} -f "$f_eg"; then
> + ${ECHO} " [$f_eg]"
> + fi
> elif ${TEST} -f "$f_eg"; then
> ${ECHO} ""
> ${ECHO} " $file"
>=20
That's very minimal and not really very useful or meaningful, IMHO.
I have used this change for a very long time now:
=20
Index: mk/install/files
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
RCS file: /cvs/master/m-NetBSD/main/pkgsrc/mk/install/Attic/files,v
retrieving revision 1.8
diff -u -r1.8 files
--- mk/install/files 19 Aug 2005 22:24:10 -0000 1.8
+++ mk/install/files 29 May 2006 22:59:19 -0000
@@ -144,10 +144,17 @@
if ${TEST} -f "$file"; then
${ECHO} ""
${ECHO} " $file already exists."
+ if cmp "$file" "$f_eg" > /dev/null; then
+ ${ECHO} "It is identical to the example file:"
+ else
+ ${ECHO} ""
+ ${ECHO} " Not overwriting with new example file available here:"
+ fi
+ ${ECHO} " $f_eg"
elif ${TEST} -f "$f_eg"; then
${ECHO} ""
- ${ECHO} " $file"
- ${ECHO} " [$f_eg]"
+ ${ECHO} " $file installed from example:"
+ ${ECHO} " $f_eg"
${CP} $f_eg $file
case $f_user in
"") ;;
@@ -161,6 +168,10 @@
"") ;;
*) ${CHMOD} $f_mode $file ;;
esac
+ else
+ ${ECHO} ""
+ ${ECHO} " no example for $file exists."
+ ${ECHO} " [should be $f_eg]"
fi
;;
esac
--=20
Greg A. Woods
H:+1 416 218-0098 W:+1 416 489-5852 x122 VE3TCP RoboHack <woods@robohack.ca>
Planix, Inc. <woods@planix.com> Secrets of the Weird <woods@weird.com>
--pgp-sign-Multipart_Sat_Aug__5_15:48:21_2006-1
Content-Type: application/pgp-signature
Content-Transfer-Encoding: 7bit
-----BEGIN PGP SIGNATURE-----
Version: PGPfreeware 5.0i for non-commercial use
MessageID: YhfHZDFY2HSQiCyIU1AIeP9+wHlf1yVI
iQA/AwUBRNT2BmJ7XxTCWceFEQJrBwCg4JpMfEDFWftKvGQC+Z3DddduKFUAoLeH
p0Qxg2v7f23h+Sy2vtKz1HbY
=EhMg
-----END PGP SIGNATURE-----
--pgp-sign-Multipart_Sat_Aug__5_15:48:21_2006-1--