mirror of
git://git.gnupg.org/gnupg.git
synced 2024-12-22 10:19:57 +01:00
gpgconf: Print the full commit id.
* autogen.sh: Update to version 2024-07-04 from libgpg-error. * configure.ac (BUILD_REVISION): Rename the ac_define by BUILD_COMMITID. * tools/gpgconf.c (show_version_gnupg): Use it here. -- (cherry picked from commit 736579331b14035db5b857812d18b493678f7769)
This commit is contained in:
parent
ce73691bd3
commit
cf21e473a5
109
autogen.sh
109
autogen.sh
@ -1,6 +1,6 @@
|
|||||||
#! /bin/sh
|
#! /bin/sh
|
||||||
# autogen.sh
|
# autogen.sh
|
||||||
# Copyright (C) 2003, 2014, 2017, 2018 g10 Code GmbH
|
# Copyright (C) 2003, 2014, 2017, 2018, 2022 g10 Code GmbH
|
||||||
#
|
#
|
||||||
# This file is free software; as a special exception the author gives
|
# This file is free software; as a special exception the author gives
|
||||||
# unlimited permission to copy and/or distribute it, with or without
|
# unlimited permission to copy and/or distribute it, with or without
|
||||||
@ -15,7 +15,7 @@
|
|||||||
# configure it for the respective package. It is maintained as part of
|
# configure it for the respective package. It is maintained as part of
|
||||||
# GnuPG and source copied by other packages.
|
# GnuPG and source copied by other packages.
|
||||||
#
|
#
|
||||||
# Version: 2018-02-21
|
# Version: 2024-07-04
|
||||||
|
|
||||||
configure_ac="configure.ac"
|
configure_ac="configure.ac"
|
||||||
|
|
||||||
@ -74,7 +74,6 @@ PRINT_HOST=no
|
|||||||
PRINT_BUILD=no
|
PRINT_BUILD=no
|
||||||
tmp=$(dirname "$0")
|
tmp=$(dirname "$0")
|
||||||
tsdir=$(cd "${tmp}"; pwd)
|
tsdir=$(cd "${tmp}"; pwd)
|
||||||
version_parts=3
|
|
||||||
|
|
||||||
if [ -n "${AUTOGEN_SH_SILENT}" ]; then
|
if [ -n "${AUTOGEN_SH_SILENT}" ]; then
|
||||||
SILENT=" --silent"
|
SILENT=" --silent"
|
||||||
@ -85,9 +84,10 @@ if test x"$1" = x"--help"; then
|
|||||||
echo " --silent Silent operation"
|
echo " --silent Silent operation"
|
||||||
echo " --force Pass --force to autoconf"
|
echo " --force Pass --force to autoconf"
|
||||||
echo " --find-version Helper for configure.ac"
|
echo " --find-version Helper for configure.ac"
|
||||||
echo " --build-TYPE Configure to cross build for TYPE"
|
echo " --git-build Run all commands to build from a Git"
|
||||||
echo " --print-host Print only the host triplet"
|
echo " --print-host Print only the host triplet"
|
||||||
echo " --print-build Print only the build platform triplet"
|
echo " --print-build Print only the build platform triplet"
|
||||||
|
echo " --build-TYPE Configure to cross build for TYPE"
|
||||||
echo ""
|
echo ""
|
||||||
echo " ARGS are passed to configure in --build-TYPE mode."
|
echo " ARGS are passed to configure in --build-TYPE mode."
|
||||||
echo " Configuration for this script is expected in autogen.rc"
|
echo " Configuration for this script is expected in autogen.rc"
|
||||||
@ -137,16 +137,14 @@ extraoptions=
|
|||||||
# List of optional variables sourced from autogen.rc and ~/.gnupg-autogen.rc
|
# List of optional variables sourced from autogen.rc and ~/.gnupg-autogen.rc
|
||||||
w32_toolprefixes=
|
w32_toolprefixes=
|
||||||
w32_extraoptions=
|
w32_extraoptions=
|
||||||
w32ce_toolprefixes=
|
|
||||||
w32ce_extraoptions=
|
|
||||||
w64_toolprefixes=
|
w64_toolprefixes=
|
||||||
w64_extraoptions=
|
w64_extraoptions=
|
||||||
amd64_toolprefixes=
|
amd64_toolprefixes=
|
||||||
|
disable_gettext_checks=
|
||||||
# End list of optional variables sourced from ~/.gnupg-autogen.rc
|
# End list of optional variables sourced from ~/.gnupg-autogen.rc
|
||||||
# What follows are variables which are sourced but default to
|
# What follows are variables which are sourced but default to
|
||||||
# environment variables or lacking them hardcoded values.
|
# environment variables or lacking them hardcoded values.
|
||||||
#w32root=
|
#w32root=
|
||||||
#w32ce_root=
|
|
||||||
#w64root=
|
#w64root=
|
||||||
#amd64root=
|
#amd64root=
|
||||||
|
|
||||||
@ -159,13 +157,12 @@ case "$1" in
|
|||||||
SILENT=" --silent"
|
SILENT=" --silent"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--build-w32)
|
--git-build)
|
||||||
myhost="w32"
|
myhost="git-build"
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--build-w32ce)
|
--build-w32)
|
||||||
myhost="w32"
|
myhost="w32"
|
||||||
myhostsub="ce"
|
|
||||||
shift
|
shift
|
||||||
;;
|
;;
|
||||||
--build-w64)
|
--build-w64)
|
||||||
@ -187,6 +184,25 @@ esac
|
|||||||
die_p
|
die_p
|
||||||
|
|
||||||
|
|
||||||
|
# **** GIT BUILD ****
|
||||||
|
# This is a helper to build from git.
|
||||||
|
if [ "$myhost" = "git-build" ]; then
|
||||||
|
tmp="$(pwd)"
|
||||||
|
cd "$tsdir" || fatal "error cd-ing to $tsdir"
|
||||||
|
./autogen.sh || fatal "error running ./autogen.sh"
|
||||||
|
cd "$tmp" || fatal "error cd-ing back to $tmp"
|
||||||
|
die_p
|
||||||
|
"$tsdir"/configure || fatal "error running $tsdir/configure"
|
||||||
|
die_p
|
||||||
|
make || fatal "error running make"
|
||||||
|
die_p
|
||||||
|
make check || fatal "error running make check"
|
||||||
|
die_p
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
# **** end GIT BUILD ****
|
||||||
|
|
||||||
|
|
||||||
# Source our configuration
|
# Source our configuration
|
||||||
if [ -f "${tsdir}/autogen.rc" ]; then
|
if [ -f "${tsdir}/autogen.rc" ]; then
|
||||||
. "${tsdir}/autogen.rc"
|
. "${tsdir}/autogen.rc"
|
||||||
@ -215,43 +231,53 @@ if [ "$myhost" = "find-version" ]; then
|
|||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
case "$version_parts" in
|
if [ -z "$micro" ]; then
|
||||||
2)
|
matchstr1="$package-$major.[0-9]*"
|
||||||
matchstr1="$package-$major.[0-9]*"
|
matchstr2="$package-$major-base"
|
||||||
matchstr2="$package-$major-base"
|
matchstr3=""
|
||||||
vers="$major.$minor"
|
vers="$major.$minor"
|
||||||
;;
|
else
|
||||||
*)
|
matchstr1="$package-$major.$minor.[0-9]*"
|
||||||
matchstr1="$package-$major.$minor.[0-9]*"
|
matchstr2="$package-$major.[0-9]*-base"
|
||||||
matchstr2="$package-$major.$minor-base"
|
matchstr3="$package-$major-base"
|
||||||
vers="$major.$minor.$micro"
|
vers="$major.$minor.$micro"
|
||||||
;;
|
fi
|
||||||
esac
|
|
||||||
|
|
||||||
beta=no
|
beta=no
|
||||||
if [ -e .git ]; then
|
if [ -e .git ]; then
|
||||||
ingit=yes
|
ingit=yes
|
||||||
tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null)
|
tmp=$(git describe --match "${matchstr1}" --long 2>/dev/null)
|
||||||
tmp=$(echo "$tmp" | sed s/^"$package"//)
|
|
||||||
if [ -n "$tmp" ]; then
|
if [ -n "$tmp" ]; then
|
||||||
tmp=$(echo "$tmp" | sed s/^"$package"// \
|
tmp=$(echo "$tmp" | sed s/^"$package"// \
|
||||||
| awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}')
|
| awk -F- '$3!=0 && $3 !~ /^beta/ {print"-beta"$3}')
|
||||||
else
|
else
|
||||||
tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null \
|
# (due tof "-base" in the tag we need to take the 4th field)
|
||||||
| awk -F- '$4!=0{print"-beta"$4}')
|
tmp=$(git describe --match "${matchstr2}" --long 2>/dev/null)
|
||||||
|
if [ -n "$tmp" ]; then
|
||||||
|
tmp=$(echo "$tmp" | sed s/^"$package"// \
|
||||||
|
| awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}')
|
||||||
|
elif [ -n "${matchstr3}" ]; then
|
||||||
|
tmp=$(git describe --match "${matchstr3}" --long 2>/dev/null)
|
||||||
|
if [ -n "$tmp" ]; then
|
||||||
|
tmp=$(echo "$tmp" | sed s/^"$package"// \
|
||||||
|
| awk -F- '$4!=0 && $4 !~ /^beta/ {print"-beta"$4}')
|
||||||
|
fi
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
[ -n "$tmp" ] && beta=yes
|
[ -n "$tmp" ] && beta=yes
|
||||||
|
cid=$(git rev-parse --verify HEAD | tr -d '\n\r')
|
||||||
rev=$(git rev-parse --short HEAD | tr -d '\n\r')
|
rev=$(git rev-parse --short HEAD | tr -d '\n\r')
|
||||||
rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
|
rvd=$((0x$(echo ${rev} | dd bs=1 count=4 2>/dev/null)))
|
||||||
else
|
else
|
||||||
ingit=no
|
ingit=no
|
||||||
beta=yes
|
beta=yes
|
||||||
tmp="-unknown"
|
tmp="-unknown"
|
||||||
|
cid="0000000"
|
||||||
rev="0000000"
|
rev="0000000"
|
||||||
rvd="0"
|
rvd="0"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$package-$vers$tmp:$beta:$ingit:$vers$tmp:$vers:$tmp:$rev:$rvd:"
|
echo "$package-$vers$tmp:$beta:$ingit:$vers$tmp:$vers:$tmp:$rev:$rvd:$cid:"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
# **** end FIND VERSION ****
|
# **** end FIND VERSION ****
|
||||||
@ -274,12 +300,6 @@ fi
|
|||||||
# ******************
|
# ******************
|
||||||
if [ "$myhost" = "w32" ]; then
|
if [ "$myhost" = "w32" ]; then
|
||||||
case $myhostsub in
|
case $myhostsub in
|
||||||
ce)
|
|
||||||
w32root="$w32ce_root"
|
|
||||||
[ -z "$w32root" ] && w32root="$HOME/w32ce_root"
|
|
||||||
toolprefixes="$w32ce_toolprefixes arm-mingw32ce"
|
|
||||||
extraoptions="$extraoptions $w32ce_extraoptions"
|
|
||||||
;;
|
|
||||||
64)
|
64)
|
||||||
w32root="$w64root"
|
w32root="$w64root"
|
||||||
[ -z "$w32root" ] && w32root="$HOME/w64root"
|
[ -z "$w32root" ] && w32root="$HOME/w64root"
|
||||||
@ -393,17 +413,16 @@ q
|
|||||||
}' ${configure_ac}`
|
}' ${configure_ac}`
|
||||||
automake_vers_num=`echo "$automake_vers" | cvtver`
|
automake_vers_num=`echo "$automake_vers" | cvtver`
|
||||||
|
|
||||||
|
gettext_vers="n/a"
|
||||||
if [ -d "${tsdir}/po" ]; then
|
if [ -d "${tsdir}/po" ]; then
|
||||||
gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ {
|
gettext_vers=`sed -n '/^AM_GNU_GETTEXT_VERSION(/ {
|
||||||
s/^.*\[\(.*\)])/\1/p
|
s/^.*\[\(.*\)])/\1/p
|
||||||
q
|
q
|
||||||
}' ${configure_ac}`
|
}' ${configure_ac}`
|
||||||
gettext_vers_num=`echo "$gettext_vers" | cvtver`
|
gettext_vers_num=`echo "$gettext_vers" | cvtver`
|
||||||
else
|
|
||||||
gettext_vers="n/a"
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -z "$autoconf_vers" -o -z "$automake_vers" -o -z "$gettext_vers" ]
|
if [ -z "$autoconf_vers" -o -z "$automake_vers" ]
|
||||||
then
|
then
|
||||||
echo "**Error**: version information not found in "\`${configure_ac}\'"." >&2
|
echo "**Error**: version information not found in "\`${configure_ac}\'"." >&2
|
||||||
exit 1
|
exit 1
|
||||||
@ -469,6 +488,7 @@ EOF
|
|||||||
chmod +x .git/hooks/commit-msg
|
chmod +x .git/hooks/commit-msg
|
||||||
if [ x"${display_name}" != x ]; then
|
if [ x"${display_name}" != x ]; then
|
||||||
git config format.subjectPrefix "PATCH ${display_name}"
|
git config format.subjectPrefix "PATCH ${display_name}"
|
||||||
|
git config sendemail.to "${patches_to}"
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
@ -480,12 +500,21 @@ fi
|
|||||||
if [ -n "${ACLOCAL_FLAGS}" ]; then
|
if [ -n "${ACLOCAL_FLAGS}" ]; then
|
||||||
aclocal_flags="${aclocal_flags} ${ACLOCAL_FLAGS}"
|
aclocal_flags="${aclocal_flags} ${ACLOCAL_FLAGS}"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
automake_flags="--gnu"
|
||||||
|
if [ -n "${extra_automake_flags}" ]; then
|
||||||
|
automake_flags="${automake_flags} ${extra_automake_flags}"
|
||||||
|
fi
|
||||||
|
if [ -n "${AUTOMAKE_FLAGS}" ]; then
|
||||||
|
automake_flags="${automake_flags} ${AUTOMAKE_FLAGS}"
|
||||||
|
fi
|
||||||
|
|
||||||
info "Running $ACLOCAL ${aclocal_flags} ..."
|
info "Running $ACLOCAL ${aclocal_flags} ..."
|
||||||
$ACLOCAL ${aclocal_flags}
|
$ACLOCAL ${aclocal_flags}
|
||||||
info "Running autoheader..."
|
info "Running autoheader..."
|
||||||
$AUTOHEADER
|
$AUTOHEADER
|
||||||
info "Running automake --gnu ..."
|
info "Running $AUTOMAKE ${automake_flags} ..."
|
||||||
$AUTOMAKE --gnu;
|
$AUTOMAKE ${automake_flags};
|
||||||
info "Running autoconf${FORCE} ..."
|
info "Running autoconf${FORCE} ..."
|
||||||
$AUTOCONF${FORCE}
|
$AUTOCONF${FORCE}
|
||||||
|
|
||||||
|
@ -47,7 +47,9 @@ m4_define([mym4_isbeta], m4_argn(2, mym4_verslist))
|
|||||||
m4_define([mym4_version], m4_argn(4, mym4_verslist))
|
m4_define([mym4_version], m4_argn(4, mym4_verslist))
|
||||||
m4_define([mym4_revision], m4_argn(7, mym4_verslist))
|
m4_define([mym4_revision], m4_argn(7, mym4_verslist))
|
||||||
m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
|
m4_define([mym4_revision_dec], m4_argn(8, mym4_verslist))
|
||||||
|
m4_define([mym4_commitid], m4_argn(9, mym4_verslist))
|
||||||
m4_esyscmd([echo ]mym4_version[>VERSION])
|
m4_esyscmd([echo ]mym4_version[>VERSION])
|
||||||
|
m4_esyscmd([echo ]mym4_commitid[>>VERSION])
|
||||||
AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org])
|
AC_INIT([mym4_package],[mym4_version],[https://bugs.gnupg.org])
|
||||||
|
|
||||||
# When changing the SWDB tag please also adjust the hard coded tags in
|
# When changing the SWDB tag please also adjust the hard coded tags in
|
||||||
@ -1843,9 +1845,10 @@ fi
|
|||||||
# Provide information about the build.
|
# Provide information about the build.
|
||||||
#
|
#
|
||||||
BUILD_REVISION="mym4_revision"
|
BUILD_REVISION="mym4_revision"
|
||||||
|
BUILD_COMMITID="mym4_commitid"
|
||||||
AC_SUBST(BUILD_REVISION)
|
AC_SUBST(BUILD_REVISION)
|
||||||
AC_DEFINE_UNQUOTED(BUILD_REVISION, "$BUILD_REVISION",
|
AC_DEFINE_UNQUOTED(BUILD_COMMITID, "$BUILD_COMMITID",
|
||||||
[GIT commit id revision used to build this package])
|
[Git commit id used to build this package])
|
||||||
|
|
||||||
changequote(,)dnl
|
changequote(,)dnl
|
||||||
BUILD_VERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./'`
|
BUILD_VERSION=`echo "$VERSION" | sed 's/\([0-9.]*\).*/\1./'`
|
||||||
|
@ -1082,7 +1082,7 @@ show_version_gnupg (estream_t fp, const char *prefix)
|
|||||||
ssize_t length;
|
ssize_t length;
|
||||||
|
|
||||||
es_fprintf (fp, "%s%sGnuPG %s (%s)\n%s%s\n", prefix, *prefix?"":"* ",
|
es_fprintf (fp, "%s%sGnuPG %s (%s)\n%s%s\n", prefix, *prefix?"":"* ",
|
||||||
strusage (13), BUILD_REVISION, prefix, strusage (17));
|
strusage (13), BUILD_COMMITID, prefix, strusage (17));
|
||||||
|
|
||||||
/* Show the GnuPG VS-Desktop version in --show-configs mode */
|
/* Show the GnuPG VS-Desktop version in --show-configs mode */
|
||||||
if (prefix && *prefix)
|
if (prefix && *prefix)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user