Skip to content

Commit 5a617ab

Browse files
author
Rich Persaud
committed
do_build.sh: regenerate local.conf for each build
local.conf contains version information that is embedded in the OpenXT installer. It must be generated for each build. Define filename as variable. OXT-1736 Signed-off-by: Rich Persaud <rich.persaud@baesystems.com>
1 parent e9c80eb commit 5a617ab

1 file changed

Lines changed: 16 additions & 12 deletions

File tree

do_build.sh

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,8 @@ BRANCH=master
4141
BUILD_UID=`id -u`
4242
export BUILD_UID
4343

44+
CONF_LOCAL="conf/local.conf"
45+
4446
# TODO: move some of the above definitions into common-config
4547

4648
if [ -f ${CMD_DIR}/common-config ]; then
@@ -100,16 +102,18 @@ do_oe_setup()
100102
mkdir -p conf
101103
fi
102104

103-
if [ ! -f "conf/local.conf" -o "conf/local.conf" -ot "conf/local.conf-dist" ]; then
104-
cp conf/local.conf-dist conf/local.conf
105+
# Force generation of local.conf with latest build version
106+
rm -f ${CONF_LOCAL}
107+
if [ ! -f "${CONF_LOCAL}" -o "${CONF_LOCAL}" -ot "${CONF_LOCAL}-dist" ]; then
108+
cp "${CONF_LOCAL}-dist" "${CONF_LOCAL}"
105109

106110
if [ ! -z "${OE_TARBALL_MIRROR}" ] ; then
107-
cat >> conf/local.conf <<EOF
111+
cat >> ${CONF_LOCAL} <<EOF
108112
# Tarball mirror
109113
PREMIRRORS = "(ftp|https?)$://.*/.*/ ${OE_TARBALL_MIRROR}"
110114
EOF
111115
fi
112-
cat >> conf/local.conf <<EOF
116+
cat >> ${CONF_LOCAL} <<EOF
113117
114118
# Distribution feed
115119
XENCLIENT_PACKAGE_FEED_URI="${NETBOOT_HTTP_URL}/${BRANCH}/${NAME}/packages/ipk"
@@ -131,12 +135,12 @@ OPENXT_TAG="$BRANCH"
131135
EOF
132136

133137
if [ "x$ID" != "x" ]; then
134-
echo "XENCLIENT_BUILD = \"$ID\"" >> conf/local.conf
138+
echo "XENCLIENT_BUILD = \"$ID\"" >> ${CONF_LOCAL}
135139
else
136-
echo "XENCLIENT_BUILD = \"$NAME\"" >> conf/local.conf
140+
echo "XENCLIENT_BUILD = \"$NAME\"" >> ${CONF_LOCAL}
137141
fi
138142

139-
cat >> conf/local.conf <<EOF
143+
cat >> ${CONF_LOCAL} <<EOF
140144
XENCLIENT_BUILD_DATE = "`date +'%T %D'`"
141145
XENCLIENT_BUILD_BRANCH = "${BRANCH}"
142146
XENCLIENT_VERSION = "$VERSION"
@@ -148,7 +152,7 @@ XCT_DEB_PKGS_DIR := "${OE_BUILD_CACHE}/xct_deb_packages"
148152
EOF
149153

150154
if [ -f ${CMD_DIR}/common-config ]; then
151-
cat >> conf/local.conf <<EOF
155+
cat >> ${CONF_LOCAL} <<EOF
152156
# xen version and source
153157
XEN_VERSION="${XEN_VERSION}"
154158
XEN_SRC_URI="${XEN_SRC_URI}"
@@ -158,7 +162,7 @@ XEN_SRC_SHA256SUM="${XEN_SRC_SHA256SUM}"
158162
EOF
159163
fi
160164

161-
cat >> conf/local.conf <<EOF
165+
cat >> ${CONF_LOCAL} <<EOF
162166
# Production and development repository-signing CA certificates
163167
REPO_PROD_CACERT="$REPO_PROD_CACERT_PATH"
164168
REPO_DEV_CACERT="$REPO_DEV_CACERT_PATH"
@@ -167,15 +171,15 @@ EOF
167171

168172
if [ $SOURCE -eq 1 ]
169173
then
170-
cat >> conf/local.conf <<EOF
174+
cat >> ${CONF_LOCAL} <<EOF
171175
172176
XENCLIENT_BUILD_SRC_PACKAGES = "1"
173177
XENCLIENT_COLLECT_SRC_INFO = "1"
174178
EOF
175179
fi
176180
if [ "x$FREEZE_URIS" = "xyes" ]
177181
then
178-
cat >> conf/local.conf <<EOF
182+
cat >> ${CONF_LOCAL} <<EOF
179183
180184
INHERIT += "freezer"
181185
EOF
@@ -185,7 +189,7 @@ EOF
185189
if [ $VERBOSE -eq 1 ]
186190
then
187191
echo "Generated config is:"
188-
cat conf/local.conf
192+
cat ${CONF_LOCAL}
189193
fi
190194

191195
if [ $VERBOSE -eq 1 ]

0 commit comments

Comments
 (0)