mirror of
https://github.com/gryf/wmaker.git
synced 2025-12-18 20:10:29 +01:00
Change the way the ChangeLog date is extracted for Texi2txt generated docs
When building into another directory than in the source, the hard-coded relative path to the changelog will fail finding the file, causing an empty date in the generated file when '@today' is used. This patch is making sure the ChangeLog is taken in the source directory to avoid any problem. Signed-off-by: Christophe CURIS <christophe.curis@free.fr>
This commit is contained in:
committed by
Carlos R. Mafra
parent
8606ae9a83
commit
4665972175
2
doc/build/Makefile.am
vendored
2
doc/build/Makefile.am
vendored
@@ -18,6 +18,7 @@ $(top_srcdir)/INSTALL-WMAKER: $(srcdir)/Compilation.texi $(top_srcdir)/script/ge
|
|||||||
$(AM_V_GEN)if test ! -e "$(top_srcdir)/INSTALL-WMAKER" -o -w "$(top_srcdir)/INSTALL-WMAKER" ; then \
|
$(AM_V_GEN)if test ! -e "$(top_srcdir)/INSTALL-WMAKER" -o -w "$(top_srcdir)/INSTALL-WMAKER" ; then \
|
||||||
$(top_srcdir)/script/generate-txt-from-texi.sh \
|
$(top_srcdir)/script/generate-txt-from-texi.sh \
|
||||||
$(srcdir)/Compilation.texi -o $(top_srcdir)/INSTALL-WMAKER \
|
$(srcdir)/Compilation.texi -o $(top_srcdir)/INSTALL-WMAKER \
|
||||||
|
-d "`LANG=C date -u -r $(top_srcdir)/ChangeLog '+%d %B %Y' | sed -e 's,^0,,' `" \
|
||||||
-Dversion="$(PACKAGE_VERSION)" -e "$(PACKAGE_BUGREPORT)" ; \
|
-Dversion="$(PACKAGE_VERSION)" -e "$(PACKAGE_BUGREPORT)" ; \
|
||||||
else \
|
else \
|
||||||
echo "Warning: \"$(top_srcdir)/INSTALL-WMAKER\" is not writeable, not regenerated" ; \
|
echo "Warning: \"$(top_srcdir)/INSTALL-WMAKER\" is not writeable, not regenerated" ; \
|
||||||
@@ -27,6 +28,7 @@ $(top_srcdir)/README.i18n: $(srcdir)/Translations.texi $(top_srcdir)/script/gene
|
|||||||
$(AM_V_GEN)if test ! -e "$(top_srcdir)/README.i18n" -o -w "$(top_srcdir)/README.i18n" ; then \
|
$(AM_V_GEN)if test ! -e "$(top_srcdir)/README.i18n" -o -w "$(top_srcdir)/README.i18n" ; then \
|
||||||
$(top_srcdir)/script/generate-txt-from-texi.sh \
|
$(top_srcdir)/script/generate-txt-from-texi.sh \
|
||||||
$(srcdir)/Translations.texi -o $(top_srcdir)/README.i18n \
|
$(srcdir)/Translations.texi -o $(top_srcdir)/README.i18n \
|
||||||
|
-d "`LANG=C date -u -r $(top_srcdir)/ChangeLog '+%d %B %Y' | sed -e 's,^0,,' `" \
|
||||||
-Dversion="$(PACKAGE_VERSION)" -e "$(PACKAGE_BUGREPORT)" ; \
|
-Dversion="$(PACKAGE_VERSION)" -e "$(PACKAGE_BUGREPORT)" ; \
|
||||||
else \
|
else \
|
||||||
echo "Warning: \"$(top_srcdir)/README.i18n\" is not writeable, not regenerated" ; \
|
echo "Warning: \"$(top_srcdir)/README.i18n\" is not writeable, not regenerated" ; \
|
||||||
|
|||||||
@@ -109,12 +109,15 @@ print_help() {
|
|||||||
echo "Usage: $0 [options...] file.texi"
|
echo "Usage: $0 [options...] file.texi"
|
||||||
echo "valid options are:"
|
echo "valid options are:"
|
||||||
echo " -Dvar=val : set variable 'var' to value 'val'"
|
echo " -Dvar=val : set variable 'var' to value 'val'"
|
||||||
|
echo " -d date : use 'date' for @today instead of current date"
|
||||||
echo " -e email : set email address in variable 'emailsupport'"
|
echo " -e email : set email address in variable 'emailsupport'"
|
||||||
echo " -v version : version of the project"
|
echo " -v version : version of the project"
|
||||||
echo " -o file : name of text file to create"
|
echo " -o file : name of text file to create"
|
||||||
exit 0
|
exit 0
|
||||||
}
|
}
|
||||||
|
|
||||||
|
today_date="`LANG=C date '+%d %B %Y' | sed -e 's,^0,,' `"
|
||||||
|
|
||||||
# Extract command line arguments
|
# Extract command line arguments
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case $1 in
|
case $1 in
|
||||||
@@ -125,6 +128,11 @@ while [ $# -gt 0 ]; do
|
|||||||
`echo "$1" | sed -e 's/^-D/ variable["/ ; s/=/"] = "/ ; s/$/";/' `"
|
`echo "$1" | sed -e 's/^-D/ variable["/ ; s/=/"] = "/ ; s/$/";/' `"
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
-d)
|
||||||
|
shift
|
||||||
|
today_date="$1"
|
||||||
|
;;
|
||||||
|
|
||||||
-e)
|
-e)
|
||||||
shift
|
shift
|
||||||
var_defs="$var_defs
|
var_defs="$var_defs
|
||||||
@@ -153,6 +161,9 @@ while [ $# -gt 0 ]; do
|
|||||||
shift
|
shift
|
||||||
done
|
done
|
||||||
|
|
||||||
|
var_defs="$var_defs
|
||||||
|
variable[\"today\"] = \"$today_date\";"
|
||||||
|
|
||||||
# Check consistency of command-line
|
# Check consistency of command-line
|
||||||
[ "x$input_file" != "x" ] || arg_error "no input texi file given"
|
[ "x$input_file" != "x" ] || arg_error "no input texi file given"
|
||||||
[ "x$output_file" != "x" ] || arg_error "no output file given"
|
[ "x$output_file" != "x" ] || arg_error "no output file given"
|
||||||
@@ -822,7 +833,7 @@ function execute_commands(line, replaced_line, command) {
|
|||||||
} else if (command == "today") {
|
} else if (command == "today") {
|
||||||
# Make sure the date will be in english (we use "C" because it not certain
|
# Make sure the date will be in english (we use "C" because it not certain
|
||||||
# that the English locale is enabled on the machine of the user)
|
# that the English locale is enabled on the machine of the user)
|
||||||
replaced_line = replaced_line "'"`LANG=C date -u -r ../../ChangeLog '+%d %B %Y' | sed -e 's,^0,,' `"'";
|
replaced_line = replaced_line variable["today"];
|
||||||
|
|
||||||
# Commands to display text in a special style ##############################
|
# Commands to display text in a special style ##############################
|
||||||
} else if (command == "asis") {
|
} else if (command == "asis") {
|
||||||
|
|||||||
Reference in New Issue
Block a user