+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
============
}
#endif
+#include <sys/types.h>
+#include <fcntl.h>
+#if HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
#include "kpath.hh"
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
}
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_);
}