Skip to content

Commit

Permalink
Use git to extract default build-info (when enabled) (#1892)
Browse files Browse the repository at this point in the history
Have configure option --enable-build-info[=yes]
refer to git instead of bazaar to extract
information about what is being built to include
in the output of `squid -v`
  • Loading branch information
kinkie authored and squid-anubis committed Aug 23, 2024
1 parent 64b6288 commit c4e6ac9
Showing 1 changed file with 9 additions and 13 deletions.
22 changes: 9 additions & 13 deletions acinclude/squid-util.m4
Original file line number Diff line number Diff line change
Expand Up @@ -287,22 +287,18 @@ AC_DEFUN([SQUID_EMBED_BUILD_INFO],[
AS_CASE(["$enableval"],
[no],[:],
[yes],[
AS_IF([test -d "${srcdir}/.bzr"],[
AC_PATH_PROG(BZR,bzr,$FALSE)
squid_bzr_branch_nick=`cd ${srcdir} && ${BZR} nick 2>/dev/null`
AS_IF([test $? -eq 0 -a "x$squid_bzr_branch_nick" != "x"],[
squid_bzr_branch_revno=`cd ${srcdir} && ${BZR} revno 2>/dev/null | sed 's/\"//g'`
])
AS_IF([test $? -eq 0 -a "x$squid_bzr_branch_revno" != "x"],[
sh -c "cd ${srcdir} && ${BZR} diff 2>&1 >/dev/null"
AS_IF([test $? -eq 1],[
squid_bzr_branch_revno="$squid_bzr_branch_revno+changes"
AC_PATH_PROG(GIT,git,$FALSE)
AS_IF([test "x$GIT" != "x$FALSE"],[
squid_git_branch="`cd ${srcdir} && ${GIT} branch --show-current 2>/dev/null`"
squid_git_revno="`cd ${srcdir} && ${GIT} rev-parse --short HEAD 2>/dev/null`"
AS_IF([test "x$squid_git_branch" != "x"], [:], [squid_git_branch="unknown"])
AS_IF([test "x$squid_git_revno" != "x"],[
AS_IF([cd ${srcdir} && ! ${GIT} diff --quiet HEAD],[ # there are uncommitted changes
squid_git_revno="$squid_git_revno plus changes"
])
])
AS_IF([test "x$squid_bzr_branch_revno" != "x"],[
squid_build_info="Built branch: ${squid_bzr_branch_nick}-r${squid_bzr_branch_revno}"
])
])
squid_build_info="Git branch: ${squid_git_branch:-unavailable} revision ${squid_git_revno:-unavailable}"
],
[squid_build_info=$enableval]
)
Expand Down

0 comments on commit c4e6ac9

Please sign in to comment.