build: add a hint for how to fix branch mismatch temporarily

This isn't a good sign in general, but point users into the right
direction on how to proceed.  The error should be enough to make
them awae of something is wrong with the setup.
This commit is contained in:
Franco Fichtner 2017-01-11 07:31:06 +01:00
parent b29017ef6b
commit c474187c8b
9 changed files with 24 additions and 18 deletions

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014-2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -38,7 +38,7 @@ if [ -f "${BASE_SET}" -a -z "${1}" ]; then
exit 0
fi
git_branch ${SRCDIR} ${SRCBRANCH}
git_branch ${SRCDIR} ${SRCBRANCH} SRCBRANCH
git_describe ${SRCDIR}
BASE_SET=${SETSDIR}/base-${REPO_VERSION}-${PRODUCT_ARCH}

View File

@ -281,9 +281,15 @@ git_describe()
git_branch()
{
# only check for consistency
if [ -n "${2}" -a "${2}" != \
"$(git -C ${1} rev-parse --abbrev-ref HEAD)" ]; then
if [ -z "${2}" ]; then
return
fi
BRANCH=$(git -C ${1} rev-parse --abbrev-ref HEAD)
if [ "${2}" != "${BRANCH}" ]; then
echo ">>> ${1} does not match expected branch: ${2}"
echo ">>> To continue anyway set ${3}=${BRANCH}"
exit 1
fi
}

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2015-2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2015-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -41,8 +41,8 @@ cat ${CONFIGDIR}/skim.conf ${CONFIGDIR}/ports.conf | \
done
)
git_branch ${SRCDIR} ${SRCBRANCH}
git_branch ${PORTSDIR} ${PORTSBRANCH}
git_branch ${SRCDIR} ${SRCBRANCH} SRCBRANCH
git_branch ${PORTSDIR} ${PORTSBRANCH} PORTSBRANCH
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2014-2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2014-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -38,7 +38,7 @@ if [ -f "${KERNEL_SET}" -a -z "${1}" ]; then
exit 0
fi
git_branch ${SRCDIR} ${SRCBRANCH}
git_branch ${SRCDIR} ${SRCBRANCH} SRCBRANCH
git_describe ${SRCDIR}
KERNEL_SET=${SETSDIR}/kernel-${REPO_VERSION}-${PRODUCT_ARCH}

View File

@ -52,7 +52,7 @@ done
check_packages ${SELF} ${@}
git_branch ${PLUGINSDIR} ${PLUGINSBRANCH}
git_branch ${PLUGINSDIR} ${PLUGINSBRANCH} PLUGINSBRANCH
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}

View File

@ -52,8 +52,8 @@ done
check_packages ${SELF} ${@}
git_branch ${SRCDIR} ${SRCBRANCH}
git_branch ${PORTSDIR} ${PORTSBRANCH}
git_branch ${SRCDIR} ${SRCBRANCH} SRCBRANCH
git_branch ${PORTSDIR} ${PORTSBRANCH} PORTSBRANCH
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2015-2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2015-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -45,7 +45,7 @@ cat ${CONFIGDIR}/skim.conf ${CONFIGDIR}/ports.conf | \
done
)
git_branch ${PORTSDIR} ${PORTSBRANCH}
git_branch ${PORTSDIR} ${PORTSBRANCH} PORTSBRANCH
git_update ${PORTSREFDIR} origin/master
git_checkout ${PORTSDIR} HEAD

View File

@ -31,8 +31,8 @@ SELF=test
. ./common.sh && $(${SCRUB_ARGS})
git_branch ${COREDIR} ${COREBRANCH}
git_branch ${PLUGINSDIR} ${PLUGINSBRANCH}
git_branch ${COREDIR} ${COREBRANCH} COREBRANCH
git_branch ${PLUGINSDIR} ${PLUGINSBRANCH} PLUGINSBRANCH
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}

View File

@ -1,6 +1,6 @@
#!/bin/sh
# Copyright (c) 2016 Franco Fichtner <franco@opnsense.org>
# Copyright (c) 2016-2017 Franco Fichtner <franco@opnsense.org>
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions
@ -43,7 +43,7 @@ if [ -f "${XTOOLS_SET}" -a -z "${1}" ]; then
exit 0
fi
git_branch ${SRCDIR} ${SRCBRANCH}
git_branch ${SRCDIR} ${SRCBRANCH} SRCBRANCH
git_describe ${SRCDIR}
XTOOLS_SET=${SETSDIR}/xtools-${REPO_VERSION}-${PRODUCT_ARCH}.txz