Commits

Anonymous committed 124861e

Implement and use relative genpage.conf paths

Comments (0)

Files changed (3)

 
 XEMACS="c:/XEmacs/XEmacs-21.1.11/i386-pc-win32/xemacs.exe"
 FLAGS=-batch -q -no-site-file
-GENPAGE_CONF="d:\tmp\sourceforge\xemacsweb\genpage.conf"
+# GENPAGE_CONF="d:\tmp\sourceforge\xemacsweb\genpage.conf"
+GENPAGE_CONF="genpage.conf"
 
 site: index.content
 	perl ./genpage/bin/genpage -p $(GENPAGE_CONF)
 #      Command line options override what's in here!
 #
 template 	= template.html
-contentdir 	= d:\tmp\sourceforge\xemacsweb
-layoutdir	= d:\tmp\sourceforge\xemacsweb
-outputdir 	= d:\tmp\sourceforge\xemacsweb\htdocs
+contentdir 	= .
+layoutdir	= .
+outputdir 	= ..\htdocs
 force 		= 0
 debug 		= 0
 quiet 		= 0
-ignore_regexp 	= ^.*\.news$|CVS|genpage|htdocs|.*,v$|^\#.*\#$|.*~$|.*\.err$
+ignore_regexp 	= ^.*\.news$|CVS|genpage|htdocs|.*,v$|^\#.*\#$|.*~$|.*\.err$|\b[Mm]akefile$|\b.*\.mak$
 suffix 		= .html
-glossary 	= d:\tmp\sourceforge\xemacsweb\glossary
+glossary 	= .\glossary
 afterpass	=
 evalparam	=
 execute		=
-includedir	= d:\tmp\sourceforge\xemacsweb
-recipes		= d:\tmp\sourceforge\xemacsweb\toc.gp
+includedir	= .
+recipes		= toc.gp

genpage/bin/genpage

 # $opt_L is location of libraries dir (i.e. recipes)
 # $opt_r is startup recipes that you want genpage to load. (comma delimited list)
 
-$opt_p ||= build_path("", "genpage.conf");
+$opt_p ||= File::Spec->rel2abs("genpage.conf", "");
 if ((dirname($opt_p) eq ".") || (dirname($opt_p) eq ":")) {
-  $opt_p= build_path($root, $opt_p);
+  $opt_p= File::Spec->rel2abs($opt_p, $root);
 }
 
 # Grab our parameters file if it exists
 exit;
 
 sub add_file {
-  my $File = build_path( $File::Find::dir, $_);
+  my $File = File::Spec->rel2abs($_, $File::Find::dir);
   push @Files, $File;
 }
 
 sub getparams {
   %config=(
 	   template => 'template.html',
-	   contentdir => build_path("", "content"),
-	   layoutdir => build_path ("", "layout"),
-	   outputdir =>  build_path("", "www"),
-	   includedir => build_path("","include"),
-	   libdir => build_path("","lib"),
+	   contentdir => File::Spec->rel2abs("content", ""),
+	   layoutdir => File::Spec->rel2abs("layout", ""),
+	   outputdir =>  File::Spec->rel2abs("www", ""),
+	   includedir => File::Spec->rel2abs("include", ""),
+	   libdir => File::Spec->rel2abs("lib", ""),
 	   force => 0,
 	   debug => 0,
 	   quiet => 0,
 	   ignore_regexp =>  q!CVS|.*,v$|^\#.*\#$|.*~$!,
 	   suffix => '.html',
-	   glossary => build_path("","layout") . build_path("", "glossary"),
+	   glossary => File::Spec->rel2abs("layout") . build_path("", "glossary", ""),
            afterpass => '',
            evalparam => '',
            execute => '',
   $opt_r ||= $config{ 'recipes' };
  
   if ((dirname($opt_g) eq ".") || (dirname($opt_g) eq ":")) {
-    $opt_g = build_path ($root, path($opt_g));
+    $opt_g = File::Spec->rel2abs(path($opt_g), $root);
   }
   # dair, build paths procedurally
   if ((dirname($opt_c) eq ".") || (dirname($opt_c) eq ":")) {
-      $opt_c= build_path($root, $opt_c);
+      $opt_c= File::Spec->rel2abs($opt_c, $root);
   }
   if ((dirname($opt_o) eq ".") || (dirname($opt_o) eq ":")) {
-      $opt_o = build_path($root, $opt_o);
+      $opt_o = File::Spec->rel2abs($opt_o, $root);
   }
   if ((dirname($opt_l) eq ".") || (dirname($opt_l) eq ":")) {
-      $opt_l = build_path($root, $opt_l);
+      $opt_l = File::Spec->rel2abs($opt_l, $root);
   }
   if ((dirname($opt_I) eq ".") || (dirname($opt_I) eq ":")) {
-      $opt_I = build_path($root, $opt_I);
+      $opt_I = File::Spec->rel2abs($opt_I, $root);
   }
   if ((dirname($opt_L) eq ".") || (dirname($opt_L) eq ":")) {
-      $opt_L = build_path($root, $opt_L);
+      $opt_L = File::Spec->rel2abs($opt_L, $root);
   }
   require Data::Dumper;
   my $d = Data::Dumper->new([\%config], [qw(config)]);