From 007293d292c8ce85a8ad8ee1a4906928e5f31755 Mon Sep 17 00:00:00 2001 From: Jan Nieuwenhuizen Date: Mon, 5 Mar 2001 21:52:13 +0100 Subject: [PATCH] patch::: 1.3.135.jcn2 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 | 8 ++++++++ VERSION | 2 +- lily/kpath.cc | 31 ++++++++++++++++++++++++------- lily/paper-score.cc | 9 ++++----- 4 files changed, 37 insertions(+), 13 deletions(-) diff --git a/CHANGES b/CHANGES index d26b9e213d..8686297cff 100644 --- 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 4e3fec04d6..b1cf5063dc 100644 --- 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. diff --git a/lily/kpath.cc b/lily/kpath.cc index fe928b6935..8fa0c142bd 100644 --- a/lily/kpath.cc +++ b/lily/kpath.cc @@ -20,6 +20,12 @@ extern "C" { } #endif +#include +#include +#if HAVE_SYS_STAT_H +#include +#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 } diff --git a/lily/paper-score.cc b/lily/paper-score.cc index e36954a2ca..734b56d005 100644 --- a/lily/paper-score.cc +++ b/lily/paper-score.cc @@ -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_); } -- 2.39.5