618d465295
- Shell scripts: == is specific to bash and ksh. Use = instead. - Shell scripts: use sh instead of bash if bash functionnality is not used - Shell scripts: ${var/search/replace} is specific to bash - sed: The -i option is specific to GNU sed. - Makefiles: $< outside of generic rules only work in GNU make. - xdrproc_t() is not universally defined as variadic. Do not specify third argument if it is not used - NetBSD FUSE specific: only include <perfuse.h> in FUSE client code, it harms in other locations - configure: Search for gettext() in libintl as NetBSD stores it there - Like MacOS X, NetBSD has unmount(2) and not umount(2) (un vs u) Some other build issues previously included in this change were removed: - __THROW macro, addressed in http://review.gluster.com/#/c/7757/ - getmntent() compat shared with MacOS X, in http://review.gluster.com/#/c/7722/ This patchset adds warning fixes for mount_glusterfs BUG: 764655 Change-Id: I2f1faf8ff96362d3e2baf237b943df619011f1f4 Signed-off-by: Emmanuel Dreyfus <manu@netbsd.org> Reviewed-on: http://review.gluster.org/7783 Tested-by: Gluster Build System <jenkins@build.gluster.com> Reviewed-by: Harshavardhana <harsha@harshavardhana.net>
53 lines
1.4 KiB
Bash
Executable File
53 lines
1.4 KiB
Bash
Executable File
#!/bin/sh
|
|
|
|
# To override version/release from git,
|
|
# create VERSION file containing text with version/release
|
|
# eg. v3.4.0-1
|
|
PKG_VERSION=`cat VERSION 2> /dev/null || git describe --tags --match "v[0-9]*"`
|
|
|
|
get_version()
|
|
{
|
|
# tags and output versions:
|
|
# - v3.4.0 => 3.4.0 (upstream clean)
|
|
# - v3.4.0-1 => 3.4.0 (downstream clean)
|
|
# - v3.4.0-2-g34e62f => 3.4.0 (upstream dirty)
|
|
# - v3.4.0-1-2-g34e62f => 3.4.0 (downstream dirty)
|
|
AWK_VERSION='
|
|
BEGIN { FS="-" }
|
|
/^v[0-9]/ {
|
|
sub(/^v/,"") ; print $1
|
|
}'
|
|
|
|
echo $PKG_VERSION | awk "$AWK_VERSION" | tr -cd '[:alnum:].'
|
|
}
|
|
|
|
get_release()
|
|
{
|
|
# tags and output releases:
|
|
# - v3.4.0 => 0 (upstream clean)
|
|
# - v3.4.0-1 => 1 (downstream clean)
|
|
# - v3.4.0-2-g34e62f1 => 2.git34e62f1 (upstream dirty)
|
|
# - v3.4.0-1-2-g34e62f1 => 1.2.git34e62f1 (downstream dirty)
|
|
AWK_RELEASE='
|
|
BEGIN { FS="-"; OFS="." }
|
|
/^v[0-9]/ {
|
|
if (NF == 1) print 0
|
|
else if (NF == 2) print $2
|
|
else if (NF == 3) print $2, "git" substr($3, 2)
|
|
else if (NF == 4) print $2, $3, "git" substr($4, 2)
|
|
}'
|
|
|
|
echo $PKG_VERSION | awk "$AWK_RELEASE" | tr -cd '[:alnum:].'
|
|
}
|
|
|
|
if test "x$1" = "x--full"; then
|
|
echo -n "v$(get_version)-$(get_release)"
|
|
elif test "x$1" = "x--version"; then
|
|
get_version
|
|
elif test "x$1" = "x--release"; then
|
|
get_release
|
|
else
|
|
echo "usage: $0 [--full|--version|--release]"
|
|
exit 1
|
|
fi
|