mirror of
https://github.com/json-c/json-c.git
synced 2026-11-05 21:20:16 +08:00
Instead of hardcoding the version into amiga/json-c.readme, generate it on the fly from either a release tag or a development version + commit hash.
This commit is contained in:
1 parent
19980dbafd
commit
25895a587e
2 files changed
+12
-2
No files matched your search
@@ -2,7 +2,7 @@ Short: JSON parser and generator library (static libs + headers)
|
|||||||
Author: Michael Clark, Eric Hawicz et al.
|
Author: Michael Clark, Eric Hawicz et al.
|
||||||
Uploader: Cameron Armstrong (Nightfox) <cameronscottarmstrong@gmail.com>
|
Uploader: Cameron Armstrong (Nightfox) <cameronscottarmstrong@gmail.com>
|
||||||
Type: dev/lib
|
Type: dev/lib
|
||||||
Version: 0.19
|
Version: VERSION
|
||||||
Architecture: m68k-amigaos >= 2.0; ppc-amigaos; ppc-morphos
|
Architecture: m68k-amigaos >= 2.0; ppc-amigaos; ppc-morphos
|
||||||
Requires: an Amiga gcc compiler
|
Requires: an Amiga gcc compiler
|
||||||
Replaces: dev/lib/json-c.lha
|
Replaces: dev/lib/json-c.lha
|
||||||
+11
-1
@@ -33,7 +33,17 @@ rm -rf "$_lha_probe"
|
|||||||
# script's SDK layout ($SDK/<target>) is the same shape we want per OS, so each
|
# script's SDK layout ($SDK/<target>) is the same shape we want per OS, so each
|
||||||
# OS gets staged under its own directory.
|
# OS gets staged under its own directory.
|
||||||
rm -rf "$DIST"; mkdir -p "$STAGE/json-c"
|
rm -rf "$DIST"; mkdir -p "$STAGE/json-c"
|
||||||
cp "$AMIGA_DIR/json-c.readme" "$STAGE/json-c/json-c.readme"
|
|
||||||
|
# Extract the version from either a release tag, or the dev version + abbreviated commit hash
|
||||||
|
GIT_DESCR=$(git describe --tags --always)
|
||||||
|
if [[ "$GIT_DESCR" == json-c-* ]] ; then
|
||||||
|
# e.g. 0.19-20260627
|
||||||
|
JSON_C_VERS=${GIT_DESCR#json-c-}
|
||||||
|
else
|
||||||
|
# e.g. 0.19.99-09e45f6
|
||||||
|
JSON_C_VERS=$(sed -ne'/define JSON_C_VERSION / { s/"$//; s/.*"//; p }' "${ROOT}/json_c_version.h")-${GIT_DESCR}
|
||||||
|
fi
|
||||||
|
sed -e"s/VERSION/${JSON_C_VERS}/" "$AMIGA_DIR/json-c.readme.template" > "$STAGE/json-c/json-c.readme"
|
||||||
|
|
||||||
built=()
|
built=()
|
||||||
for os in "${OSES[@]}"; do
|
for os in "${OSES[@]}"; do
|
||||||
|
|||||||
Reference in new issue
Block a user