]> git.donarmstrong.com Git - lilypond.git/commitdiff
patch::: 1.3.135.jcn2
authorJan Nieuwenhuizen <janneke@gnu.org>
Mon, 5 Mar 2001 20:52:13 +0000 (21:52 +0100)
committerJan Nieuwenhuizen <janneke@gnu.org>
Mon, 5 Mar 2001 20:52:13 +0000 (21:52 +0100)
1.3.135.jcn2
============

* Bugfix: (first and also) write global header fields; this fixes
`latexpackages' and ly2dvi.

* Crude sanity check for kpath.cc searching.

CHANGES
VERSION
lily/kpath.cc
lily/paper-score.cc

diff --git a/CHANGES b/CHANGES
index d26b9e213d12346221e8d39514fe8ee376e933b8..8686297cff4b555458f2f7f2375523e41257cb4b 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,11 @@
+1.3.135.jcn2
+============
+
+* Bugfix: (first and also) write global header fields; this fixes
+`latexpackages' and ly2dvi.
+
+* Crude sanity check for kpath.cc searching.
+
 1.3.135.jcn1
 ============
 
diff --git a/VERSION b/VERSION
index 4e3fec04d62b5704dab2e8dc7ca42212e000e042..b1cf5063dc87215b281ff28fdc24e2b159cc9320 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -2,7 +2,7 @@ PACKAGE_NAME=LilyPond
 MAJOR_VERSION=1
 MINOR_VERSION=3
 PATCH_LEVEL=135
-MY_PATCH_LEVEL=jcn1
+MY_PATCH_LEVEL=jcn2
 
 # use the above to send patches: MY_PATCH_LEVEL is always empty for a
 # released version.
index fe928b693513e5d0244f96b5b235618fd6363915..8fa0c142bd8fc257fd6b9765737a06a0c6d95d39 100644 (file)
@@ -20,6 +20,12 @@ extern "C" {
 }
 #endif
 
+#include <sys/types.h>
+#include <fcntl.h>
+#if HAVE_SYS_STAT_H 
+#include <sys/stat.h>
+#endif
+
 #include "kpath.hh"
 
 
@@ -52,16 +58,27 @@ ly_init_kpath (char *av0)
   kpse_maketex_option("tfm", TRUE);
 
   /*
-    UGH: should not use DIR_DATADIR, but /var,  
-   */
+    UGH: should not use DIR_DATADIR, but /var,
 
-  /*
-    ugh: apparently the program_args is non-functional.
+    hmm, but where to get /var?
+    
    */
-  kpse_format_info[kpse_tfm_format].program ="mktextfm --destdir " DIR_DATADIR "/tfm";
 
-  kpse_format_info[kpse_tfm_format].client_path =
-    (DIR_DATADIR "/tfm" );
+  int fd;
+  struct stat stat_buf;
+  if (stat (DIR_DATADIR "/tfm", &stat_buf) == 0
+      && (S_ISDIR (stat_buf.st_mode) || S_ISLNK (stat_buf.st_mode))
+      // ugh, howto test if we can write there?
+      //      && (stat_buf.st_mode & S_IWUSR))
+      && ((fd = open (DIR_DATADIR "/tfm/lily", O_CREAT)) != -1))
+    {
+      close (fd);
+      unlink (DIR_DATADIR "/tfm/lily");
+      kpse_format_info[kpse_tfm_format].program ="mktextfm --destdir " DIR_DATADIR "/tfm";
+
+      kpse_format_info[kpse_tfm_format].client_path =
+       (DIR_DATADIR "/tfm" );
+    }
   
 #endif
 }
index e36954a2cad7fc1cd6aa603fcc76c5622179562e..734b56d005179a180e06c17b832908dd485c6605 100644 (file)
@@ -100,14 +100,13 @@ Paper_score::process ()
 
   if (global_header_p)
     {
-    Scope gh (global_header_p);
-    outputter_l_->output_scope (&gh, "lilypond");
+      Scope gh (global_header_p);
+      outputter_l_->output_scope (&gh, "lilypond");
+      outputter_l_->write_header_fields_to_file (&gh);
     }
   if (header_l_)
     {
-      if (header_l_)
-       outputter_l_->output_scope (header_l_, "lilypond");
-
+      outputter_l_->output_scope (header_l_, "lilypond");
       outputter_l_->write_header_fields_to_file (header_l_);
     }