2009-02-10 20:54:16 +03:00
#!/bin/sh
# Script to fill the packaging templates with the version
# information that is created by mkversion in advance.
#
# This is a standalone wrapper for update-pkginfo, which
2009-03-09 18:16:20 +03:00
# is usually called from release-scripts/create-tarball.
2009-02-10 20:54:16 +03:00
# This allows for testing some aspects of packaging without
# the need to go through all of create-tarball.
#
# Copyright (C) Michael Adam 2009
#
# License: GPL
DIRNAME=$(dirname $0)
2009-02-12 00:24:52 +03:00
TOPDIR=${DIRNAME}/../..
2009-02-11 01:10:23 +03:00
SRCDIR=${TOPDIR}/source3
2009-02-10 20:54:16 +03:00
VERSION_H=${SRCDIR}/include/version.h
2022-02-21 15:53:56 +03:00
pushd ${SRCDIR} >/dev/null 2>&1
2009-02-10 20:54:16 +03:00
./script/mkversion.sh
2022-02-21 15:53:56 +03:00
popd >/dev/null 2>&1
2009-02-10 20:54:16 +03:00
2022-02-21 15:53:56 +03:00
if [ ! -f ${VERSION_H} ]; then
2009-02-10 20:54:16 +03:00
echo "Error creating version.h"
exit 1
fi
2022-02-21 15:53:56 +03:00
VERSION=$(grep "define SAMBA_VERSION_OFFICIAL_STRING" ${VERSION_H} | awk '{print $3}')
2009-02-10 20:54:16 +03:00
2022-02-21 15:53:56 +03:00
vendor_version=$(grep "define SAMBA_VERSION_VENDOR_SUFFIX" ${VERSION_H} | awk '{print $3}')
if test "x${vendor_version}" != "x"; then
2009-02-10 20:54:16 +03:00
VERSION="${VERSION}-${vendor_version}"
fi
2022-02-21 15:53:56 +03:00
vendor_patch=$(grep "define SAMBA_VERSION_VENDOR_PATCH" ${VERSION_H} | awk '{print $3}')
if test "x${vendor_patch}" != "x"; then
2009-02-10 20:54:16 +03:00
VERSION="${VERSION}-${vendor_patch}"
fi
2022-02-21 15:53:56 +03:00
VERSION=$(echo ${VERSION} | sed 's/\"//g')
2009-02-10 20:54:16 +03:00
echo "VERSION: ${VERSION}"
2022-02-21 15:53:56 +03:00
pushd ${TOPDIR}/packaging >/dev/null 2>&1
2009-02-12 00:25:41 +03:00
./bin/update-pkginfo "${VERSION}" 1 ""
2022-02-21 15:53:56 +03:00
popd >/dev/null 2>&1