* depgen.sed: New file.
authorKen Raeburn <raeburn@mit.edu>
Thu, 6 Sep 2001 09:40:37 +0000 (09:40 +0000)
committerKen Raeburn <raeburn@mit.edu>
Thu, 6 Sep 2001 09:40:37 +0000 (09:40 +0000)
* depfix.sed: Remove /foo/../ sequences, looping til no more.

git-svn-id: svn://anonsvn.mit.edu/krb5/trunk@13730 dc483132-0cff-0310-8789-dd5450dbe970

src/util/ChangeLog
src/util/depfix.sed
src/util/depgen.sed [new file with mode: 0644]

index b3b9e0a1f3d322a2891256d40247811d6c278fb4..626d73c06a2801ca9e4db09078753e6f40fd4498 100644 (file)
@@ -1,3 +1,8 @@
+2001-09-06  Ken Raeburn  <raeburn@mit.edu>
+
+       * depgen.sed: New file.
+       * depfix.sed: Remove /foo/../ sequences, looping til no more.
+
 2001-09-01  Ken Raeburn  <raeburn@mit.edu>
 
        * depfix.sed: Temporarily add trailing whitespace to make
index d90033df74ffc9ab5101c00aec89947c82972237..d8fc7357c26a65214478730c0ee146e45448bcb4 100644 (file)
@@ -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 (file)
index 0000000..fc40c44
--- /dev/null
@@ -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