From 78b412a18538d82ccf9e7f6f65f321ca3e00de8f Mon Sep 17 00:00:00 2001 From: Baptiste Daroussin Date: Sat, 4 Apr 2015 16:09:45 +0200 Subject: [PATCH 1/2] Drop support got pkg_install --- src/share/poudriere/bulk.sh | 9 +-- src/share/poudriere/common.sh | 144 +++++++++++++++--------------------------- 2 files changed, 53 insertions(+), 100 deletions(-) diff --git a/src/share/poudriere/bulk.sh b/src/share/poudriere/bulk.sh index 3bdcaae..6a2cb89 100755 --- a/src/share/poudriere/bulk.sh +++ b/src/share/poudriere/bulk.sh @@ -266,19 +266,14 @@ _bget nbfailed stats_failed _bget nbskipped stats_skipped _bget nbignored stats_ignored # Always create repository if it is missing (but still respect -N) -if [ $PKGNG -eq 1 ] && \ - [ ! -f ${MASTERMNT}/packages/digests.txz -o \ +if [ ! -f ${MASTERMNT}/packages/digests.txz -o \ ! -f ${MASTERMNT}/packages/packagesite.txz ]; then [ $nbbuilt -eq 0 -a ${BUILD_REPO} -eq 1 ] && msg "No package built, but repository needs to be created" # This block mostly to avoid next # Package all newly built ports elif [ $nbbuilt -eq 0 ]; then - if [ $PKGNG -eq 1 ]; then - msg "No package built, no need to update the repository" - else - msg "No package built, no need to update INDEX" - fi + msg "No package built, no need to update the repository" BUILD_REPO=0 fi diff --git a/src/share/poudriere/common.sh b/src/share/poudriere/common.sh index f1ca765..a0a171e 100755 --- a/src/share/poudriere/common.sh +++ b/src/share/poudriere/common.sh @@ -1131,7 +1131,7 @@ enter_interactive() { echo "127.0.0.1 ${MASTERNAME}" >> ${MASTERMNT}/etc/hosts # Skip for testport as it has already installed pkg in the ref jail. - if [ ${PKGNG} -eq 1 -a "${SCRIPTPATH##*/}" != "testport.sh" ]; then + if [ "${SCRIPTPATH##*/}" != "testport.sh" ]; then # Install pkg-static so full pkg package can install ensure_pkg_installed force_extract || \ err 1 "Unable to extract pkg." @@ -1158,10 +1158,9 @@ enter_interactive() { done # Create a pkgng repo configuration, and disable FreeBSD - if [ ${PKGNG} -eq 1 ]; then - msg "Installing local Pkg repository to ${LOCALBASE}/etc/pkg/repos" - mkdir -p ${MASTERMNT}${LOCALBASE}/etc/pkg/repos - cat > ${MASTERMNT}${LOCALBASE}/etc/pkg/repos/local.conf << EOF + msg "Installing local Pkg repository to ${LOCALBASE}/etc/pkg/repos" + mkdir -p ${MASTERMNT}${LOCALBASE}/etc/pkg/repos + cat > ${MASTERMNT}${LOCALBASE}/etc/pkg/repos/local.conf << EOF FreeBSD: { enabled: no } @@ -1171,7 +1170,6 @@ local: { enabled: yes } EOF - fi if [ ${INTERACTIVE_MODE} -eq 1 ]; then msg "Entering interactive test mode. Type 'exit' when done." @@ -1629,25 +1627,15 @@ jail_start() { jstart # Only set STATUS=1 if not turned off # jail -s should not do this or jail will stop on EXIT - WITH_PKGNG=$(injail make -f /usr/ports/Mk/bsd.port.mk -V WITH_PKGNG) - if [ -n "${WITH_PKGNG}" ]; then - PKGNG=1 - PKG_EXT="txz" - PKG_BIN="/.p/pkg-static" - PKG_ADD="${PKG_BIN} add" - PKG_DELETE="${PKG_BIN} delete -y -f" - PKG_VERSION="${PKG_BIN} version" - - [ -n "${PKG_REPO_SIGNING_KEY}" ] && - ! [ -f "${PKG_REPO_SIGNING_KEY}" ] && - err 1 "PKG_REPO_SIGNING_KEY defined but the file is missing." - else - PKGNG=0 - PKG_ADD=pkg_add - PKG_DELETE=pkg_delete - PKG_VERSION=pkg_version - PKG_EXT="tbz" - fi + PKG_EXT="txz" + PKG_BIN="/.p/pkg-static" + PKG_ADD="${PKG_BIN} add" + PKG_DELETE="${PKG_BIN} delete -y -f" + PKG_VERSION="${PKG_BIN} version" + + [ -n "${PKG_REPO_SIGNING_KEY}" ] && + ! [ -f "${PKG_REPO_SIGNING_KEY}" ] && + err 1 "PKG_REPO_SIGNING_KEY defined but the file is missing." # 8.3 did not have distrib-dirs ran on it, so various # /usr and /var dirs are missing. Namely /var/games @@ -2100,8 +2088,7 @@ _real_build_port() { # Skip for all linux ports, they are not safe if [ "${PKGNAME%%*linux*}" != "" ]; then msg "Checking shared library dependencies" - listfilecmd="grep -v '^@' /var/db/pkg/${PKGNAME}/+CONTENTS" - [ ${PKGNG} -eq 1 ] && listfilecmd="${PKG_BIN} query '%Fp' ${PKGNAME}" + listfilecmd="${PKG_BIN} query '%Fp' ${PKGNAME}" injail ${listfilecmd} | \ injail xargs readelf -d 2>/dev/null | \ grep NEEDED | sort -u @@ -2131,8 +2118,7 @@ _real_build_port() { # testport-built packages from going into the main repo # Also enable during stage/install since it now # uses a pkg for pkg_tools - if [ "${phase}" = "package" ] || [ -z "${no_stage}" \ - -a "${phase}" = "install" -a $PKGNG -eq 0 ]; then + if [ "${phase}" = "package" ]; then pkgenv="${PKGENV}" else pkgenv= @@ -3128,7 +3114,6 @@ ensure_pkg_installed() { local mnt _my_path mnt - [ ${PKGNG} -eq 1 ] || return 0 [ -z "${force}" ] && [ -x "${mnt}${PKG_BIN}" ] && return 0 [ -e ${MASTERMNT}/packages/Latest/pkg.txz ] || return 1 #pkg missing injail tar xf /packages/Latest/pkg.txz -C / \ @@ -4146,15 +4131,6 @@ clean_restricted() { mount_packages injail make -s -C /usr/ports -j ${PARALLEL_JOBS} \ RM="/bin/rm -fv" ECHO_MSG="true" clean-restricted - # For pkg_install remove packages that have lost one of their dependency - if [ ${PKGNG} -eq 0 ]; then - msg_verbose "Checking packages for missing dependencies" - while :; do - sanity_check_pkgs && break - done - - delete_stale_symlinks_and_empty_dirs - fi # Remount ro umount -f ${MASTERMNT}/packages mount_packages -o ro @@ -4171,63 +4147,45 @@ sign_pkg() { build_repo() { local origin - if [ $PKGNG -eq 1 ]; then - msg "Creating pkgng repository" - bset status "pkgrepo:" - ensure_pkg_installed force_extract || \ - err 1 "Unable to extract pkg." - if [ -r "${PKG_REPO_META_FILE:-/nonexistent}" ]; then - PKG_META="-m /tmp/pkgmeta" - PKG_META_MASTERMNT="-m ${MASTERMNT}/tmp/pkgmeta" - install -m 0400 "${PKG_REPO_META_FILE}" \ - ${MASTERMNT}/tmp/pkgmeta - fi - mkdir -p ${MASTERMNT}/tmp/packages - if [ -n "${PKG_REPO_SIGNING_KEY}" ]; then - install -m 0400 ${PKG_REPO_SIGNING_KEY} \ - ${MASTERMNT}/tmp/repo.key - injail ${PKG_BIN} repo -o /tmp/packages \ - ${PKG_META} \ - /packages /tmp/repo.key - rm -f ${MASTERMNT}/tmp/repo.key - elif [ "${PKG_REPO_FROM_HOST:-no}" = "yes" ]; then - # Sometimes building repo from host is needed if - # using SSH with DNSSEC as older hosts don't support - # it. - ${MASTERMNT}${PKG_BIN} repo \ - -o ${MASTERMNT}/tmp/packages ${PKG_META_MASTERMNT} \ - ${MASTERMNT}/packages \ - ${SIGNING_COMMAND:+signing_command: ${SIGNING_COMMAND}} - else - JNETNAME="n" injail ${PKG_BIN} repo \ - -o /tmp/packages ${PKG_META} /packages \ - ${SIGNING_COMMAND:+signing_command: ${SIGNING_COMMAND}} - fi - cp ${MASTERMNT}/tmp/packages/* ${PACKAGES}/ - - # Sign the ports-mgmt/pkg package for bootstrap - if [ -n "${SIGNING_COMMAND}" ] && \ - [ -e "${PACKAGES}/Latest/pkg.txz" ]; then - sign_pkg "${PACKAGES}/Latest/pkg.txz" - fi + msg "Creating pkgng repository" + bset status "pkgrepo:" + ensure_pkg_installed force_extract || \ + err 1 "Unable to extract pkg." + if [ -r "${PKG_REPO_META_FILE:-/nonexistent}" ]; then + PKG_META="-m /tmp/pkgmeta" + PKG_META_MASTERMNT="-m ${MASTERMNT}/tmp/pkgmeta" + install -m 0400 "${PKG_REPO_META_FILE}" \ + ${MASTERMNT}/tmp/pkgmeta + fi + mkdir -p ${MASTERMNT}/tmp/packages + if [ -n "${PKG_REPO_SIGNING_KEY}" ]; then + install -m 0400 ${PKG_REPO_SIGNING_KEY} \ + ${MASTERMNT}/tmp/repo.key + injail ${PKG_BIN} repo -o /tmp/packages \ + ${PKG_META} \ + /packages /tmp/repo.key + rm -f ${MASTERMNT}/tmp/repo.key + elif [ "${PKG_REPO_FROM_HOST:-no}" = "yes" ]; then + # Sometimes building repo from host is needed if + # using SSH with DNSSEC as older hosts don't support + # it. + ${MASTERMNT}${PKG_BIN} repo \ + -o ${MASTERMNT}/tmp/packages ${PKG_META_MASTERMNT} \ + ${MASTERMNT}/packages \ + ${SIGNING_COMMAND:+signing_command: ${SIGNING_COMMAND}} else - msg "Preparing INDEX" - bset status "index:" - OSMAJ=`injail uname -r | awk -F. '{ print $1 }'` - INDEXF=${PACKAGES}/INDEX-${OSMAJ} - rm -f ${INDEXF}.1 2>/dev/null || : - injail env INDEX_JOBS=${PARALLEL_JOBS} INDEXDIR=/ make -C /usr/ports index - awk -F\| -v pkgdir=${PACKAGES} \ - '{ if (system( "[ -f ${PACKAGES}/All/"$1".tbz ] " ) == 0) { print $0 } }' \ - ${MASTERMNT}/INDEX-${OSMAJ} > ${INDEXF} - - [ -f ${INDEXF}.bz2 ] && rm ${INDEXF}.bz2 - msg_n "Compressing INDEX-${OSMAJ}..." - bzip2 -9 ${INDEXF} - echo " done" + JNETNAME="n" injail ${PKG_BIN} repo \ + -o /tmp/packages ${PKG_META} /packages \ + ${SIGNING_COMMAND:+signing_command: ${SIGNING_COMMAND}} fi -} + cp ${MASTERMNT}/tmp/packages/* ${PACKAGES}/ + # Sign the ports-mgmt/pkg package for bootstrap + if [ -n "${SIGNING_COMMAND}" ] && \ + [ -e "${PACKAGES}/Latest/pkg.txz" ]; then + sign_pkg "${PACKAGES}/Latest/pkg.txz" + fi +} RESOLV_CONF="" STATUS=0 # out of jail # -- 2.3.4