{"thread":{"id":"9426","subject":"[install info (using perl) 2/2] INSTALL: explain info installation and dependencies.","startedAt":"2007-08-06T10:22:57Z","lastAt":"2007-08-08T23:46:21Z","messageCount":8,"participants":["David Kastrup","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"50117","messageId":"591c5679ea79b76cd5db57443b1d691bde842351.1186484406.git.dak@gnu.org","threadId":"9426","inReplyTo":null,"subject":"[install info (using perl) 1/2] Add support for an info version of the user manual","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-06T10:22:57Z","receivedAt":"2007-08-06T10:22:57Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"These patches use docbook2x in order to create an info version of the\ngit user manual.  No existing Makefile targets (including \"all\") are\ntouched, so you need to explicitly say\n\nmake info\nsudo make install-info\n\nto get git.info created and installed.  If the info target directory\ndoes not already contain a \"dir\" file, no directory entry is created.\nThis facilitates $(DESTDIR)-based installations.  The same could be\nachieved with\n\nsudo make INSTALL_INFO=: install-info\n\nexplicitly.\n\nperl is used for patching up sub-par file and directory information in\nthe Texinfo file.  It would be cleaner to place the respective info\nstraight into user-manual.txt or the conversion configurations, but I\nfind myself unable to find out how to do this with Asciidoc/Texinfo.\n\nSigned-off-by: David Kastrup <dak@gnu.org>\n---\n Documentation/Makefile |   27 +++++++++++++++++++++++++++\n Makefile               |    6 ++++++\n 2 files changed, 33 insertions(+), 0 deletions(-)\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 91a437d..71b7056 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -44,6 +44,11 @@ INSTALL?=install\n RM ?= rm -f\n DOC_REF = origin/man\n \n+infodir?=$(prefix)/share/info\n+MAKEINFO=makeinfo\n+INSTALL_INFO=install-info\n+DOCBOOK2X_TEXI=docbook2x-texi\n+\n -include ../config.mak.autogen\n -include ../config.mak\n \n@@ -67,6 +72,8 @@ man1: $(DOC_MAN1)\n man5: $(DOC_MAN5)\n man7: $(DOC_MAN7)\n \n+info: git.info\n+\n install: man\n \t$(INSTALL) -d -m755 $(DESTDIR)$(man1dir)\n \t$(INSTALL) -d -m755 $(DESTDIR)$(man5dir)\n@@ -75,6 +82,14 @@ install: man\n \t$(INSTALL) -m644 $(DOC_MAN5) $(DESTDIR)$(man5dir)\n \t$(INSTALL) -m644 $(DOC_MAN7) $(DESTDIR)$(man7dir)\n \n+install-info: info\n+\t$(INSTALL) -d -m755 $(DESTDIR)$(infodir)\n+\t$(INSTALL) -m644 git.info $(DESTDIR)$(infodir)\n+\tif test -r $(DESTDIR)$(infodir)/dir; then \\\n+\t  $(INSTALL_INFO) --info-dir=$(DESTDIR)$(infodir) git.info ;\\\n+\telse \\\n+\t  echo \"No directory found in $(DESTDIR)$(infodir)\" >&2 ; \\\n+\tfi\n \n ../GIT-VERSION-FILE: .FORCE-GIT-VERSION-FILE\n \t$(MAKE) -C ../ GIT-VERSION-FILE\n@@ -139,6 +154,18 @@ XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css\n user-manual.html: user-manual.xml\n \txsltproc $(XSLTOPTS) -o $@ $(XSLT) $<\n \n+git.info: user-manual.xml\n+\t$(RM) $@ $*.texi\n+\t$(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | \\\n+\tperl -ne 'if (/^\\@setfilename/) {$$_=\"\\@setfilename git.info\\\n+\"} elsif (/^\\@direntry/) {print \"\\@dircategory Development\\\n+\\@direntry\\\n+* Git: (git).           A fast distributed revision control system\\\n+\\@end direntry\\\n+\"} print unless (/^\\@direntry/ .. /^\\@end direntry/)' > $*.texi\n+\t$(MAKEINFO) --no-split $*.texi\n+\t$(RM) $*.texi\n+\n howto-index.txt: howto-index.sh $(wildcard howto/*.txt)\n \t$(RM) $@+ $@\n \tsh ./howto-index.sh $(wildcard howto/*.txt) >$@+\ndiff --git a/Makefile b/Makefile\nindex 2f3b9b2..b685c7e 100644\n--- a/Makefile\n+++ b/Makefile\n@@ -913,6 +913,9 @@ perl/Makefile: perl/Git.pm perl/Makefile.PL GIT-CFLAGS\n doc:\n \t$(MAKE) -C Documentation all\n \n+info:\n+\t$(MAKE) -C Documentation info\n+\n TAGS:\n \t$(RM) TAGS\n \t$(FIND) . -name '*.[hcS]' -print | xargs etags -a\n@@ -1005,6 +1008,9 @@ endif\n install-doc:\n \t$(MAKE) -C Documentation install\n \n+install-info:\n+\t$(MAKE) -C Documentation install-info\n+\n quick-install-doc:\n \t$(MAKE) -C Documentation quick-install\n \n-- \n1.5.3.rc4.21.ga63eb\n"},{"id":"50116","messageId":"d8d1bd7bc54a3cd933598be0886a0fbe83e1775f.1186484406.git.dak@gnu.org","threadId":"9426","inReplyTo":"591c5679ea79b76cd5db57443b1d691bde842351.1186484406.git.dak@gnu.org","subject":"[install info (using perl) 2/2] INSTALL: explain info installation and dependencies.","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-07T10:02:12Z","receivedAt":"2007-08-07T10:02:12Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"\nSigned-off-by: David Kastrup <dak@gnu.org>\n---\n INSTALL |   14 +++++++++-----\n 1 files changed, 9 insertions(+), 5 deletions(-)\n\ndiff --git a/INSTALL b/INSTALL\nindex c62b12c..289b046 100644\n--- a/INSTALL\n+++ b/INSTALL\n@@ -5,8 +5,8 @@ Normally you can just do \"make\" followed by \"make install\", and that\n will install the git programs in your own ~/bin/ directory.  If you want\n to do a global install, you can do\n \n-\t$ make prefix=/usr all doc ;# as yourself\n-\t# make prefix=/usr install install-doc ;# as root\n+\t$ make prefix=/usr all doc info ;# as yourself\n+\t# make prefix=/usr install install-doc install-info ;# as root\n \n (or prefix=/usr/local, of course).  Just like any program suite\n that uses $prefix, the built results have some paths encoded,\n@@ -91,9 +91,13 @@ Issues of note:\n  - To build and install documentation suite, you need to have\n    the asciidoc/xmlto toolchain.  Because not many people are\n    inclined to install the tools, the default build target\n-   (\"make all\") does _not_ build them.  The documentation is\n-   written for AsciiDoc 7, but \"make ASCIIDOC8=YesPlease doc\"\n-   will let you format with AsciiDoc 8.\n+   (\"make all\") does _not_ build them.\n+\n+   Building and installing the info file additionally requires\n+   makeinfo and docbook2X.  Version 0.8.3 is known to work.\n+\n+   The documentation is written for AsciiDoc 7, but \"make\n+   ASCIIDOC8=YesPlease doc\" will let you format with AsciiDoc 8.\n \n    Alternatively, pre-formatted documentation are available in\n    \"html\" and \"man\" branches of the git repository itself.  For\n-- \n1.5.3.rc4.21.ga63eb\n"},{"id":"50262","messageId":"7vabt11vkj.fsf@assigned-by-dhcp.cox.net","threadId":"9426","inReplyTo":"591c5679ea79b76cd5db57443b1d691bde842351.1186484406.git.dak@gnu.org","subject":"Re: [install info (using perl) 1/2] Add support for an info version of the user manual","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-08T22:59:56Z","receivedAt":"2007-08-08T22:59:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"David Kastrup <dak@gnu.org> writes:\n\n> @@ -139,6 +154,18 @@ XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css\n>  user-manual.html: user-manual.xml\n>  \txsltproc $(XSLTOPTS) -o $@ $(XSLT) $<\n>  \n> +git.info: user-manual.xml\n> +\t$(RM) $@ $*.texi\n> +\t$(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | \\\n> +\tperl -ne 'if (/^\\@setfilename/) {$$_=\"\\@setfilename git.info\\\n> +\"} elsif (/^\\@direntry/) {print \"\\@dircategory Development\\\n> +\\@direntry\\\n> +* Git: (git).           A fast distributed revision control system\\\n> +\\@end direntry\\\n> +\"} print unless (/^\\@direntry/ .. /^\\@end direntry/)' > $*.texi\n> +\t$(MAKEINFO) --no-split $*.texi\n> +\t$(RM) $*.texi\n> +\n\nThis part worries me.\n\nHistorically (as you probably know, having suffered a lot more\nthan me with this issue), multi-line command script in Makefile\nwas hugely unportable.  Some \"make\" implementations stripped\nbackslash linefeed at the end, some other implementations\nstripped only backslash, yet some other kept both backslash and\nlinefeed.  It was a mess.\n\nAdmittably we are already quite dependent on GNU make, so this\nis probably not a huge deal, but I have a vague recollection\nthat even GNU make itself changed its behaviour over time with\nrespect to this exact area, and I had to adjust a few Makefiles\nto accomodate both old and new GNU make.\n\nThe standard workaround is of course to have this perl script\npart as a separate, \"Documentation/fixup-texi.perl\" script and\ninvoke it from the Makefile.\n"},{"id":"50263","messageId":"7v643p1vbr.fsf@assigned-by-dhcp.cox.net","threadId":"9426","inReplyTo":"7vabt11vkj.fsf@assigned-by-dhcp.cox.net","subject":"Re: [install info (using perl) 1/2] Add support for an info version of the user manual","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-08T23:05:12Z","receivedAt":"2007-08-08T23:05:12Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> David Kastrup <dak@gnu.org> writes:\n>\n>> @@ -139,6 +154,18 @@ XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css\n>>  user-manual.html: user-manual.xml\n>>  \txsltproc $(XSLTOPTS) -o $@ $(XSLT) $<\n>>  \n>> +git.info: user-manual.xml\n>> +\t$(RM) $@ $*.texi\n>> +\t$(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | \\\n>> +\tperl -ne 'if (/^\\@setfilename/) {$$_=\"\\@setfilename git.info\\\n>> +\"} elsif (/^\\@direntry/) {print \"\\@dircategory Development\\\n>> +\\@direntry\\\n>> +* Git: (git).           A fast distributed revision control system\\\n>> +\\@end direntry\\\n>> +\"} print unless (/^\\@direntry/ .. /^\\@end direntry/)' > $*.texi\n>> +\t$(MAKEINFO) --no-split $*.texi\n>> +\t$(RM) $*.texi\n>> +\n>\n> This part worries me.\n\nAside from possible portability issue of multi-line script,\nthere is another slight problem I am not sure if it is worth\nfixing.  If you do not have docbook2x-texi installed, nobody\nnotices that resulting $*.texi was a garbage and an almost empty\ngit.info is generated.\n"},{"id":"50265","messageId":"7v1wed1up3.fsf@assigned-by-dhcp.cox.net","threadId":"9426","inReplyTo":"7v643p1vbr.fsf@assigned-by-dhcp.cox.net","subject":"Re: [install info (using perl) 1/2] Add support for an info version of the user manual","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2007-08-08T23:18:48Z","receivedAt":"2007-08-08T23:18:48Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>> This part worries me.\n>\n> Aside from possible portability issue of multi-line script,\n> there is another slight problem I am not sure if it is worth\n> fixing.  If you do not have docbook2x-texi installed, nobody\n> notices that resulting $*.texi was a garbage and an almost empty\n> git.info is generated.\n\nHow about doing something like this instead?\n\n---\n\n Documentation/Makefile      |   13 ++++---------\n Documentation/fix-texi.perl |   15 +++++++++++++++\n 2 files changed, 19 insertions(+), 9 deletions(-)\n create mode 100755 Documentation/fix-texi.perl\n\ndiff --git a/Documentation/Makefile b/Documentation/Makefile\nindex 56d12aa..8c33729 100644\n--- a/Documentation/Makefile\n+++ b/Documentation/Makefile\n@@ -154,16 +154,11 @@ user-manual.html: user-manual.xml\n \txsltproc $(XSLTOPTS) -o $@ $(XSLT) $<\n \n git.info: user-manual.xml\n-\t$(RM) $@ $*.texi\n-\t$(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | \\\n-\tperl -ne 'if (/^\\@setfilename/) {$$_=\"\\@setfilename git.info\\\n-\"} elsif (/^\\@direntry/) {print \"\\@dircategory Development\\\n-\\@direntry\\\n-* Git: (git).           A fast distributed revision control system\\\n-\\@end direntry\\\n-\"} print unless (/^\\@direntry/ .. /^\\@end direntry/)' > $*.texi\n+\t$(RM) $@ $*.texi $*.texi+\n+\t$(DOCBOOK2X_TEXI) user-manual.xml --to-stdout >$*.texi+\n+\tperl fix-texi.perl <$*.texi+ >$*.texi\n \t$(MAKEINFO) --no-split $*.texi\n-\t$(RM) $*.texi\n+\t$(RM) $*.texi $*.texi+\n \n howto-index.txt: howto-index.sh $(wildcard howto/*.txt)\n \t$(RM) $@+ $@\ndiff --git a/Documentation/fix-texi.perl b/Documentation/fix-texi.perl\nnew file mode 100755\nindex 0000000..ff7d78f\n--- /dev/null\n+++ b/Documentation/fix-texi.perl\n@@ -0,0 +1,15 @@\n+#!/usr/bin/perl -w\n+\n+while (<>) {\n+\tif (/^\\@setfilename/) {\n+\t\t$_ = \"\\@setfilename git.info\\n\";\n+\t} elsif (/^\\@direntry/) {\n+\t\tprint '@dircategory Development\n+@direntry\n+* Git: (git).           A fast distributed revision control system\n+@end direntry\n+';\t}\n+\tunless (/^\\@direntry/../^\\@end direntry/) {\n+\t\tprint;\n+\t}\n+}\n"},{"id":"50267","messageId":"85k5s5pq0o.fsf@lola.goethe.zz","threadId":"9426","inReplyTo":"7vabt11vkj.fsf@assigned-by-dhcp.cox.net","subject":"Re: [install info (using perl) 1/2] Add support for an info version of the user manual","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-08T23:25:59Z","receivedAt":"2007-08-08T23:25:59Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> David Kastrup <dak@gnu.org> writes:\n>\n>> +git.info: user-manual.xml\n>> +\t$(RM) $@ $*.texi\n>> +\t$(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | \\\n>> +\tperl -ne 'if (/^\\@setfilename/) {$$_=\"\\@setfilename git.info\\\n>> +\"} elsif (/^\\@direntry/) {print \"\\@dircategory Development\\\n>> +\\@direntry\\\n>> +* Git: (git).           A fast distributed revision control system\\\n>> +\\@end direntry\\\n>> +\"} print unless (/^\\@direntry/ .. /^\\@end direntry/)' > $*.texi\n>> +\t$(MAKEINFO) --no-split $*.texi\n>> +\t$(RM) $*.texi\n>> +\n>\n> This part worries me.\n>\n> Historically (as you probably know, having suffered a lot more\n> than me with this issue), multi-line command script in Makefile\n> was hugely unportable.  Some \"make\" implementations stripped\n> backslash linefeed at the end, some other implementations\n> stripped only backslash, yet some other kept both backslash and\n> linefeed.  It was a mess.\n>\n> Admittably we are already quite dependent on GNU make,\n\nYes, definitely.  That's why I did it that way in the first place.  It\nis probably not inconceivable, however, that even then some\ncombination of make port and perl port to Windows would get into a\ntizzy.\n\n> so this is probably not a huge deal, but I have a vague recollection\n> that even GNU make itself changed its behaviour over time with\n> respect to this exact area, and I had to adjust a few Makefiles to\n> accomodate both old and new GNU make.\n\nI have to admit that I did not know in advance how this would work out\nand adapted the code to the behavior.\n\n> The standard workaround is of course to have this perl script\n> part as a separate, \"Documentation/fixup-texi.perl\" script and\n> invoke it from the Makefile.\n\nI can code this as a single overlong line reasonably easy.  And it is\nnot actually necessary to do the @setfilename replacement: one can\njust specify an override of the output file name.  That shortens the\nPerl script.  I'll have to see whether I can get rid of it completely,\nbut the documentation for docbook2X is really bad (and the author did\nnot respond to Email yet).  And googling on the net showed that I am\nnot the only one who fixed up after docbook2X manually.\n\nDon't expect a new patch in this area soon: I am messing with other\nstuff right now and it does not make sense reworking this again when I\nam not sure yet whether I can throw it out altogether.\n\n-- \nDavid Kastrup, Kriemhildstr. 15, 44793 Bochum\n"},{"id":"50268","messageId":"85fy2tppys.fsf@lola.goethe.zz","threadId":"9426","inReplyTo":"7v643p1vbr.fsf@assigned-by-dhcp.cox.net","subject":"Re: [install info (using perl) 1/2] Add support for an info version of the user manual","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-08T23:27:07Z","receivedAt":"2007-08-08T23:27:07Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n>> David Kastrup <dak@gnu.org> writes:\n>>\n>>> @@ -139,6 +154,18 @@ XSLTOPTS = --xinclude --stringparam html.stylesheet docbook-xsl.css\n>>>  user-manual.html: user-manual.xml\n>>>  \txsltproc $(XSLTOPTS) -o $@ $(XSLT) $<\n>>>  \n>>> +git.info: user-manual.xml\n>>> +\t$(RM) $@ $*.texi\n>>> +\t$(DOCBOOK2X_TEXI) user-manual.xml --to-stdout | \\\n>>> +\tperl -ne 'if (/^\\@setfilename/) {$$_=\"\\@setfilename git.info\\\n\n[...]\n\n> Aside from possible portability issue of multi-line script, there is\n> another slight problem I am not sure if it is worth fixing.  If you\n> do not have docbook2x-texi installed, nobody notices that resulting\n> $*.texi was a garbage and an almost empty git.info is generated.\n\nGood catch.\n\n-- \nDavid Kastrup, Kriemhildstr. 15, 44793 Bochum\n"},{"id":"50270","messageId":"85abt1pp2q.fsf@lola.goethe.zz","threadId":"9426","inReplyTo":"7v1wed1up3.fsf@assigned-by-dhcp.cox.net","subject":"Re: [install info (using perl) 1/2] Add support for an info version of the user manual","fromName":"David Kastrup","fromEmail":"dak@gnu.org","sentAt":"2007-08-08T23:46:21Z","receivedAt":"2007-08-08T23:46:21Z","isPatch":false,"sender":{"key":"dak@gnu.org","avatar":"https://avatars.githubusercontent.com/u/52141349?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n> Junio C Hamano <gitster@pobox.com> writes:\n>\n> How about doing something like this instead?\n>\n\n> ---\n>\n>  Documentation/Makefile      |   13 ++++---------\n>  Documentation/fix-texi.perl |   15 +++++++++++++++\n>  2 files changed, 19 insertions(+), 9 deletions(-)\n>  create mode 100755 Documentation/fix-texi.perl\n>\n> diff --git a/Documentation/Makefile b/Documentation/Makefile\n> index 56d12aa..8c33729 100644\n> --- a/Documentation/Makefile\n> +++ b/Documentation/Makefile\n\n> new file mode 100755\n> index 0000000..ff7d78f\n> --- /dev/null\n> +++ b/Documentation/fix-texi.perl\n\n[...]\n\nIt makes Perl look like a programming language instead of line noise.\nBut putting it into a file with .perl extension will make users\nrecognize it nevertheless.  So\n\nAcked-by: David Kastrup <dak@gnu.org>\n\nI can fold this patch in and repost (probably not too many people have\napplied the previous patches and would require a good fast forward\npath, so one would probably not need a 3-commit version built on top\nof the existing patches), or you may do so at your discretion.\n\nThanks, looks much nicer.  I still hope to rationalize Perl away\naltogether at some point of time, but...\n\n-- \nDavid Kastrup, Kriemhildstr. 15, 44793 Bochum\n"}]}