From: Ken Raeburn Date: Thu, 6 Sep 2001 09:40:37 +0000 (+0000) Subject: * depgen.sed: New file. X-Git-Tag: krb5-1.3-alpha1~1088 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=1f67efa4a5a2c9594e193496d5e3c4ca2e3a3da1;p=krb5.git * depgen.sed: New file. * depfix.sed: Remove /foo/../ sequences, looping til no more. git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13730 dc483132-0cff-0310-8789-dd5450dbe970 --- diff --git a/src/util/ChangeLog b/src/util/ChangeLog index b3b9e0a1f..626d73c06 100644 --- a/src/util/ChangeLog +++ b/src/util/ChangeLog @@ -1,3 +1,8 @@ +2001-09-06 Ken Raeburn + + * depgen.sed: New file. + * depfix.sed: Remove /foo/../ sequences, looping til no more. + 2001-09-01 Ken Raeburn * depfix.sed: Temporarily add trailing whitespace to make diff --git a/src/util/depfix.sed b/src/util/depfix.sed index d90033df7..d8fc7357c 100644 --- a/src/util/depfix.sed +++ b/src/util/depfix.sed @@ -28,6 +28,14 @@ s/ */ /g s;/usr/include/[^ ]* ;;g s;/usr/lib/[^ ]* ;;g s;/mit/cygnus[^ ]* ;;g + +# remove foo/../ sequences +:dotdot +/\/[a-z][a-z0-9_.\-]*\/\.\.\// { +s;/[a-z][a-z0-9_.\-]*/\.\./;/;g +bdotdot +} + # rely on VPATH for $(srcdir) files s;\$(srcdir)/\([^ /]* \);\1;g # now delete trailing whitespace diff --git a/src/util/depgen.sed b/src/util/depgen.sed new file mode 100644 index 000000000..fc40c442e --- /dev/null +++ b/src/util/depgen.sed @@ -0,0 +1,18 @@ +# input srctop something like ../../../../asrc/lib/krb5/asn.1/../../../ +# output a sequence of sed commands for recognizing and replacing srctop, +# something like: +# s; ../../../../asrc/lib/krb5/asn.1/../../../; $(SRCTOP)/;g +# s; ../../../../asrc/lib/krb5/../../; $(SRCTOP)/;g +# s; ../../../../asrc/lib/../; $(SRCTOP)/;g +# s; ../../../../asrc/; $(SRCTOP)/;g + +s,\.,\\.,g +s,^,s; , +s,$,/; $(SRCTOP)/;g, +:loop +/\/[a-z][a-z0-9_.\-]*\/\\\.\\\.\// { +p +s;/[a-z][a-z0-9_.\-]*/\\\.\\\./;/; +bloop +} +# implicit print at end