s3:packaging: fix path to calling update-pkginfo after pushd in fill-templates
[Samba/gbeck.git] / packaging / bin / fill-templates
blobaf8bb327872fa89c9216265ddc3cbdbf597e876c
1 #!/bin/sh
3 # Script to fill the packaging templates with the version
4 # information that is created by mkversion in advance.
6 # This is a standalone wrapper for update-pkginfo, which
7 # is ususally called from release-scripts/create-tarball.
8 # This allows for testing some aspects of packaging without
9 # the need to go through all of create-tarball.
11 # Copyright (C) Michael Adam 2009
13 # License: GPL
15 DIRNAME=$(dirname $0)
16 TOPDIR=${DIRNAME}/../..
17 SRCDIR=${TOPDIR}/source
18 VERSION_H=${SRCDIR}/include/version.h
20 pushd ${SRCDIR} > /dev/null 2>&1
21 ./script/mkversion.sh
22 popd > /dev/null 2>&1
24 if [ ! -f ${VERSION_H} ] ; then
25 echo "Error creating version.h"
26 exit 1
29 VERSION=`grep SAMBA_VERSION_OFFICIAL_STRING ${VERSION_H} | awk '{print $3}'`
31 vendor_version=`grep SAMBA_VERSION_VENDOR_SUFFIX ${VERSION_H} | awk '{print $3}'`
32 if test "x${vendor_version}" != "x" ; then
33 VERSION="${VERSION}-${vendor_version}"
36 vendor_patch=`grep SAMBA_VERSION_VENDOR_PATCH ${VERSION_H} | awk '{print $3}'`
37 if test "x${vendor_patch}" != "x" ; then
38 VERSION="${VERSION}-${vendor_patch}"
41 VERSION=`echo ${VERSION} | sed 's/\"//g'`
43 echo "VERSION: ${VERSION}"
45 pushd ${TOPDIR}/packaging > /dev/null 2>&1
46 ./bin/update-pkginfo "${VERSION}" 1 ""
47 popd > /dev/null 2>&1