diff options
-rw-r--r-- | .gitignore | 1 | ||||
-rw-r--r-- | Makefile | 2 | ||||
-rw-r--r-- | general.ent | 29 | ||||
-rwxr-xr-x | git-version.sh | 30 |
4 files changed, 48 insertions, 14 deletions
diff --git a/.gitignore b/.gitignore index e5fb52276..0d2478625 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ lfs-bootscripts-*.tar.xz +conditional.ent version.ent appendices/*.script @@ -189,7 +189,7 @@ $(BASEDIR)/md5sums: stylesheets/wget-list.xsl chapter03/chapter03.xml \ $(BASEDIR)/md5sums version: - $(Q)./git-version.sh + $(Q)./git-version.sh $(REV) #dump-commands: validate # @echo "Dumping book commands..." diff --git a/general.ent b/general.ent index 836043835..4d609a82b 100644 --- a/general.ent +++ b/general.ent @@ -1,28 +1,39 @@ +<!-- Automatically generated by git-version.sh --> +<!ENTITY % conditional-entities SYSTEM "conditional.ent"> +%conditional-entities; + <!-- version info automatically generated by git - comment the following two lines for release --> + comment out the following two lines for release --> <!ENTITY % version-entities SYSTEM "version.ent"> %version-entities; <!-- uncomment and edit the following four lines for releases (including -rc) --> <!-- +<![ %sysv; [ <!ENTITY version "10.2-rc1"> -<!ENTITY versiond "10.2-systemd-rc1"> +]]> +<![ %systemd; [ +<!ENTITY version "10.2-systemd-rc1"> +]]> <!ENTITY releasedate "August 26th, 2021"> <!ENTITY copyrightdate "1999-2021"> --> -<!ENTITY short-version "svn"> <!-- Used below in &blfs-book; +<![ %sysv; [ +<!ENTITY short-version "svn"> <!-- Used below in &blfs-book; Change to x.y for release but not -rc releases --> <!ENTITY generic-version "development"> <!-- Use "development" or "x.y[-pre{x}]" --> - -<!ENTITY short-versiond "systemd"> <!--Change to stable-systemd for release --> -<!ENTITY generic-versiond "systemd"> +]]> +<![ %systemd; [ +<!ENTITY short-version "systemd"> <!--Change to stable-systemd for release --> +<!ENTITY generic-version "systemd"> +]]> <!ENTITY lfs-root "https://www.linuxfromscratch.org/"> <!ENTITY blfs-root "&lfs-root;blfs/"> <!ENTITY blfs-book "&blfs-root;view/&short-version;/"> -<!ENTITY blfs-systemd-book "&blfs-root;view/&short-versiond;/"> +<!ENTITY blfs-book "&blfs-root;view/&short-version;/"> <!ENTITY faq-root "&lfs-root;faq/"> <!ENTITY hints-root "&lfs-root;hints/downloads/files/"> <!ENTITY hints-index "&lfs-root;hints/list.html"> @@ -33,12 +44,12 @@ <!ENTITY errata "&lfs-root;lfs/errata/&generic-version;/"> <!ENTITY secadv "&lfs-root;lfs/advisories/"> <!ENTITY min-kernel "3.2"> - +<!-- <!ENTITY patches-rootd "&lfs-root;patches/lfs/&generic-versiond;/"> <!ENTITY downloads-rootd "&lfs-root;lfs/downloads/&generic-versiond;/"> <!ENTITY test-resultsd "&lfs-root;lfs/build-logs/&generic-versiond;/"> <!ENTITY erratad "&lfs-root;lfs/errata/&generic-versiond;/"> - +--> <!ENTITY lfs-ticket-root "https://wiki.linuxfromscratch.org/lfs/ticket/"> <!ENTITY anduin-sources "https://anduin.linuxfromscratch.org/LFS"> diff --git a/git-version.sh b/git-version.sh index ff0eb6cdd..8f5cdb33b 100755 --- a/git-version.sh +++ b/git-version.sh @@ -1,10 +1,28 @@ #!/bin/sh +if [ "$1" = sysv ]; then + SYSV="INCLUDE" + SYSTEMD="IGNORE " +elif [ "$1" = systemd ]; then + SYSV="IGNORE " + SYSTEMD="INCLUDE" +else + echo You must provide either \"sysv\" or \"systemd\" as argument + exit 1 +fi + +echo "<!ENTITY % sysv \"$SYSV\">" > conditional.ent +echo "<!ENTITY % systemd \"$SYSTEMD\">" >> conditional.ent + if ! git status > /dev/null; then # Either it's not a git repository, or git is unavaliable. # Just workaround. - echo "<!ENTITY version \"unknown\">" > version.ent - echo "<!ENTITY versiond \"unknown-systemd\">" >> version.ent + echo "<![ %sysv; [" > version.ent + echo "<!ENTITY version \"unknown\">" >> version.ent + echo "]]>" >> version.ent + echo "<![ %systemd; [" >> version.ent + echo "<!ENTITY version \"unknown-systemd\">" >> version.ent + echo "]]>" >> version.ent echo "<!ENTITY releasedate \"unknown\">" >> version.ent echo "<!ENTITY copyrightdate \"1999-2021\">" >> version.ent exit 0 @@ -41,7 +59,11 @@ if [ "$(git diff HEAD | wc -l)" != "0" ]; then versiond="$versiond+" fi -echo "<!ENTITY version \"$version\">" > version.ent -echo "<!ENTITY versiond \"$versiond\">" >> version.ent +echo "<![ %sysv; [" > version.ent +echo "<!ENTITY version \"$version\">" >> version.ent +echo "]]>" >> version.ent +echo "<![ %systemd; [" >> version.ent +echo "<!ENTITY version \"$versiond\">" >> version.ent +echo "]]>" >> version.ent echo "<!ENTITY releasedate \"$full_date\">" >> version.ent echo "<!ENTITY copyrightdate \"1999-$year\">" >> version.ent |