Browse Source

build/test: repair os-* globbing

We can't install both types of plugins, so when SUFFIX= we need to
exclude "-devel".  Not the prettiest approach, but should do it in
99% of cases.
pull/57/head
Franco Fichtner 3 years ago
parent
commit
837c52fa54
6 changed files with 18 additions and 11 deletions
  1. +2
    -2
      build/clean.sh
  2. +11
    -4
      build/common.sh
  3. +1
    -1
      build/ports.sh
  4. +2
    -2
      build/release.sh
  5. +1
    -1
      build/test.sh
  6. +1
    -1
      build/verify.sh

+ 2
- 2
build/clean.sh View File

@ -42,7 +42,7 @@ for ARG in ${@}; do
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
extract_packages ${STAGEDIR}
remove_packages ${STAGEDIR} ${PRODUCT_PKGNAMES}
remove_packages ${STAGEDIR} ${PRODUCT_CORES}
bundle_packages ${STAGEDIR} ${SELF} core
;;
distfiles)
@ -88,7 +88,7 @@ for ARG in ${@}; do
setup_stage ${STAGEDIR}
setup_base ${STAGEDIR}
extract_packages ${STAGEDIR}
remove_packages ${STAGEDIR} "os-*"
remove_packages ${STAGEDIR} ${PRODUCT_PLUGINS}
bundle_packages ${STAGEDIR} ${SELF} plugins
;;
release)

+ 11
- 4
build/common.sh View File

@ -216,8 +216,10 @@ export PRODUCT_PUBKEY=${PRODUCT_PUBKEY:-"${CONFIGDIR}/repo.pub"}
export PRODUCT_SIGNCMD=${PRODUCT_SIGNCMD:-"${TOOLSDIR}/scripts/pkg_sign.sh ${PRODUCT_PUBKEY} ${PRODUCT_PRIVKEY}"}
export PRODUCT_SIGNCHK=${PRODUCT_SIGNCHK:-"${TOOLSDIR}/scripts/pkg_fingerprint.sh ${PRODUCT_PUBKEY}"}
export PRODUCT_RELEASE="${PRODUCT_NAME}-${PRODUCT_VERSION}-${PRODUCT_FLAVOUR}"
export PRODUCT_PKGNAMES="${PRODUCT_TYPE} ${PRODUCT_TYPE}-devel"
export PRODUCT_PKGNAME="${PRODUCT_TYPE}${PRODUCT_SUFFIX}"
export PRODUCT_CORES="${PRODUCT_TYPE} ${PRODUCT_TYPE}-devel"
export PRODUCT_CORE="${PRODUCT_TYPE}${PRODUCT_SUFFIX}"
export PRODUCT_PLUGINS="os-*"
export PRODUCT_PLUGIN="os-*${PRODUCT_SUFFIX}"
if [ "${SELF}" != print -a "${SELF}" != info ]; then
if [ -z "${PRINT_ENV_SKIP}" ]; then
@ -599,10 +601,15 @@ install_packages()
# Adds all selected packages and fails if one cannot
# be installed. Used to build a runtime environment.
for PKG in pkg ${PKGLIST}; do
PKGGLOB=$(echo "${PKG}" | sed 's/[^*]*//')
PKGSEARCH="-name ${PKG}-[0-9]*.txz"
PKGFOUND=
if [ -n "${PKGGLOB}" -a -z "${PRODUCT_SUFFIX}" ]; then
PKGSEARCH="${PKGSEARCH} ! -name ${PKG}-devel-[0-9]*.txz"
fi
for PKGFILE in $({
cd ${BASEDIR}
find .${PACKAGESDIR}/All -name "${PKG}-[0-9]*.txz"
find .${PACKAGESDIR}/All ${PKGSEARCH}
}); do
pkg -c ${BASEDIR} add ${PKGFILE}
PKGFOUND=1
@ -716,7 +723,7 @@ clean_packages()
setup_packages()
{
extract_packages ${1}
install_packages ${@} ${PRODUCT_PKGNAME} ${PRODUCT_ADDITIONS}
install_packages ${@} ${PRODUCT_CORE} ${PRODUCT_ADDITIONS}
clean_packages ${1}
}

+ 1
- 1
build/ports.sh View File

@ -72,7 +72,7 @@ setup_chroot ${STAGEDIR}
setup_distfiles ${STAGEDIR}
extract_packages ${STAGEDIR}
remove_packages ${STAGEDIR} ${@} ${PRODUCT_PKGNAMES} "os-*"
remove_packages ${STAGEDIR} ${@} ${PRODUCT_CORES} ${PRODUCT_PLUGINS}
for PKG in $(cd ${STAGEDIR}; find .${PACKAGESDIR}/All -type f); do
# all packages that install have their dependencies fulfilled

+ 2
- 2
build/release.sh View File

@ -43,9 +43,9 @@ RELEASE_SET="${SETSDIR}/release-${PRODUCT_VERSION}-${PRODUCT_FLAVOUR}-${PRODUCT_
# make sure the all-encompassing package is a release, too
setup_stage ${STAGEDIR}
extract_packages ${STAGEDIR}
if [ ! -f ${STAGEDIR}${PACKAGESDIR}/All/${PRODUCT_PKGNAME}-${PRODUCT_VERSION}.txz ]; then
if [ ! -f ${STAGEDIR}${PACKAGESDIR}/All/${PRODUCT_CORE}-${PRODUCT_VERSION}.txz ]; then
echo "Release package version mismatch:" \
"$(basename ${STAGEDIR}${PACKAGESDIR}/All/${PRODUCT_PKGNAME}-[0-9]*.txz)"
"$(basename ${STAGEDIR}${PACKAGESDIR}/All/${PRODUCT_CORE}-[0-9]*.txz)"
exit 1
fi

+ 1
- 1
build/test.sh View File

@ -41,7 +41,7 @@ setup_clone ${STAGEDIR} ${PLUGINSDIR}
setup_chroot ${STAGEDIR}
extract_packages ${STAGEDIR}
install_packages ${STAGEDIR} "os-*${PRODUCT_SUFFIX}" ${PRODUCT_PKGNAME}
install_packages ${STAGEDIR} ${PRODUCT_CORE} ${PRODUCT_PLUGIN}
echo ">>> Running packages test suite..."
chroot ${STAGEDIR} /bin/sh -es <<EOF

+ 1
- 1
build/verify.sh View File

@ -36,7 +36,7 @@ setup_base ${STAGEDIR}
setup_chroot ${STAGEDIR}
extract_packages ${STAGEDIR}
install_packages ${STAGEDIR} ${PRODUCT_PKGNAME}
install_packages ${STAGEDIR} ${PRODUCT_CORE}
mkdir -p ${STAGEDIR}${SETSDIR}
cp ${SETSDIR}/* ${STAGEDIR}${SETSDIR}

Loading…
Cancel
Save