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

Re: A few questions on using wmk



On Wed, 9 Feb 2000, James A. Treacy wrote:

> The wml man page says that an executable used in --epilog should be in your path.
> Is there a way to specify the executable exactly? I'd like to have something like
> the following in the .wmlrc file:
> 
> -D HOME~.
> -E $(HOME)/convert
> 
> This doesn't work though. Any suggestions?
> This would be a lot easier than requiring all the people working on the pages to
> change their path.

Agree.
Below is a patch against wml.src version 1.7.4 (should also work with
other versions), let me know if you are happy with it.

--- wml.src	1999/09/30 09:28:07	1.31
+++ wml.src	2000/02/10 09:15:44
@@ -972,10 +972,34 @@
     }
 }
 
-#   determine prologs
+#   adjust prologs and epilogs
 $prolog = '';
-foreach $p (@opt_P) {
-    $prolog .= " -P '$p'";
+{
+    my %defs = ();
+    foreach $d (@opt_D) {
+        ($var, $dummy, $val) = ($d =~ m|^(.+?)=("?)(.*)\2\n*$|);
+        $defs{$var} = $val;
+    }
+    foreach $p (@opt_P) {
+        1 while ($p =~ s|\$\(([A-Za-z0-9_]+)\)|$defs{$1}|g);
+        $prolog .= " -P '$p'";
+    }
+    my @opt_E_OLD = @opt_E;
+    @opt_E = ();
+    foreach $e (@opt_E_OLD) {
+        if ($e =~ m|^htmlinfo(.*)|) {
+            $e = "@libdir@/exec/wml_aux_htmlinfo$1";
+        }
+        elsif ($e =~ m|^weblint(.*)|) {
+            $e = "@libdir@/exec/wml_aux_weblint$1";
+        }
+        elsif ($e =~ m|^linklint(.*)|) {
+            $e = "@libdir@/exec/wml_aux_linklint$1";
+            $e .= " -nocache -one -summary" if ($1 eq '');
+        }
+        1 while ($e =~ s|\$\(([A-Za-z0-9_]+)\)|$defs{$1}|g);
+        push(@opt_E, $e);
+    }
 }
 
 $defipp = '';
@@ -1240,16 +1264,6 @@
     #   run epilog filters
     foreach $o (@outfiles) {
         foreach $e (@opt_E) {
-            if ($e =~ m|^htmlinfo(.*)|) {
-                $e = "@libdir@/exec/wml_aux_htmlinfo$1";
-            }
-            elsif ($e =~ m|^weblint(.*)|) {
-                $e = "@libdir@/exec/wml_aux_weblint$1";
-            }
-            elsif ($e =~ m|^linklint(.*)|) {
-                $e = "@libdir@/exec/wml_aux_linklint$1";
-                $e .= " -nocache -one -summary" if ($1 eq '');
-            }
             &verbose(2, "EPILOG: $e $o\n");
             $rc = system("$e $o");
             if ($rc != 0) {

-- 
Denis Barbier
WML Maintainer

______________________________________________________________________
Website META Language (WML)                www.engelschall.com/sw/wml/
Official Support Mailing List                   sw-wml@engelschall.com
Automated List Manager                       majordomo@engelschall.com