On Sat, 04 Feb 2017 10:41:14 +0100, Helmut Jarausch wrote:

> > emerge -n is the correct solution, although emerge -u may also work  
> > for
> > you.  
> 
> 
> Many thanks, Neil.
> 
> Still, I don't see how this can help me in my situation.
> 
> I'm trying to re-emerge packages which are already installed and where  
> there isn't a new version in the tree (in most cases).
> So neither -u nor -n will do the job.

I see, you do want to rebuild everything, but only once. I have a script
that I use to rebuild everything only once, you could modify it to use
your list of files.

#!/bin/bash

EMERGE_ARGS="--oneshot --keep-going"

usage() {
        echo -e "\nUsage: $(basename $0) [-f file] [-r 
category/package[-version] [-h]"
        echo "    -f re-emerge all packages older than this file"
        echo "    -r re-emerge all packages older than this package"
        echo "    -h Show this text"
        echo -e "\n    All other options are passed to the emerge command"
        echo -e "$*"
        exit
        }

while getopts f:r:pvh ARG; do
        case "${ARG}" in
                f) REFFILE=${OPTARG} ;;
                r) REFFILE=$(ls -1 /var/db/pkg/${OPTARG}*/environment.bz2 | 
head -n 1) ;;
                p) EMERGE_ARGS="${EMERGE_ARGS} --pretend" ;;
                v) EMERGE_ARGS="${EMERGE_ARGS} --verbose" ;;
                h) usage ;;
                esac
        done
shift $(expr ${OPTIND} - 1)

[[ "${REFFILE}" ]] || usage "\nYou must specify a reference with -f or -r\n"
[[ -f ${REFFILE} ]] || usage "\n${REFFILE} not found\n"

PKGLIST=$(mktemp -t mergeolderthan.XXXXXXXX)


find /var/db/pkg -name environment.bz2 ! -newer ${REFFILE} | sed -e 
's:/var/db/pkg/:=:' -e 's:/environment.bz2::' >|$PKGLIST

cat ${PKGLIST} | xargs --no-run-if-empty emerge ${EMERGE_ARGS} && rm -i 
${PKGLIST}


-- 
Neil Bothwick

RAM = Rarely Adequate Memory

Attachment: pgpays5c32bPV.pgp
Description: OpenPGP digital signature

Reply via email to