diff options
Diffstat (limited to 'ports-mgmt')
-rw-r--r-- | ports-mgmt/pkg_jail/Makefile | 11 | ||||
-rw-r--r-- | ports-mgmt/pkg_jail/files/README.txt (renamed from ports-mgmt/pkg_jail/files/README) | 0 | ||||
-rw-r--r-- | ports-mgmt/pkg_jail/files/pkg_jail | 34 | ||||
-rw-r--r-- | ports-mgmt/pkg_jail/files/pkg_update | 157 | ||||
-rw-r--r-- | ports-mgmt/pkg_jail/pkg-descr | 2 |
5 files changed, 132 insertions, 72 deletions
diff --git a/ports-mgmt/pkg_jail/Makefile b/ports-mgmt/pkg_jail/Makefile index 7041dbc982d9..e505efd62efe 100644 --- a/ports-mgmt/pkg_jail/Makefile +++ b/ports-mgmt/pkg_jail/Makefile @@ -1,7 +1,7 @@ # $FreeBSD$ PORTNAME= pkg_jail -PORTVERSION= 1.89 +PORTVERSION= 1.92 CATEGORIES= ports-mgmt MASTER_SITES= # empty DISTFILES= # empty @@ -9,15 +9,14 @@ DISTFILES= # empty MAINTAINER= dinoex@FreeBSD.org COMMENT= Manage your own package jail -LICENSE= BSD3CLAUSE NONE -LICENSE_COMB= multi +LICENSE= BSD3CLAUSE NO_BUILD= yes NO_ARCH= yes PLIST_FILES= bin/pkg_jail bin/pkg_update \ man/man1/pkg_jail.1.gz man/man1/pkg_update.1.gz -PORTDOCS= README +PORTDOCS= README.txt LMAN1= pkg_jail.1 pkg_update.1 OPTIONS_DEFINE= DOCS @@ -31,11 +30,11 @@ do-install: do-install-DOCS-on: ${MKDIR} ${STAGEDIR}${DOCSDIR} - ${INSTALL_DATA} ${FILESDIR}/README ${STAGEDIR}${DOCSDIR}/ + ${INSTALL_DATA} ${FILESDIR}/README.txt ${STAGEDIR}${DOCSDIR}/ install-ports: -${MKDIR} ${PORTSDIR}/local/update/data - ${LN} -s ${FILESDIR}/README ${PORTSDIR}/local/update/ + ${LN} -s ${FILESDIR}/README.txt ${PORTSDIR}/local/update/ ${LN} -s ${FILESDIR}/pkg_update ${PORTSDIR}/local/update/ ${LN} -s ${FILESDIR}/pkg_jail ${PORTSDIR}/local/update/ diff --git a/ports-mgmt/pkg_jail/files/README b/ports-mgmt/pkg_jail/files/README.txt index eb7992705587..eb7992705587 100644 --- a/ports-mgmt/pkg_jail/files/README +++ b/ports-mgmt/pkg_jail/files/README.txt diff --git a/ports-mgmt/pkg_jail/files/pkg_jail b/ports-mgmt/pkg_jail/files/pkg_jail index 0baba764d9a7..94d07abe0e47 100644 --- a/ports-mgmt/pkg_jail/files/pkg_jail +++ b/ports-mgmt/pkg_jail/files/pkg_jail @@ -2,6 +2,36 @@ # # $FreeBSD$ # +# Copyright (c) 2001-2017 by Dirk Meyer. All rights reserved. +# Im Grund 4, 34317 Habichtswald, Germany +# Email: dirk.meyer@dinoex.sub.org +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions +# are met: +# 1. Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# 2. Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# 3. Neither the name of the author nor the names of any co-contributors +# may be used to endorse or promote products derived from this software +# without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND +# ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +# IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +# ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE +# FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +# DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS +# OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) +# HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT +# LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +# SUCH DAMAGE. +# +# ------------------------------------------------------------------------- +# . /etc/rc.subr # case "$0" in @@ -200,12 +230,12 @@ pkg_jail_umount() "${pkg_jail_dir}/dev" \ do - fstab=`fgrep "${dir}" /etc/fstab` + fstab=`fgrep "${dir}" /etc/fstab` if test -n "${fstab}" then continue fi - mount=`mount | fgrep "${dir}"` + mount=`mount | fgrep "${dir}"` if test -n "${mount}" then umount "${dir}" diff --git a/ports-mgmt/pkg_jail/files/pkg_update b/ports-mgmt/pkg_jail/files/pkg_update index ec357a076958..b2c491cbb550 100644 --- a/ports-mgmt/pkg_jail/files/pkg_update +++ b/ports-mgmt/pkg_jail/files/pkg_update @@ -1,11 +1,10 @@ #!/bin/sh -# $Id: pkg_update,v 1.89 2016/03/19 10:56:41 cvs Exp $ +# $Id: pkg_update,v 1.92 2017/07/29 05:50:19 cvs Exp $ # $FreeBSD$ # -# Copyright (c) 2001-2006 -# by Dirk Meyer, All rights reserved. -# Im Grund 4, 34317 Habichtswald, Germany -# Email: dirk.meyer@dinoex.sub.org +# Copyright (c) 2001-2017 by Dirk Meyer. All rights reserved. +# Im Grund 4, 34317 Habichtswald, Germany +# Email: dirk.meyer@dinoex.sub.org # # Redistribution and use in source and binary forms, with or without # modification, are permitted provided that the following conditions @@ -353,6 +352,42 @@ run_pkg_info_requiredby() { fi } +dependency_is_good() { + if test ! -d "${fulldir}" + then + echo "Directory not found: ${fulldir}" + echo "Directory not found: ${fulldir}" >> ${tmpupdated} + return 1 + fi + dir="${fulldir##${portsdir}/}" + dir="${dir##${localdir}/}" + if test "${dir}" = "" + then + echo "Directory bad: ${fulldir}" + echo "Directory bad: ${fulldir}" >> ${tmpupdated} + return 1 + fi + pkgname=`cd ${fulldir} && make -V PKGNAME` + if run_pkg_installed + then + return 2 + fi + pkgfile=`cd ${fulldir} && make -V PKGFILE` + if test -e ${pkgfile} + then + return 0 + fi + noinstall=`cd "${fulldir}" && make -V NO_INSTALL` + case "${noinstall}" in + yes|YES) + return 2 + ;; + esac + echo "# missing package: ${pkgname} from ${dir}" + echo "# missing package: ${pkgname} from ${dir}" >> ${tmpupdated} + return 3 +} + # check dependencies and decides if a ports needs to be rebuild # Usage: port_uptodate show # Usage: port_uptodate make @@ -383,25 +418,19 @@ port_uptodate() { mainpkg="${pkgname}" for="" found="" - lastpkgfile="" + mainpkgfile="" rm -f "${tmpupdated}" "${tmpfailed}" - while test "${found}" = "" - do - if run_pkg_installed - then - found="1" - break - fi + if run_pkg_installed + then + found="1" + else if test -e ${pkgfile} then echo "pkg_add ${pkgfile}" - lastpkgfile="${pkgfile}" + mainpkgfile="${pkgfile}" found="1" - break fi - # - break - done + fi ;; *) echo "port_uptodate: bad arguments" >&2 @@ -425,21 +454,15 @@ port_uptodate() { ) | sed -f "${depends}"` do - dir="${fulldir##${portsdir}/}" - dir="${dir##${localdir}/}" - if test "${dir}" = "" - then - continue - fi - log=`echo "${dir}" | sed -e 's=/=,=g'` - pkgname=`cd ${fulldir} && make -V PKGNAME` - if run_pkg_installed - then - continue - fi - pkgfile=`cd ${fulldir} && make -V PKGFILE` - if test -e ${pkgfile} - then + dir="" + pkgname="" + pkgfile="" + dependency_is_good "$1" + err="${?}" + case "${err}" in + 0) # exist + echo "dependency_is_good" + log=`echo "${dir}" | sed -e 's=/=,=g'` case "$1" in xshow*) if test ! -f "${logdir}/show,${log}" @@ -463,12 +486,12 @@ port_uptodate() { ;; esac - if test "${lastpkgfile}" != "" + if test "${mainpkgfile}" != "" then - if test "${pkgfile}" -nt "${lastpkgfile}" + if test "${pkgfile}" -nt "${mainpkgfile}" then - echo "# dependend package newer: ${pkgfile} ${lastpkgfile}" - echo "# dependend package newer: ${pkgfile} ${lastpkgfile}" >> ${tmpupdated} + echo "# dependend package newer: ${pkgfile} ${mainpkgfile}" + echo "# dependend package newer: ${pkgfile} ${mainpkgfile}" >> ${tmpupdated} fi fi echo "#existing package: ${pkgname} from ${dir}${for}" @@ -487,28 +510,30 @@ port_uptodate() { ;; esac continue - fi - noinstall=`cd "${fulldir}" && make -V NO_INSTALL` - case "${noinstall}" in - yes|YES) - continue ;; - esac - echo "# missing package: ${pkgname} from ${dir}" - echo "# missing package: ${pkgname} from ${dir}" >> ${tmpupdated} - case "$1" in - make*) - echo "cd ${fulldir} && port_uptodate $1+" - ( cd ${fulldir} && port_uptodate $1+ ) - if run_pkg_installed - then - continue - fi - echo "=== package ${pkgname} error dependency" >&2 - echo "=== package ${pkgname} error dependency" >> ${tmpfailed} - echo "=== package ${pkgname} error dependency" >> ${logdir}/err,${log} + 1) # abort break ;; + 2) # installed + continue + ;; + 3) # missing + log=`echo "${dir}" | sed -e 's=/=,=g'` + case "$1" in + make*) + echo "cd ${fulldir} && port_uptodate $1+" + ( cd ${fulldir} && port_uptodate $1+ ) + if run_pkg_installed + then + continue + fi + echo "=== package ${pkgname} error dependency" >&2 + echo "=== package ${pkgname} error dependency" >> ${tmpfailed} + echo "=== package ${pkgname} error dependency" >> ${logdir}/err,${log} + break + ;; + esac + ;; esac done pkgname="${mainpkg}" @@ -557,6 +582,7 @@ port_uptodate() { then mv -f "${logdir}/build,${log}" "${logdir}/last,${log}" fi + ( cd ${base} && env ${pkg_env} make stage-qa check-orphans check-sanity </dev/null >> "${logdir}/err,${log}" 2>&1 ) mv -f "${logdir}/err,${log}" "${logdir}/build,${log}" ( cd ${base} && env ${pkg_env} make clean NOCLEANDEPENDS=yes ) if run_pkg_installed @@ -1431,10 +1457,10 @@ dependency_update() { echo "${find} is required by ${neu} (not installed)" if test -f "${edit}.bak" then - grep -v "^${neu}$" "${edit}.bak" > "${edit}.neu" + grep -v "^${neu}$" "${edit}.bak" > "${edit}.neu" mv -f "${edit}.neu" "${edit}.bak" else - grep -v "^${neu}$" "${edit}" > "${edit}.bak" + grep -v "^${neu}$" "${edit}" > "${edit}.bak" fi fi done @@ -1526,7 +1552,7 @@ fix_moved_ports() { # # check recursive for deinstall delete_dependent_package() { - local installed + local installed installed="${1}" run_pkg_info_requiredby "${installed}" | while read requiredby @@ -1846,7 +1872,7 @@ easy_required_package() { touch "${inrequired}/${pkgname}" if test ! -d "${pkg_dbdir}/${pkgname}" then - echo "# missing dependency ${pkgname}" + echo "# missing dependency ${pkgname}" touch "${failed}/${pkgname}" set_fail_count up fi @@ -2439,7 +2465,7 @@ show-missing-reinstall) continue fi pkgname=`cd "${portsdir}/${movedto}" && make -V PKGNAME` - if test -d "${pkg_dbdir}/${pkgname}" + if test -d "${pkg_dbdir}/${pkgname}" then echo "new ${pkgname} installed" continue @@ -2489,7 +2515,7 @@ clean-reinstall) continue fi pkgname=`cd "${portsdir}/${movedto}" && make -V PKGNAME` - if test -d "${pkg_dbdir}/${pkgname}" + if test -d "${pkg_dbdir}/${pkgname}" then remove_from_file "${todolist}" "${origin}" continue @@ -2510,7 +2536,12 @@ clean-reinstall) done ;; show-missing-installed) - /bin/sh "${0}" show-missing-packages `run_pkg_info_origin_all` + if test "${pkgng}" = "" + then + /bin/sh "${0}" show-missing-packages `run_pkg_info_origin_all` + else + env ${pkg_env} ${local_env} pkg version -qo -Rl '?' + fi ;; reinstall) exec /bin/sh "${0}" install-packages "${todolist}" diff --git a/ports-mgmt/pkg_jail/pkg-descr b/ports-mgmt/pkg_jail/pkg-descr index ef1b10c1fee0..3fa7d53b10f7 100644 --- a/ports-mgmt/pkg_jail/pkg-descr +++ b/ports-mgmt/pkg_jail/pkg-descr @@ -8,4 +8,4 @@ is served to the production systems and desktops. On a system you can update installed ports with the clean build packages from the build system. -WWW: https://people.freebsd.org/~dinoex/batch/README +WWW: https://people.freebsd.org/~dinoex/batch/README.txt |