Ilya Zakharevich on Sun, 10 Nov 2002 00:48:28 -0800


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

[PATCH CVS] vi tags


This removes minor unportabilities for vi/less tags generation

Enjoy,
Ilya

--- ./src/make_vi_tags-pre	Thu Oct  4 09:05:16 2001
+++ ./src/make_vi_tags	Sat Nov  9 20:14:18 2002
@@ -1,14 +1,24 @@
 eval 'exec perl $0 $1'
   if $running_under_some_shell;
+use File::Find 'find';
+
 # Build a (sorted) VI(M) tags file including GP functions
 #
 $src=$ARGV[0] || "$ENV{HOME}/PARI/src";
 $tmptags="$src/tags.tmp";
-$tags="$src/tags";
+
+# Case sensitive?
+$tags = $^O eq 'os2' ? "$src/ctags" : "$src/tags";
 
 @tags=""; $old="";
+
+@files = ();
+
+find \&filter_c, $src;
+
 # assume ctags outputs sorted tags (e.g Exuberant Ctags)
-system("ctags -f $tmptags `find $src -name '*.[chs]' -type f -print`");
+system('ctags', '-f', $tmptags,  @files);
+
 getnames("$src/gp/gp_init.c");
 getnames("$src/language/init.c");
 geterrs("$src/language/errmsg.c");
@@ -58,4 +68,10 @@ sub geterrs
     }
   }
   close(A);
+}
+
+sub filter_c {
+  return unless /\.[chs]\Z/;
+  return unless -f;
+  push @files, "$File::Find::name";
 }