Changeset bd90b9b for git-version.sh


Ignore:
Timestamp:
09/01/2021 09:08:49 AM (3 years ago)
Author:
Pierre Labastie <pierre.labastie@…>
Branches:
11.1, 11.1-rc1, 11.2, 11.2-rc1, 11.3, 11.3-rc1, 12.0, 12.0-rc1, 12.1, 12.1-rc1, arm, bdubbs/gcc13, multilib, renodr/libudev-from-systemd, s6-init, trunk, xry111/arm64, xry111/arm64-12.0, xry111/clfs-ng, xry111/lfs-next, xry111/loongarch, xry111/loongarch-12.0, xry111/loongarch-12.1, xry111/mips64el, xry111/pip3, xry111/rust-wip-20221008, xry111/update-glibc
Children:
615f5b8
Parents:
3443abb
Message:

Add a conditional entity for sysv/systemd

This removes the need for versiond, and other xxxd entities. Those
entities will be removed in the next commits.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • git-version.sh

    r3443abb rbd90b9b  
    11#!/bin/sh
     2
     3if [ "$1" = sysv ]; then
     4        SYSV="INCLUDE"
     5        SYSTEMD="IGNORE "
     6elif [ "$1" = systemd ]; then
     7        SYSV="IGNORE "
     8        SYSTEMD="INCLUDE"
     9else
     10        echo You must provide either \"sysv\" or \"systemd\" as argument
     11        exit 1
     12fi
     13
     14echo "<!ENTITY % sysv    \"$SYSV\">"     >  conditional.ent
     15echo "<!ENTITY % systemd \"$SYSTEMD\">"  >> conditional.ent
    216
    317if ! git status > /dev/null; then
    418        # Either it's not a git repository, or git is unavaliable.
    519        # Just workaround.
    6         echo "<!ENTITY version           \"unknown\">"         >  version.ent
    7         echo "<!ENTITY versiond          \"unknown-systemd\">" >> version.ent
     20        echo "<![ %sysv; ["                                    >  version.ent
     21        echo "<!ENTITY version           \"unknown\">"         >> version.ent
     22        echo "]]>"                                             >> version.ent
     23        echo "<![ %systemd; ["                                 >> version.ent
     24        echo "<!ENTITY version           \"unknown-systemd\">" >> version.ent
     25        echo "]]>"                                             >> version.ent
    826        echo "<!ENTITY releasedate       \"unknown\">"         >> version.ent
    927        echo "<!ENTITY copyrightdate     \"1999-2021\">"       >> version.ent
     
    4260fi
    4361
    44 echo "<!ENTITY version           \"$version\">"            >  version.ent
    45 echo "<!ENTITY versiond          \"$versiond\">"           >> version.ent
     62echo "<![ %sysv; ["                                        >  version.ent
     63echo "<!ENTITY version           \"$version\">"            >> version.ent
     64echo "]]>"                                                 >> version.ent
     65echo "<![ %systemd; ["                                     >> version.ent
     66echo "<!ENTITY version          \"$versiond\">"            >> version.ent
     67echo "]]>"                                                 >> version.ent
    4668echo "<!ENTITY releasedate       \"$full_date\">"          >> version.ent
    4769echo "<!ENTITY copyrightdate     \"1999-$year\">"          >> version.ent
Note: See TracChangeset for help on using the changeset viewer.