Changeset 3509


Ignore:
Timestamp:
Jul 3, 2007, 10:42:28 PM (18 years ago)
Author:
bird
Message:

Load prefix-portage-2.2.00.7130 into vendor/prefix-portage/current.

Location:
vendor/prefix-portage/current
Files:
12 added
1 deleted
144 edited

Legend:

Unmodified
Added
Removed
  • vendor/prefix-portage/current/Makefile.in

    r3488 r3509  
    3838        $(srcdir)/subst-install.vars.in.in \
    3939        $(top_srcdir)/bin/Makefile.in $(top_srcdir)/cnf/Makefile.in \
    40         $(top_srcdir)/configure $(top_srcdir)/pym/Makefile.in \
    41         $(top_srcdir)/src/python-missingos/Makefile.in AUTHORS COPYING \
    42         ChangeLog INSTALL NEWS config.guess config.sub depcomp \
     40        $(top_srcdir)/configure $(top_srcdir)/pym/Makefile.in AUTHORS \
     41        COPYING ChangeLog INSTALL NEWS config.guess config.sub depcomp \
    4342        install-sh ltmain.sh missing
    4443ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
     
    5049 configure.lineno config.status.lineno
    5150mkinstalldirs = $(install_sh) -d
    52 CONFIG_CLEAN_FILES = subst-install subst-install.vars.in \
    53         src/python-missingos/Makefile bin/Makefile pym/Makefile \
    54         cnf/Makefile
     51CONFIG_CLEAN_FILES = subst-install subst-install.vars.in bin/Makefile \
     52        pym/Makefile cnf/Makefile
    5553SOURCES =
    5654DIST_SOURCES =
     
    7977distcleancheck_listfiles = find . -type f -print
    8078ACLOCAL = @ACLOCAL@
    81 ALLOCA = @ALLOCA@
    8279AMTAR = @AMTAR@
    8380ARCH = @ARCH@
     
    182179program_transform_name = @program_transform_name@
    183180psdir = @psdir@
     181rootgid = @rootgid@
    184182rootuid = @rootuid@
    185183rootuser = @rootuser@
     
    195193top_builddir = @top_builddir@
    196194top_srcdir = @top_srcdir@
    197 wheelgid = @wheelgid@
    198195SUBDIRS = src man bin pym cnf
    199196AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip
     
    242239        cd $(top_builddir) && $(SHELL) ./config.status $@
    243240subst-install.vars.in: $(top_builddir)/config.status $(srcdir)/subst-install.vars.in.in
    244         cd $(top_builddir) && $(SHELL) ./config.status $@
    245 src/python-missingos/Makefile: $(top_builddir)/config.status $(top_srcdir)/src/python-missingos/Makefile.in
    246241        cd $(top_builddir) && $(SHELL) ./config.status $@
    247242bin/Makefile: $(top_builddir)/config.status $(top_srcdir)/bin/Makefile.in
  • vendor/prefix-portage/current/RELEASE-NOTES

    r3488 r3509  
    1818  For packages that don't specify any other KEYWORDS you can use the new ** token
    1919  as documented in portage(5) to disable KEYWORDS filtering completely.
     20
     21portage-2.1.3
     22==================================
     23
     24* The unmerge process will remove any file that is not claimed by another
     25  package in the same slot and is not protected by CONFIG_PROTECT, even if the
     26  modification time or checksum differs from the file that was originally
     27  installed.  The old behavior is still available by adding -unmerge-orphans
     28  to FEATURES.
    2029
    2130portage-2.1.2
  • vendor/prefix-portage/current/acinclude.m4

    r3488 r3509  
    4343  AC_PATH_PROG([XCU_ID], [id], no, $1)
    4444
    45   dnl is is there at all?
    46   if test "$PYTHON" = "no" ; then
    47     AC_MSG_ERROR([no python found in your path])
    48   fi
    49 
    5045  dnl does it support all the bells and whistles we need?
    5146  AC_MSG_CHECKING([whether $XCU_ID is good enough])
  • vendor/prefix-portage/current/bin/archive-conf

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/check-implicit-pointer-usage.py

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/chkcontents

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/clean_locks

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/dispatch-conf

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/dobin

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/doconfd

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/dodir

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/dodoc

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/doenvd

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/doexe

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/dohard

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/dohtml

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/doinfo

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/doinitd

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/doins

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/dolib

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/dolib.a

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/dolib.so

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/doman

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/domo

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/dosbin

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/dosed

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/dosym

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/ebuild

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/ebuild.sh

    • Property svn:executable set to *
    r3488 r3509  
    6868[ ! -z "$PREROOTPATH" ] && export PATH="${PREROOTPATH%%:}:$PATH"
    6969
    70 source "@PORTAGE_BASE@"/bin/isolated-functions.sh &>/dev/null
     70source "${PORTAGE_BIN_PATH}/isolated-functions.sh" &>/dev/null
    7171
    7272OCC="$CC"
     
    183183        # return shell-true/shell-false if exists.
    184184        # Takes single depend-type atoms.
    185         if "@PORTAGE_BASE@"/bin/portageq 'has_version' "${ROOT}" "$1"; then
    186                 return 0
    187         else
    188                 return 1
    189         fi
     185        "${PORTAGE_BIN_PATH}"/portageq has_version "${ROOT}" "$1"
     186        local retval=$?
     187        case "${retval}" in
     188                0)
     189                        return 0
     190                        ;;
     191                1)
     192                        return 1
     193                        ;;
     194                *)
     195                        die "unexpected portageq exit code: ${retval}"
     196                        ;;
     197        esac
    190198}
    191199
     
    194202                die "portageq calls are not allowed in the global scope"
    195203        fi
    196         "@PORTAGE_BASE@"/bin/portageq "$@"
     204        "${PORTAGE_BIN_PATH}/portageq" "$@"
    197205}
    198206
     
    209217        # returns the best/most-current match.
    210218        # Takes single depend-type atoms.
    211         "@PORTAGE_BASE@"/bin/portageq 'best_version' "${ROOT}" "$1"
     219        "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1"
    212220}
    213221
     
    500508                if ! ${CONFCACHE} ${CONFCACHE_ARG} ${TMP_CONFCACHE_DIR} "${ECONF_SOURCE}/configure" \
    501509                        --prefix="${EPREFIX}"/usr \
    502                         --host="${CHOST}" \
     510                        --host=${CHOST} \
    503511                        --mandir="${EPREFIX}"/usr/share/man \
    504512                        --infodir="${EPREFIX}"/usr/share/info \
     
    16511659        # Save current environment and touch a success file. (echo for success)
    16521660        umask 002
    1653         set | @EGREP@ -v "^SANDBOX_" > "${T}/environment" 2>/dev/null
    1654         export | @EGREP@ -v "^declare -x SANDBOX_" | \
    1655                 @SED@ 's:^declare -rx:declare -x:' >> "${T}/environment" 2>/dev/null
     1661        set | egrep -v "^SANDBOX_" > "${T}/environment" 2>/dev/null
     1662        export | egrep -v "^declare -x SANDBOX_" | \
     1663                sed 's:^declare -rx:declare -x:' >> "${T}/environment" 2>/dev/null
    16561664        chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/environment" &>/dev/null
    16571665        chmod g+w "${T}/environment" &>/dev/null
  • vendor/prefix-portage/current/bin/ecompress

    • Property svn:executable set to *
    r3488 r3509  
    2525                [[ -n $2 ]] && vecho "${0##*/}: --suffix takes no additional arguments" 1>&2
    2626
    27                 set -e
    28                 tmpdir="${T}"/.ecompress$$.${RANDOM}
    29                 mkdir "${tmpdir}"
    30                 cd "${tmpdir}"
    31                 # we have to fill the file enough so that there is something
    32                 # to compress as some programs will refuse to do compression
    33                 # if it cannot actually compress the file
    34                 echo {0..1000} > compressme
    35                 ${PORTAGE_COMPRESS} ${PORTAGE_COMPRESS_FLAGS} compressme > /dev/null
    36                 suffix=$(ls compressme*)
    37                 suffix=${suffix#compressme}
    38                 cd /
    39                 rm -rf "${tmpdir}"
    40                 echo "${suffix}"
     27                if [[ ! -e ${T}/.ecompress.suffix ]] ; then
     28                        set -e
     29                        tmpdir="${T}"/.ecompress$$.${RANDOM}
     30                        mkdir "${tmpdir}"
     31                        cd "${tmpdir}"
     32                        # we have to fill the file enough so that there is something
     33                        # to compress as some programs will refuse to do compression
     34                        # if it cannot actually compress the file
     35                        echo {0..1000} > compressme
     36                        ${PORTAGE_COMPRESS} ${PORTAGE_COMPRESS_FLAGS} compressme > /dev/null
     37                        suffix=$(ls compressme*)
     38                        suffix=${suffix#compressme}
     39                        cd /
     40                        rm -rf "${tmpdir}"
     41                        echo "${suffix}" > "${T}/.ecompress.suffix"
     42                fi
     43                cat "${T}/.ecompress.suffix"
    4144                ;;
    4245        --bin)
  • vendor/prefix-portage/current/bin/ecompressdir

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/emaint

    • Property svn:executable set to *
    r3488 r3509  
    7070                errors = []
    7171                try:
    72                         portage.write_atomic(self.world_file, "\n".join(self.okay))
     72                        portage.write_atomic(self.world_file,
     73                                "\n".join(sorted(self.okay)) + "\n")
    7374                except portage.exception.PortageException:
    7475                        errors.append(self.world_file + " could not be opened for writing")
  • vendor/prefix-portage/current/bin/emake

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/emerge

    • Property svn:executable set to *
    r3488 r3509  
    1414if __name__ == "__main__":
    1515        import sys
    16         sys.exit(emerge_main())
     16        from portage.exception import PermissionDenied
     17        try:
     18                retval = emerge_main()
     19        except PermissionDenied, e:
     20                sys.stderr.write("Permission denied: '%s'\n" % str(e))
     21                sys.exit(e.errno)
     22        sys.exit(retval)
  • vendor/prefix-portage/current/bin/emerge-webrsync

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/env-update

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/env-update.sh

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/eprefixify

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/etc-update

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/find-requires

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/fix-db.py

    • Property svn:executable set to *
    r3488 r3509  
    138138actions = {}
    139139writemsg("\n\n")
    140 for catpkg in bad.keys():
     140for catpkg in bad:
    141141        bad[catpkg].sort()
    142142
     
    157157if (len(sys.argv) > 1) and (sys.argv[1] == "--fix"):
    158158        writemsg("These are only directions, at the moment.")
    159         for catpkg in actions.keys():
     159        for catpkg in actions:
    160160                action = actions[catpkg]
    161161                writemsg("We will now '%s' '%s'..." % (action, catpkg))
  • vendor/prefix-portage/current/bin/fixdbentries

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/fixpackages

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/fowners

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/fperms

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/isolated-functions.sh

    • Property svn:executable set to *
    r3488 r3509  
    2424        fi
    2525
    26         echo "Call stack:"
     26        eerror "Call stack:"
    2727        for (( n = ${#FUNCNAME[@]} - 1, p = ${#BASH_ARGV[@]} ; n > $strip ; n-- )) ; do
    2828                funcname=${FUNCNAME[${n} - 1]}
     
    3838                        (( p -= ${BASH_ARGC[${n} - 1]} ))
    3939                fi
    40                 echo "  ${sourcefile}, line ${lineno}:   Called ${funcname}${args:+ ${args}}"
     40                eerror "  ${sourcefile}, line ${lineno}:   Called ${funcname}${args:+ ${args}}"
    4141        done
    4242}
     
    4545        local funcname="$1" lineno="$2" exitcode="$3"
    4646        shift 3
    47         echo >&2
    48         echo "!!! ERROR: $CATEGORY/$PF failed." >&2
    49         dump_trace 2 1>&2
    50         echo "  $(basename "${BASH_SOURCE[1]}"), line ${BASH_LINENO[0]}:   Called die" 1>&2
    51         echo >&2
    52         echo "!!! ${*:-(no error message)}" >&2
    53         echo "!!! If you need support, post the topmost build error, and the call stack if relevant." >&2
     47        eerror
     48        eerror "ERROR: $CATEGORY/$PF failed."
     49        dump_trace 2
     50        eerror "  ${BASH_SOURCE[1]##*/}, line ${BASH_LINENO[0]}:   Called die"
     51        eerror
     52        eerror "${*:-(no error message)}"
     53        eerror "If you need support, post the topmost build error, and the call stack if relevant."
    5454        [ -n "${PORTAGE_LOG_FILE}" ] && \
    55             echo "!!! A complete build log is located at '${PORTAGE_LOG_FILE}'." >&2
    56         echo >&2
     55            eerror "A complete build log is located at '${PORTAGE_LOG_FILE}'."
    5756        if [ -n "${EBUILD_OVERLAY_ECLASSES}" ] ; then
    58                 echo "This ebuild used the following eclasses from overlays:" >&2
    59                 echo >&2
    60                 for x in ${EBUILD_OVERLAY_ECLASSES} ; do
    61                         echo "  ${x}" >&2
    62                 done
    63                 echo >&2
     57            eerror "This ebuild used the following eclasses from overlays:"
     58            local x
     59            for x in ${EBUILD_OVERLAY_ECLASSES} ; do
     60                 eerror "  ${x}"
     61            done
    6462        fi
     63        if [ "${EBUILD#${PORTDIR}/}" == "${EBUILD}" ] ; then
     64            local overlay=${EBUILD%/*}
     65            overlay=${overlay%/*}
     66            overlay=${overlay%/*}
     67            eerror "This ebuild is from an overlay: '${overlay}/'"
     68        fi
     69        eerror
    6570
    6671        if [ "${EBUILD_PHASE/depend}" == "${EBUILD_PHASE}" ]; then
  • vendor/prefix-portage/current/bin/md5check.py

    • Property svn:executable set to *
    r3488 r3509  
    6969                        continue
    7070               
    71                 if mybn not in md5sums.keys():
     71                if mybn not in md5sums:
    7272                        portage.util.writemsg("Missing md5sum: %s in %s\n" % (mybn, mycpv))
    7373                else:
    74                         if mybn in md5_list.keys():
     74                        if mybn in md5_list:
    7575                                if (md5_list[mybn]["MD5"]  != md5sums[mybn]["MD5"]) or \
    7676                                   (md5_list[mybn]["size"] != md5sums[mybn]["size"]):
     
    9090               
    9191        #portage.writemsg(str(bn_list)+"\n")
    92         for x in md5sums.keys():
     92        for x in md5sums:
    9393                if x not in bn_list:
    9494                        portage.writemsg("Extra md5sum: %s in %s\n" % (x, mycpv))
     
    9797print col_list
    9898print
    99 print str(len(md5_list.keys()))+" unique distfile md5s."
     99print str(len(md5_list))+" unique distfile md5s."
    100100print str(len(bn_list))+" unique distfile names."
  • vendor/prefix-portage/current/bin/md5check.sh

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/misc-functions.sh

    r3488 r3509  
    557557        # for $PKGDIR and/or $PKGDIR/All.
    558558        export SANDBOX_ON="0"
     559        [ -z "${PORTAGE_BINPKG_TMPFILE}" ] && \
     560                PORTAGE_BINPKG_TMPFILE="${PKGDIR}/${CATEGORY}/${PVR}.tbz2"
    559561        mkdir -p "${PORTAGE_BINPKG_TMPFILE%/*}" || die "mkdir failed"
    560562        tar ${tar_options} -cf - . | bzip2 -f > "${PORTAGE_BINPKG_TMPFILE}" || \
  • vendor/prefix-portage/current/bin/newbin

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/newconfd

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/newdoc

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/newenvd

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/newexe

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/newinitd

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/newins

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/newlib.a

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/newlib.so

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/newman

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/newsbin

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/pemerge.py

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/pkgname

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/portage_gpg_update.sh

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/portageq

    • Property svn:executable set to *
    r3488 r3509  
    4444# and will automaticly add a command by the same name as the function!
    4545#
    46 
    4746
    4847def has_version(argv):
     
    285284                print portage.db[argv[0]]["porttree"].dbapi.getRepositoryPath(argv[1])
    286285
     286def list_preserved_libs(argv):
     287        """<root>
     288        Print a list of libraries preserved during a package update in the form
     289        package: path. Returns 0 if no preserved libraries could be found,
     290        1 otherwise.
     291        """
     292
     293        if len(argv) != 1:
     294                print "ERROR: wrong number of arguments"
     295                sys.exit(2)
     296        mylibs = portage.db[argv[0]]["vartree"].dbapi.plib_registry.getPreservedLibs()
     297        rValue = 0
     298        for cpv in mylibs:
     299                print cpv,
     300                for path in mylibs[cpv]:
     301                        print path,
     302                        rValue = 1
     303                print
     304        return rValue
     305list_preserved_libs.uses_root = True
     306
    287307#-----------------------------------------------------------------------------
    288308#
     
    302322        # file, and formatting each functions documentation.
    303323        #
    304         for name in globals().keys():
    305                 # Drop python stuff, modules, and our own support functions.
    306                 if (name in ("usage", "__doc__", "__name__", "main", "os", "portage", "sys", "__builtins__", "types", "string","exithandler")):
    307                         continue
    308 
     324        commands = [x for x in globals() if x not in \
     325                                ("usage", "__doc__", "__name__", "main", "os", "portage", \
     326                                "sys", "__builtins__", "types", "string","exithandler")]
     327        commands.sort()
     328
     329        for name in commands:
    309330                # Drop non-functions
    310331                obj = globals()[name]
     
    356377                usage(sys.argv)
    357378                sys.exit(os.EX_USAGE)
     379        except portage.exception.PermissionDenied, e:
     380                sys.stderr.write("Permission denied: '%s'\n" % str(e))
     381                sys.exit(e.errno)
    358382
    359383main()
  • vendor/prefix-portage/current/bin/prepall

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/prepalldocs

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/prepallinfo

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/prepallman

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/prepallstrip

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/prepinfo

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/preplib

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/prepman

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/prepstrip

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/quickpkg

    • Property svn:executable set to *
    r3488 r3509  
    77
    88def quickpkg_main(options, args, eout):
    9         from portage import dblink, dep_expand, catsplit, isvalidatom, xpak
    10         from portage.util import ensure_dirs
    11         from portage.exception import InvalidData
    12         from portage.dbapi.vartree import tar_contents
     9        from portage import catsplit, dep_expand, flatten, isvalidatom, xpak
     10        from portage.dep import use_reduce, paren_reduce
     11        from portage.util import ConfigProtect, ensure_dirs
     12        from portage.exception import InvalidData, InvalidDependString
     13        from portage.dbapi.vartree import dblink, tar_contents
     14        from portage.checksum import perform_md5
    1315        import tarfile
    1416        import portage
     
    2325        successes = []
    2426        missing = []
     27        config_files_excluded = 0
     28        include_config = options.include_config == "y"
     29        include_unmodified_config = options.include_unmodified_config == "y"
    2530        for arg in args:
    2631                try:
     
    4550                pkgs_for_arg = 0
    4651                for cpv in matches:
     52                        excluded_config_files = []
    4753                        bintree.prevent_collision(cpv)
    4854                        cat, pkg = catsplit(cpv)
     
    5561                                        # unmerged by a concurrent process
    5662                                        continue
     63                                iuse, use, restrict = vardb.aux_get(cpv,
     64                                        ["IUSE","USE","RESTRICT"])
     65                                iuse = [ x.lstrip("+-") for x in iuse.split() ]
     66                                use = use.split()
     67                                try:
     68                                        restrict = flatten(use_reduce(
     69                                                paren_reduce(restrict), uselist=use))
     70                                except InvalidDependString, e:
     71                                        eout.eerror("Invalid RESTRICT metadata " + \
     72                                                "for '%s': %s; skipping" % (cpv, str(e)))
     73                                        del e
     74                                        continue
     75                                if "bindist" in iuse and "bindist" not in use:
     76                                        eout.ewarn("%s: package was emerged with USE=-bindist!" % cpv)
     77                                        eout.ewarn("%s: it may not be legal to redistribute this." % cpv)
     78                                elif "bindist" in restrict:
     79                                        eout.ewarn("%s: package has RESTRICT=bindist!" % cpv)
     80                                        eout.ewarn("%s: it may not be legal to redistribute this." % cpv)
    5781                                eout.ebegin("Building package for %s" % cpv)
    5882                                pkgs_for_arg += 1
    5983                                contents = dblnk.getcontents()
     84                                protect = None
     85                                if not include_config:
     86                                        confprot = ConfigProtect(root,
     87                                                portage.settings.get("CONFIG_PROTECT","").split(),
     88                                                portage.settings.get("CONFIG_PROTECT_MASK","").split())
     89                                        def protect(filename):
     90                                                if not confprot.isprotected(filename):
     91                                                        return False
     92                                                if include_unmodified_config:
     93                                                        file_data = contents[filename]
     94                                                        if file_data[0] == "obj":
     95                                                                orig_md5 = file_data[2].lower()
     96                                                                cur_md5 = perform_md5(filename, calc_prelink=1)
     97                                                                if orig_md5 == cur_md5:
     98                                                                        return False
     99                                                excluded_config_files.append(filename)
     100                                                return True
    60101                                xpdata = xpak.xpak(dblnk.dbdir)
    61102                                binpkg_tmpfile = os.path.join(bintree.pkgdir,
     
    63104                                ensure_dirs(os.path.dirname(binpkg_tmpfile))
    64105                                tar = tarfile.open(binpkg_tmpfile, "w:bz2")
    65                                 tar_contents(contents, root, tar)
     106                                tar_contents(contents, root, tar, protect=protect)
    66107                                tar.close()
    67108                                xpak.tbz2(binpkg_tmpfile).recompose_mem(xpdata)
     
    81122                                eout.eend(0)
    82123                                successes.append((cpv, s.st_size))
     124                                config_files_excluded += len(excluded_config_files)
     125                                for filename in excluded_config_files:
     126                                        eout.ewarn("Excluded config: '%s'" % filename)
    83127                if not pkgs_for_arg:
    84128                        eout.eerror("Could not find anything " + \
     
    111155                                size_str = str(size)
    112156                eout.einfo("%s: %s" % (cpv, size_str))
     157        if config_files_excluded:
     158                print
     159                eout.ewarn("Excluded config files: %d" % config_files_excluded)
     160                eout.ewarn("See --help if you would like to include config files.")
    113161        if missing:
    114162                print
     
    119167
    120168if __name__ == "__main__":
    121         usage = "Usage: quickpkg [options] <list of package atoms>"
     169        usage = "quickpkg [options] <list of package atoms>"
    122170        from optparse import OptionParser
    123171        parser = OptionParser(usage=usage)
     172        parser.add_option("--umask",
     173                default="0077",
     174                help="umask used during package creation (default is 0077)")
     175        parser.add_option("--ignore-default-opts",
     176                action="store_true",
     177                help="do not use the QUICKPKG_DEFAULT_OPTS environment variable")
     178        parser.add_option("--include-config",
     179                type="choice",
     180                choices=["y","n"],
     181                default="n",
     182                metavar="<y|n>",
     183                help="include all files protected by CONFIG_PROTECT (as a security precaution, default is 'n')")
     184        parser.add_option("--include-unmodified-config",
     185                type="choice",
     186                choices=["y","n"],
     187                default="n",
     188                metavar="<y|n>",
     189                help="include files protected by CONFIG_PROTECT that have not been modified since installation (as a security precaution, default is 'n')")
    124190        options, args = parser.parse_args(sys.argv[1:])
     191        if not options.ignore_default_opts:
     192                from portage import settings
     193                default_opts = settings.get("QUICKPKG_DEFAULT_OPTS","").split()
     194                options, args = parser.parse_args(default_opts + sys.argv[1:])
    125195        if not args:
    126196                parser.error("no packages atoms given")
     197        try:
     198                umask = int(options.umask, 8)
     199        except ValueError:
     200                parser.error("invalid umask: %s" % options.umask)
    127201        # We need to ensure a sane umask for the packages that will be created.
    128         old_umask = os.umask(022)
     202        old_umask = os.umask(umask)
    129203        from portage.output import get_term_size, EOutput
    130204        eout = EOutput()
  • vendor/prefix-portage/current/bin/regenworld

    • Property svn:executable set to *
    r3488 r3509  
    9393                        worldlist.append(myfavkey)
    9494
    95 portage.write_atomic(os.path.join("/", portage.WORLD_FILE), "\n".join(worldlist))
     95portage.write_atomic(os.path.join("/", portage.WORLD_FILE),
     96        "\n".join(sorted(worldlist)) + "\n")
  • vendor/prefix-portage/current/bin/repoman

    • Property svn:executable set to *
    r3488 r3509  
    175175        "LICENSE.syntax":"Syntax error in LICENSE (usually an extra/missing space/parenthesis)",
    176176        "PROVIDE.syntax":"Syntax error in PROVIDE (usually an extra/missing space/parenthesis)",
     177        "RESTRICT.syntax":"Syntax error in RESTRICT (usually an extra/missing space/parenthesis)",
    177178        "SRC_URI.syntax":"Syntax error in SRC_URI (usually an extra/missing space/parenthesis)",
    178179        "ebuild.syntax":"Error generating cache entry for ebuild; typically caused by ebuild syntax error",
     
    184185        "LICENSE.invalid":"This ebuild is listing a license that doesnt exist in portages license/ dir.",
    185186        "KEYWORDS.invalid":"This ebuild contains KEYWORDS that are not listed in profiles/arch.list or for which no valid profile was found",
     187        "RESTRICT.invalid":"This ebuild contains invalid RESTRICT values.",
    186188        "ebuild.nostable":"There are no ebuilds that are marked as stable for your ARCH",
    187189        "ebuild.allmasked":"All ebuilds are masked for this package (Package level only)",
     
    218220"KEYWORDS.stupid",
    219221"KEYWORDS.missing",
     222"RESTRICT.invalid",
    220223"ebuild.minorsyn",
    221224"ebuild.badheader",
     
    241244                qawarnings.append(x)
    242245
     246valid_restrict = frozenset(["binchecks", "bindist", "fetch", "mirror",
     247        "primaryuri", "strip", "test", "userpriv"])
    243248
    244249verbose=0
     
    354359        x=1
    355360        while x < len(sys.argv):
    356                 if sys.argv[x] in shortmodes.keys():
     361                if sys.argv[x] in shortmodes:
    357362                        sys.argv[x]=shortmodes[sys.argv[x]]
    358                 elif sys.argv[x] in repoman_shortoptions.keys():
     363                elif sys.argv[x] in repoman_shortoptions:
    359364                        sys.argv[x] = repoman_shortoptions[sys.argv[x]]
    360365                if sys.argv[x] in modes:
     
    14661471                                        stats["KEYWORDS.invalid"] += 1
    14671472                                        fails["KEYWORDS.invalid"].append(x+"/"+y+".ebuild: %s (profile invalid)" % mykey)
     1473
     1474                #restrict checks
     1475                myrestrict = None
     1476                try:
     1477                        myrestrict = portage.dep.use_reduce(
     1478                                portage.dep.paren_reduce(myaux["RESTRICT"]), matchall=1)
     1479                except portage.exception.InvalidDependString, e:
     1480                        stats["RESTRICT.syntax"] = stats["RESTRICT.syntax"] + 1
     1481                        fails["RESTRICT.syntax"].append(mykey+".ebuild RESTRICT: "+str(e))
     1482                        del e
     1483                if myrestrict:
     1484                        myrestrict = set(portage.flatten(myrestrict))
     1485                        mybadrestrict = myrestrict.difference(valid_restrict)
     1486                        if mybadrestrict:
     1487                                stats["RESTRICT.invalid"] += len(mybadrestrict)
     1488                                for mybad in mybadrestrict:
     1489                                        fails["RESTRICT.invalid"].append(x+"/"+y+".ebuild: %s" % mybad)
    14681490
    14691491                #syntax checks
     
    15981620                if xs[0]==".":
    15991621                        xs=xs[1:]
    1600                 if xs[0] not in mygroups.keys():
     1622                if xs[0] not in mygroups:
    16011623                        mygroups[xs[0]]=[seperator.join(xs[1:])]
    16021624                else:
     
    16161638        elif not dofail:
    16171639                print green("RepoMan sez:"),"\"If everyone were like you, I'd be out of business!\""
     1640        elif dofail:
     1641                print turquoise("Please fix these important QA issues first.")
     1642                print green("RepoMan sez:"),"\"Make your QA payment on time and you'll never see the likes of me.\"\n"
     1643                sys.exit(1)
    16181644        if quiet < 1:
    16191645                print
     
    18161842        try:
    18171843                unameout=getstatusoutput("uname -srp")[1]
    1818                 commitmessage+="\n(Portage "+str(portage.VERSION)+"-prefix/"
     1844                commitmessage+="\n(Portage "+str(portage.VERSION)+"/"
    18191845                if isCvs:
    18201846                        commitmessage+="CVS"
  • vendor/prefix-portage/current/bin/sed

    • Property svn:executable set to *
  • vendor/prefix-portage/current/bin/xpak

    • Property svn:executable set to *
  • vendor/prefix-portage/current/cnf/etc-update.conf

    r3488 r3509  
    2323
    2424# For emacs-users
    25 # diff_command="eval emacs -nw --eval=\(ediff\ \"%file1\"\ \"%file2\"\)"
     25# diff_command="eval emacs -nw --eval=\'\(ediff\ \"%file1\"\ \"%file2\"\)\'"
    2626#using_editor=1
    2727
  • vendor/prefix-portage/current/cnf/make.conf

    r3488 r3509  
    7171# you try to use portage. *** DO NOT INCLUDE A TRAILING "/" ***
    7272#
    73 # EPREFIX is the filesystem location in which ALL packages will be
    74 #     installed to.
    75 #EPREFIX=/opt/gentoo
    7673#
    7774# PORTAGE_TMPDIR is the location portage will use for compilations and
    7875#     temporary storage of data. This can get VERY large depending upon
    7976#     the application being installed.
    80 #PORTAGE_TMPDIR=${EPREFIX}/var/tmp
     77#PORTAGE_TMPDIR=@DOMAIN_PREFIX@/var/tmp
    8178#
    8279# PORTDIR is the location of the portage tree. This is the repository
    8380#     for all profile information as well as all ebuilds. If you change
    8481#     this, you must update your /etc/make.profile symlink accordingly.
    85 #PORTDIR=${EPREFIX}/usr/portage
     82#     ***Warning***
     83#     Data stored inside PORTDIR is in peril of being overwritten or deleted by
     84#     the emerge --sync command. The default value of PORTAGE_RSYNC_OPTS
     85#     will protect the default locations of DISTDIR and PKGDIR, but users are
     86#     warned that any other locations inside PORTDIR are not necessarily safe
     87#     for data storage.
     88#PORTDIR=@DOMAIN_PREFIX@/usr/portage
    8689#
    8790# DISTDIR is where all of the source code tarballs will be placed for
     
    8992#     it. The entire repository of tarballs for Gentoo is 9G. This is
    9093#     considerably more than any user will ever download. 2-3G is
    91 #     a large DISTDIR.
    92 #DISTDIR=/usr/portage/distfiles
     94#     a large DISTDIR. Note that locations under /usr/portage are not
     95#     necessarily safe for data storage. See the PORTDIR documentation
     96#     for more information.
     97#DISTDIR=@DOMAIN_PREFIX@/usr/portage/distfiles
    9398#
    9499# PKGDIR is the location of binary packages that you can have created
    95100#     with '--buildpkg' or '-b' while emerging a package. This can get
    96 #     up to several hundred megs, or even a few gigs.
    97 #PKGDIR=/usr/portage/packages
     101#     up to several hundred megs, or even a few gigs. Note that
     102#     locations under /usr/portage are not necessarily safe for data
     103#     storage. See the PORTDIR documentation for more information.
     104#PKGDIR=@DOMAIN_PREFIX@/usr/portage/packages
    98105#
    99106# PORT_LOGDIR is the location where portage will store all the logs it
    100 #     creates from each individual merge. They are stored as NNNN-$PF.log
    101 #     in the directory specified. This is disabled until you enable it by
    102 #     providing a directory. Permissions will be modified as needed IF the
    103 #     directory exists, otherwise logging will be disabled. NNNN is the
    104 #     increment at the time the log is created. Logs are thus sequential.
    105 #     The common setting is to use the /var/log/portage path.
     107#     creates from each individual merge. They are stored as
     108#     ${CATEGORY}:${PF}:YYYYMMDD-HHMMSS.log in the directory specified.
     109#     If the direcory does not exist, it will be created automatically and
     110#     group permissions will be applied to it.  If the directory already
     111#     exists, portage will not modify it's permissions.
    106112#PORT_LOGDIR=""
    107113#
     
    109115#     concern that they will be deleted by rsync updates. Default is not
    110116#     defined.
    111 #PORTDIR_OVERLAY=/usr/local/portage
     117#PORTDIR_OVERLAY=@DOMAIN_PREFIX@/usr/local/portage
    112118
    113119# Fetching files
     
    123129#
    124130# Default fetch command (5 tries, passive ftp for firewall compatibility)
    125 #FETCHCOMMAND="${EPREFIX}/usr/bin/wget -t 5 -T 60 --passive-ftp \${URI} -P \${DISTDIR}"
    126 #RESUMECOMMAND="${EPREFIX}/usr/bin/wget -c -t 5 -T 60 --passive-ftp \${URI} -P \${DISTDIR}"
     131#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -t 5 -T 60 --passive-ftp \${URI} -P \${DISTDIR}"
     132#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -c -t 5 -T 60 --passive-ftp \${URI} -P \${DISTDIR}"
    127133#
    128134# Using wget, ratelimiting downloads
    129 #FETCHCOMMAND="${EPREFIX}/usr/bin/wget -t 5 -T 60 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}"
    130 #RESUMECOMMAND="${EPREFIX}/usr/bin/wget -c -t 5 -T 60 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}"
     135#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -t 5 -T 60 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}"
     136#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/wget -c -t 5 -T 60 --passive-ftp --limit-rate=200k \${URI} -P \${DISTDIR}"
    131137#
    132138# curl groks urls
    133 #FETCHCOMMAND="${EPREFIX}/usr/bin/curl -f --connect-timeout 15 -# -o \${DISTDIR}/\${FILE} \${URI}"
    134 #RESUMECOMMAND="${EPREFIX}/usr/bin/curl -f --connect-timeout 15 -# -C - -o \${DISTDIR}/\${FILE} \${URI}"
     139#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/curl -f --connect-timeout 15 -# -o \${DISTDIR}/\${FILE} \${URI}"
     140#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/curl -f --connect-timeout 15 -# -C - -o \${DISTDIR}/\${FILE} \${URI}"
    135141#
    136142# Lukemftp (BSD ftp):
    137 #FETCHCOMMAND="${EPREFIX}/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}"
    138 #RESUMECOMMAND="${EPREFIX}/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}"
     143#FETCHCOMMAND="@DOMAIN_PREFIX@/usr/bin/lukemftp -s -a -o \${DISTDIR}/\${FILE} \${URI}"
     144#RESUMECOMMAND="@DOMAIN_PREFIX@/usr/bin/lukemftp -s -a -R -o \${DISTDIR}/\${FILE} \${URI}"
    139145#
    140146# Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval.
     
    189195#
    190196#SYNC="rsync://rsync.gentoo.org/gentoo-portage"
     197#
     198# In Gentoo/Alt:Prefix, the only correct SYNC url is the following:
     199#
     200#SYNC="svn+http://overlays.gentoo.org/svn/proj/alt/trunk/prefix-overlay"
    191201#
    192202# PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve
  • vendor/prefix-portage/current/cnf/make.globals

    r3488 r3509  
    3434
    3535# Default user options
    36 FEATURES="sandbox distlocks metadata-transfer"
     36FEATURES="sandbox distlocks metadata-transfer unmerge-orphans"
    3737
    3838# Default chunksize for binhost comms
     
    6969# Default ownership of installed files.
    7070PORTAGE_INST_UID="@rootuid@"
    71 PORTAGE_INST_USER="@rootuser@"
    72 PORTAGE_INST_GID="@wheelgid@"
     71PORTAGE_INST_GID="@rootgid@"
    7372
    7473# Default PATH for ebuild env
     
    8483PORTAGE_ELOG_MAILURI="@rootuser@"
    8584PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}"
    86 PORTAGE_ELOG_MAILFROM="portage"
     85PORTAGE_ELOG_MAILFROM="@portageuser@"
    8786
    8887#            *****************************
  • vendor/prefix-portage/current/commit

    r3488 r3509  
    1    Merged from trunk 6765:6802
     1   Merged from trunk 7090:7126
    22
    33   +------------------------------------------------------------------------+
    4    | 6766    | For bug #181104, make econf give an appropriate error        |
    5    | zmedico | message when configure is not executable.                    |
     4   | 7091    | For bug #183639, give a more informative message with the    |
     5   | zmedico | package.provided warning.                                    |
    66   |---------+--------------------------------------------------------------|
    7    | 6768    | For bug #139383, in xtermTitleReset() use os.system()        |
    8    | zmedico | instead of commands.getoutput() since the latter puts too    |
    9    |         | much restriction on what $PROMPT_COMMAND may contain.        |
     7   | 7093    | Test for existence of the getRepositories method since       |
     8   | zmedico | bindbapi doesn't have it atm.                                |
    109   |---------+--------------------------------------------------------------|
    11    | 6770    | For bug #152828, run ${CHOST}-ldconfig when ${CBUILD} !=     |
    12    | zmedico | ${CHOST}.                                                    |
     10   | 7094    | Add a 0xAAAA00 rgb color code to represent the darkyellow    |
     11   | zmedico | color that some terminals have instead of brown.             |
    1312   |---------+--------------------------------------------------------------|
    14    | 6772    | Only execute $PROMPT_COMMAND when appropriate.               |
     13   | 7096    | print a notice when a repository/overlay does not have a     |
     14   | genone  | name                                                         |
     15   |---------+--------------------------------------------------------------|
     16   | 7097    | ewarn when merging a package and the source                  |
     17   | genone  | repository/overlay does not have a name                      |
     18   |---------+--------------------------------------------------------------|
     19   | 7098    | apply additional phase filters as otherwise some messages    |
     20   | genone  | are logged in both unmerge and merge                         |
     21   |---------+--------------------------------------------------------------|
     22   | 7099    | Remove old wheel group warnings since portage stopped using  |
     23   | zmedico | this group long ago.                                         |
     24   |---------+--------------------------------------------------------------|
     25   | 7100    | Add docs for /etc/portage/color.map and a few misc man page  |
     26   | zmedico | fixes. Thanks to Arfrever Frehtes Taifersar Arahesis         |
     27   |         | <Arfrever.FTA@GMail.Com> in bug #183758.                     |
     28   |---------+--------------------------------------------------------------|
     29   | 7102    | Add a QA warning for invalid values of RESTRICT. Thanks to   |
     30   | zmedico | peper for the patch.                                         |
     31   |---------+--------------------------------------------------------------|
     32   | 7104    | For bug #180045, try to merge PDEPEND as soon as possible so |
     33   | zmedico | that it behaves more like RDEPEND.                           |
     34   |---------+--------------------------------------------------------------|
     35   | 7106    | Add medium-soft support to DepPriority.__str__().            |
    1536   | zmedico |                                                              |
    1637   |---------+--------------------------------------------------------------|
    17    | 6775    | Skip bogus '$ECLASS inherited illegally' messages when       |
    18    | zmedico | installing from a binary package.                            |
     38   | 7108    | Update --buildpkgonly logic to account for                   |
     39   | zmedico | DepPriority.MEDIUM_SOFT.                                     |
    1940   |---------+--------------------------------------------------------------|
    20    | 6778    | For bug #181387, fix an UnboundLocalError for the mymtime    |
    21    | zmedico | variable that is triggered by confmem.                       |
     41   | 7110    | Revert --buildpkgonly logic back because it was already      |
     42   | zmedico | correct.                                                     |
    2243   |---------+--------------------------------------------------------------|
    23    | 6780    | For bug #148702, automatically enable flags from IUSE if     |
    24    | zmedico | they correspond to unset USE_EXPAND variables such as        |
    25    |         | LINGUAS. The variable only has to be set to some value or an |
    26    |         | empty string in order to disable these flags.                |
     44   | 7112    | For bug #131030, update the warning about potential for      |
     45   | zmedico | emerge --sync overwrite or delete files in ${PORTDIR}. Add   |
     46   |         | references to the PKGDIR and DISTDIR docs.                   |
    2747   |---------+--------------------------------------------------------------|
    28    | 6782    | When an update is discarded due to confmem, record it's      |
    29    | zmedico | mtime in the contents (it's md5 is already recorded there    |
    30    |         | too).                                                        |
     48   | 7114    | s/PORTAGE_EXTRA_RSYNC_OPTS/PORTAGE_RSYNC_OPTS/ for           |
     49   | zmedico | correctness.                                                 |
    3150   |---------+--------------------------------------------------------------|
    32    | 6784    | For bug #148702, use the * token to trigger wildcard         |
    33    | zmedico | expansion of IUSE. This adds flexibility and prevents flags  |
    34    |         | from being enabled unexpectedly.                             |
     51   | 7116    | If necessary, resample the leaf nodes so that they include   |
     52   | zmedico | all nodes whose hard deps are satisfied.                     |
    3553   |---------+--------------------------------------------------------------|
    36    | 6786    | Preserve order of flags from IUSE in wildcard expansion.     |
     54   | 7118    | Move medium priority out of ignore_priority_range and handle |
     55   | zmedico | it separately.                                               |
     56   |---------+--------------------------------------------------------------|
     57   | 7120    | Flatten restrict for the RESTRICT.invalid check.             |
    3758   | zmedico |                                                              |
    3859   |---------+--------------------------------------------------------------|
    39    | 6788    | Make repoman work with both + and - flags in IUSE.           |
     60   | 7122    | Clean up the selected_nodes logic in depgraph.altlist().     |
    4061   | zmedico |                                                              |
    4162   |---------+--------------------------------------------------------------|
    42    | 6790    | For bug #181551, support slot deps in package.keywords.      |
     63   | 7124    | Clone asap_nodes so that iteration is safe for node removal. |
    4364   | zmedico |                                                              |
    4465   |---------+--------------------------------------------------------------|
    45    | 6792    | For bug #81097, detect and report suspicious hardlinks to    |
    46    | zmedico | suid/sgid files. False positives are prevented by doing      |
    47    |         | reference counts for each inode having suid/sgid bits and    |
    48    |         | multiple hardlinks. The security check is done prior to each |
    49    |         | merge or unmerge phase and it will cause the phase to abort  |
    50    |         | if a problem is found (so that the user can investigate      |
    51    |         | before any files are removed).                               |
    52    |---------+--------------------------------------------------------------|
    53    | 6793    | Don't bother to warn about hardlinks to suid/sgid files      |
    54    | zmedico | before unlink since it can give false positives and the      |
    55    |         | existing suid/sgid security check should spot problems       |
    56    |         | before this anyway.                                          |
    57    |---------+--------------------------------------------------------------|
    58    | 6794    | Fix the suid/sgid check so it only looks at regular files    |
    59    | zmedico | since it can generate false positives otherwise.             |
    60    |---------+--------------------------------------------------------------|
    61    | 6796    | For bug #181355, detect parenthesis mismatch in              |
    62    | zmedico | paren_reduce(), raise an InvalidDependString exception, and  |
    63    |         | make sure that all callers handle the exception properly.    |
    64    |---------+--------------------------------------------------------------|
    65    | 6797    | Remove the "missing left parenthesis" test for now since it  |
    66    | zmedico | gives false positives.                                       |
    67    |---------+--------------------------------------------------------------|
    68    | 6799    | For consistency with other xterm titles code, redirect       |
    69    | zmedico | $PROMPT_COMMAND output to stderr.                            |
    70    |---------+--------------------------------------------------------------|
    71    | 6802    | Bump 2.1.3 to 2.2 for some features and add news about       |
    72    | zmedico | USE_EXPAND wildcards.                                        |
     66   | 7126    | Prefer asap_nodes more aggressively over any other nodes     |
     67   | zmedico | whenever possible. If no asap_nodes can be selected for a    |
     68   |         | given iteration, they will be ignored for the next           |
     69   |         | iteration.                                                   |
    7370   +------------------------------------------------------------------------+
  • vendor/prefix-portage/current/config.guess

    • Property svn:executable set to *
  • vendor/prefix-portage/current/config.sub

    • Property svn:executable set to *
  • vendor/prefix-portage/current/configure

    • Property svn:executable set to *
    r3488 r3509  
    718718XARGS
    719719CPP
    720 ALLOCA
    721720portageuser
    722721portagegroup
    723 wheelgid
    724722rootuser
    725723rootuid
     724rootgid
    726725DOMAIN_PREFIX
    727726DEFAULT_PATH
     
    732731BUILD_TBZ2TOOL_TRUE
    733732BUILD_TBZ2TOOL_FALSE
    734 BUILD_MISSINGOS_TRUE
    735 BUILD_MISSINGOS_FALSE
    736733LIBOBJS
    737734LTLIBOBJS'
     
    13301327  --enable-tbz2tool       build tbz2tool, tool for creating binpkgs (default
    13311328                          yes)
    1332   --enable-missingos      build compatibility missingos code for python 2.2
    1333                           (default auto)
    13341329  --enable-just-compiled-sources
    13351330                          install just the bytecode, not the sources (default
     
    13391334  --with-PACKAGE[=ARG]    use PACKAGE [ARG=yes]
    13401335  --without-PACKAGE       do not use PACKAGE (same as --with-PACKAGE=no)
    1341   --with-user=me          use user 'me' for portage to work as (default
     1336  --with-portage-user=myuser
     1337                          use user 'myuser' as portage owner (default portage)
     1338  --with-portage-group=mygroup
     1339                          use group 'mygroup' as portage users group (default
    13421340                          portage)
    1343   --with-group=mygroup    use group 'mygroup' for portage to work as (default
    1344                           portage)
    1345   --with-wheelgid=wheelgid
    1346                           let portage use 'wheelgid' as wheel group (default
    1347                           0)
    1348   --with-rootuser=me      declares 'me' as the portage owner (default root)
     1341  --with-rootuser=myuser  uses 'myuser' as owner of installed files (default
     1342                          is portage-user)
    13491343  --with-offset-prefix    specify the installation prefix for all packages ,
    13501344                          defaults to /
     
    38133807
    38143808
    3815     if test "$PYTHON" = "no" ; then
    3816     { { echo "$as_me:$LINENO: error: no python found in your path" >&5
    3817 echo "$as_me: error: no python found in your path" >&2;}
    3818    { (exit 1); exit 1; }; }
    3819   fi
    3820 
    38213809    { echo "$as_me:$LINENO: checking whether $XCU_ID is good enough" >&5
    38223810echo $ECHO_N "checking whether $XCU_ID is good enough... $ECHO_C" >&6; }
     
    44534441
    44544442
    4455 
    4456 { echo "$as_me:$LINENO: checking for main in -lc" >&5
    4457 echo $ECHO_N "checking for main in -lc... $ECHO_C" >&6; }
    4458 if test "${ac_cv_lib_c_main+set}" = set; then
    4459   echo $ECHO_N "(cached) $ECHO_C" >&6
    4460 else
    4461   ac_check_lib_save_LIBS=$LIBS
    4462 LIBS="-lc  $LIBS"
    4463 cat >conftest.$ac_ext <<_ACEOF
    4464 /* confdefs.h.  */
    4465 _ACEOF
    4466 cat confdefs.h >>conftest.$ac_ext
    4467 cat >>conftest.$ac_ext <<_ACEOF
    4468 /* end confdefs.h.  */
    4469 
    4470 
    4471 int
    4472 main ()
    4473 {
    4474 return main ();
    4475   ;
    4476   return 0;
    4477 }
    4478 _ACEOF
    4479 rm -f conftest.$ac_objext conftest$ac_exeext
    4480 if { (ac_try="$ac_link"
    4481 case "(($ac_try" in
    4482   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    4483   *) ac_try_echo=$ac_try;;
    4484 esac
    4485 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    4486   (eval "$ac_link") 2>conftest.er1
    4487   ac_status=$?
    4488   grep -v '^ *+' conftest.er1 >conftest.err
    4489   rm -f conftest.er1
    4490   cat conftest.err >&5
    4491   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    4492   (exit $ac_status); } && {
    4493          test -z "$ac_c_werror_flag" ||
    4494          test ! -s conftest.err
    4495        } && test -s conftest$ac_exeext &&
    4496        $as_test_x conftest$ac_exeext; then
    4497   ac_cv_lib_c_main=yes
    4498 else
    4499   echo "$as_me: failed program was:" >&5
    4500 sed 's/^/| /' conftest.$ac_ext >&5
    4501 
    4502         ac_cv_lib_c_main=no
    4503 fi
    4504 
    4505 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
    4506       conftest$ac_exeext conftest.$ac_ext
    4507 LIBS=$ac_check_lib_save_LIBS
    4508 fi
    4509 { echo "$as_me:$LINENO: result: $ac_cv_lib_c_main" >&5
    4510 echo "${ECHO_T}$ac_cv_lib_c_main" >&6; }
    4511 if test $ac_cv_lib_c_main = yes; then
    4512   cat >>confdefs.h <<_ACEOF
    4513 #define HAVE_LIBC 1
    4514 _ACEOF
    4515 
    4516   LIBS="-lc $LIBS"
    4517 
    4518 fi
    4519 
    4520 
    4521 { echo "$as_me:$LINENO: checking for main in -ldl" >&5
    4522 echo $ECHO_N "checking for main in -ldl... $ECHO_C" >&6; }
    4523 if test "${ac_cv_lib_dl_main+set}" = set; then
    4524   echo $ECHO_N "(cached) $ECHO_C" >&6
    4525 else
    4526   ac_check_lib_save_LIBS=$LIBS
    4527 LIBS="-ldl  $LIBS"
    4528 cat >conftest.$ac_ext <<_ACEOF
    4529 /* confdefs.h.  */
    4530 _ACEOF
    4531 cat confdefs.h >>conftest.$ac_ext
    4532 cat >>conftest.$ac_ext <<_ACEOF
    4533 /* end confdefs.h.  */
    4534 
    4535 
    4536 int
    4537 main ()
    4538 {
    4539 return main ();
    4540   ;
    4541   return 0;
    4542 }
    4543 _ACEOF
    4544 rm -f conftest.$ac_objext conftest$ac_exeext
    4545 if { (ac_try="$ac_link"
    4546 case "(($ac_try" in
    4547   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    4548   *) ac_try_echo=$ac_try;;
    4549 esac
    4550 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    4551   (eval "$ac_link") 2>conftest.er1
    4552   ac_status=$?
    4553   grep -v '^ *+' conftest.er1 >conftest.err
    4554   rm -f conftest.er1
    4555   cat conftest.err >&5
    4556   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    4557   (exit $ac_status); } && {
    4558          test -z "$ac_c_werror_flag" ||
    4559          test ! -s conftest.err
    4560        } && test -s conftest$ac_exeext &&
    4561        $as_test_x conftest$ac_exeext; then
    4562   ac_cv_lib_dl_main=yes
    4563 else
    4564   echo "$as_me: failed program was:" >&5
    4565 sed 's/^/| /' conftest.$ac_ext >&5
    4566 
    4567         ac_cv_lib_dl_main=no
    4568 fi
    4569 
    4570 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
    4571       conftest$ac_exeext conftest.$ac_ext
    4572 LIBS=$ac_check_lib_save_LIBS
    4573 fi
    4574 { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_main" >&5
    4575 echo "${ECHO_T}$ac_cv_lib_dl_main" >&6; }
    4576 if test $ac_cv_lib_dl_main = yes; then
    4577   cat >>confdefs.h <<_ACEOF
    4578 #define HAVE_LIBDL 1
    4579 _ACEOF
    4580 
    4581   LIBS="-ldl $LIBS"
    4582 
    4583 fi
    4584 
    4585 
    4586 { echo "$as_me:$LINENO: checking for main in -lgcc" >&5
    4587 echo $ECHO_N "checking for main in -lgcc... $ECHO_C" >&6; }
    4588 if test "${ac_cv_lib_gcc_main+set}" = set; then
    4589   echo $ECHO_N "(cached) $ECHO_C" >&6
    4590 else
    4591   ac_check_lib_save_LIBS=$LIBS
    4592 LIBS="-lgcc  $LIBS"
    4593 cat >conftest.$ac_ext <<_ACEOF
    4594 /* confdefs.h.  */
    4595 _ACEOF
    4596 cat confdefs.h >>conftest.$ac_ext
    4597 cat >>conftest.$ac_ext <<_ACEOF
    4598 /* end confdefs.h.  */
    4599 
    4600 
    4601 int
    4602 main ()
    4603 {
    4604 return main ();
    4605   ;
    4606   return 0;
    4607 }
    4608 _ACEOF
    4609 rm -f conftest.$ac_objext conftest$ac_exeext
    4610 if { (ac_try="$ac_link"
    4611 case "(($ac_try" in
    4612   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    4613   *) ac_try_echo=$ac_try;;
    4614 esac
    4615 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    4616   (eval "$ac_link") 2>conftest.er1
    4617   ac_status=$?
    4618   grep -v '^ *+' conftest.er1 >conftest.err
    4619   rm -f conftest.er1
    4620   cat conftest.err >&5
    4621   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    4622   (exit $ac_status); } && {
    4623          test -z "$ac_c_werror_flag" ||
    4624          test ! -s conftest.err
    4625        } && test -s conftest$ac_exeext &&
    4626        $as_test_x conftest$ac_exeext; then
    4627   ac_cv_lib_gcc_main=yes
    4628 else
    4629   echo "$as_me: failed program was:" >&5
    4630 sed 's/^/| /' conftest.$ac_ext >&5
    4631 
    4632         ac_cv_lib_gcc_main=no
    4633 fi
    4634 
    4635 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
    4636       conftest$ac_exeext conftest.$ac_ext
    4637 LIBS=$ac_check_lib_save_LIBS
    4638 fi
    4639 { echo "$as_me:$LINENO: result: $ac_cv_lib_gcc_main" >&5
    4640 echo "${ECHO_T}$ac_cv_lib_gcc_main" >&6; }
    4641 if test $ac_cv_lib_gcc_main = yes; then
    4642   cat >>confdefs.h <<_ACEOF
    4643 #define HAVE_LIBGCC 1
    4644 _ACEOF
    4645 
    4646   LIBS="-lgcc $LIBS"
    4647 
    4648 fi
    4649 
    4650 
    4651 { echo "$as_me:$LINENO: checking for main in -lpthread" >&5
    4652 echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; }
    4653 if test "${ac_cv_lib_pthread_main+set}" = set; then
    4654   echo $ECHO_N "(cached) $ECHO_C" >&6
    4655 else
    4656   ac_check_lib_save_LIBS=$LIBS
    4657 LIBS="-lpthread  $LIBS"
    4658 cat >conftest.$ac_ext <<_ACEOF
    4659 /* confdefs.h.  */
    4660 _ACEOF
    4661 cat confdefs.h >>conftest.$ac_ext
    4662 cat >>conftest.$ac_ext <<_ACEOF
    4663 /* end confdefs.h.  */
    4664 
    4665 
    4666 int
    4667 main ()
    4668 {
    4669 return main ();
    4670   ;
    4671   return 0;
    4672 }
    4673 _ACEOF
    4674 rm -f conftest.$ac_objext conftest$ac_exeext
    4675 if { (ac_try="$ac_link"
    4676 case "(($ac_try" in
    4677   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    4678   *) ac_try_echo=$ac_try;;
    4679 esac
    4680 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    4681   (eval "$ac_link") 2>conftest.er1
    4682   ac_status=$?
    4683   grep -v '^ *+' conftest.er1 >conftest.err
    4684   rm -f conftest.er1
    4685   cat conftest.err >&5
    4686   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    4687   (exit $ac_status); } && {
    4688          test -z "$ac_c_werror_flag" ||
    4689          test ! -s conftest.err
    4690        } && test -s conftest$ac_exeext &&
    4691        $as_test_x conftest$ac_exeext; then
    4692   ac_cv_lib_pthread_main=yes
    4693 else
    4694   echo "$as_me: failed program was:" >&5
    4695 sed 's/^/| /' conftest.$ac_ext >&5
    4696 
    4697         ac_cv_lib_pthread_main=no
    4698 fi
    4699 
    4700 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
    4701       conftest$ac_exeext conftest.$ac_ext
    4702 LIBS=$ac_check_lib_save_LIBS
    4703 fi
    4704 { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&5
    4705 echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; }
    4706 if test $ac_cv_lib_pthread_main = yes; then
    4707   cat >>confdefs.h <<_ACEOF
    4708 #define HAVE_LIBPTHREAD 1
    4709 _ACEOF
    4710 
    4711   LIBS="-lpthread $LIBS"
    4712 
    4713 fi
    4714 
    4715 
    4716 
    4717 
    4718 
    4719 
    4720 
    4721 ac_header_dirent=no
    4722 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do
    4723   as_ac_Header=`echo "ac_cv_header_dirent_$ac_hdr" | $as_tr_sh`
    4724 { echo "$as_me:$LINENO: checking for $ac_hdr that defines DIR" >&5
    4725 echo $ECHO_N "checking for $ac_hdr that defines DIR... $ECHO_C" >&6; }
    4726 if { as_var=$as_ac_Header; eval "test \"\${$as_var+set}\" = set"; }; then
    4727   echo $ECHO_N "(cached) $ECHO_C" >&6
    4728 else
    4729   cat >conftest.$ac_ext <<_ACEOF
    4730 /* confdefs.h.  */
    4731 _ACEOF
    4732 cat confdefs.h >>conftest.$ac_ext
    4733 cat >>conftest.$ac_ext <<_ACEOF
    4734 /* end confdefs.h.  */
    4735 #include <sys/types.h>
    4736 #include <$ac_hdr>
    4737 
    4738 int
    4739 main ()
    4740 {
    4741 if ((DIR *) 0)
    4742 return 0;
    4743   ;
    4744   return 0;
    4745 }
    4746 _ACEOF
    4747 rm -f conftest.$ac_objext
    4748 if { (ac_try="$ac_compile"
    4749 case "(($ac_try" in
    4750   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    4751   *) ac_try_echo=$ac_try;;
    4752 esac
    4753 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    4754   (eval "$ac_compile") 2>conftest.er1
    4755   ac_status=$?
    4756   grep -v '^ *+' conftest.er1 >conftest.err
    4757   rm -f conftest.er1
    4758   cat conftest.err >&5
    4759   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    4760   (exit $ac_status); } && {
    4761          test -z "$ac_c_werror_flag" ||
    4762          test ! -s conftest.err
    4763        } && test -s conftest.$ac_objext; then
    4764   eval "$as_ac_Header=yes"
    4765 else
    4766   echo "$as_me: failed program was:" >&5
    4767 sed 's/^/| /' conftest.$ac_ext >&5
    4768 
    4769         eval "$as_ac_Header=no"
    4770 fi
    4771 
    4772 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    4773 fi
    4774 ac_res=`eval echo '${'$as_ac_Header'}'`
    4775                { echo "$as_me:$LINENO: result: $ac_res" >&5
    4776 echo "${ECHO_T}$ac_res" >&6; }
    4777 if test `eval echo '${'$as_ac_Header'}'` = yes; then
    4778   cat >>confdefs.h <<_ACEOF
    4779 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 1
    4780 _ACEOF
    4781 
    4782 ac_header_dirent=$ac_hdr; break
    4783 fi
    4784 
    4785 done
    4786 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.
    4787 if test $ac_header_dirent = dirent.h; then
    4788   { echo "$as_me:$LINENO: checking for library containing opendir" >&5
    4789 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
    4790 if test "${ac_cv_search_opendir+set}" = set; then
    4791   echo $ECHO_N "(cached) $ECHO_C" >&6
    4792 else
    4793   ac_func_search_save_LIBS=$LIBS
    4794 cat >conftest.$ac_ext <<_ACEOF
    4795 /* confdefs.h.  */
    4796 _ACEOF
    4797 cat confdefs.h >>conftest.$ac_ext
    4798 cat >>conftest.$ac_ext <<_ACEOF
    4799 /* end confdefs.h.  */
    4800 
    4801 /* Override any GCC internal prototype to avoid an error.
    4802    Use char because int might match the return type of a GCC
    4803    builtin and then its argument prototype would still apply.  */
    4804 #ifdef __cplusplus
    4805 extern "C"
    4806 #endif
    4807 char opendir ();
    4808 int
    4809 main ()
    4810 {
    4811 return opendir ();
    4812   ;
    4813   return 0;
    4814 }
    4815 _ACEOF
    4816 for ac_lib in '' dir; do
    4817   if test -z "$ac_lib"; then
    4818     ac_res="none required"
    4819   else
    4820     ac_res=-l$ac_lib
    4821     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
    4822   fi
    4823   rm -f conftest.$ac_objext conftest$ac_exeext
    4824 if { (ac_try="$ac_link"
    4825 case "(($ac_try" in
    4826   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    4827   *) ac_try_echo=$ac_try;;
    4828 esac
    4829 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    4830   (eval "$ac_link") 2>conftest.er1
    4831   ac_status=$?
    4832   grep -v '^ *+' conftest.er1 >conftest.err
    4833   rm -f conftest.er1
    4834   cat conftest.err >&5
    4835   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    4836   (exit $ac_status); } && {
    4837          test -z "$ac_c_werror_flag" ||
    4838          test ! -s conftest.err
    4839        } && test -s conftest$ac_exeext &&
    4840        $as_test_x conftest$ac_exeext; then
    4841   ac_cv_search_opendir=$ac_res
    4842 else
    4843   echo "$as_me: failed program was:" >&5
    4844 sed 's/^/| /' conftest.$ac_ext >&5
    4845 
    4846 
    4847 fi
    4848 
    4849 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
    4850       conftest$ac_exeext
    4851   if test "${ac_cv_search_opendir+set}" = set; then
    4852   break
    4853 fi
    4854 done
    4855 if test "${ac_cv_search_opendir+set}" = set; then
    4856   :
    4857 else
    4858   ac_cv_search_opendir=no
    4859 fi
    4860 rm conftest.$ac_ext
    4861 LIBS=$ac_func_search_save_LIBS
    4862 fi
    4863 { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
    4864 echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
    4865 ac_res=$ac_cv_search_opendir
    4866 if test "$ac_res" != no; then
    4867   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
    4868 
    4869 fi
    4870 
    4871 else
    4872   { echo "$as_me:$LINENO: checking for library containing opendir" >&5
    4873 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }
    4874 if test "${ac_cv_search_opendir+set}" = set; then
    4875   echo $ECHO_N "(cached) $ECHO_C" >&6
    4876 else
    4877   ac_func_search_save_LIBS=$LIBS
    4878 cat >conftest.$ac_ext <<_ACEOF
    4879 /* confdefs.h.  */
    4880 _ACEOF
    4881 cat confdefs.h >>conftest.$ac_ext
    4882 cat >>conftest.$ac_ext <<_ACEOF
    4883 /* end confdefs.h.  */
    4884 
    4885 /* Override any GCC internal prototype to avoid an error.
    4886    Use char because int might match the return type of a GCC
    4887    builtin and then its argument prototype would still apply.  */
    4888 #ifdef __cplusplus
    4889 extern "C"
    4890 #endif
    4891 char opendir ();
    4892 int
    4893 main ()
    4894 {
    4895 return opendir ();
    4896   ;
    4897   return 0;
    4898 }
    4899 _ACEOF
    4900 for ac_lib in '' x; do
    4901   if test -z "$ac_lib"; then
    4902     ac_res="none required"
    4903   else
    4904     ac_res=-l$ac_lib
    4905     LIBS="-l$ac_lib  $ac_func_search_save_LIBS"
    4906   fi
    4907   rm -f conftest.$ac_objext conftest$ac_exeext
    4908 if { (ac_try="$ac_link"
    4909 case "(($ac_try" in
    4910   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    4911   *) ac_try_echo=$ac_try;;
    4912 esac
    4913 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    4914   (eval "$ac_link") 2>conftest.er1
    4915   ac_status=$?
    4916   grep -v '^ *+' conftest.er1 >conftest.err
    4917   rm -f conftest.er1
    4918   cat conftest.err >&5
    4919   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    4920   (exit $ac_status); } && {
    4921          test -z "$ac_c_werror_flag" ||
    4922          test ! -s conftest.err
    4923        } && test -s conftest$ac_exeext &&
    4924        $as_test_x conftest$ac_exeext; then
    4925   ac_cv_search_opendir=$ac_res
    4926 else
    4927   echo "$as_me: failed program was:" >&5
    4928 sed 's/^/| /' conftest.$ac_ext >&5
    4929 
    4930 
    4931 fi
    4932 
    4933 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
    4934       conftest$ac_exeext
    4935   if test "${ac_cv_search_opendir+set}" = set; then
    4936   break
    4937 fi
    4938 done
    4939 if test "${ac_cv_search_opendir+set}" = set; then
    4940   :
    4941 else
    4942   ac_cv_search_opendir=no
    4943 fi
    4944 rm conftest.$ac_ext
    4945 LIBS=$ac_func_search_save_LIBS
    4946 fi
    4947 { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&5
    4948 echo "${ECHO_T}$ac_cv_search_opendir" >&6; }
    4949 ac_res=$ac_cv_search_opendir
    4950 if test "$ac_res" != no; then
    4951   test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"
    4952 
    4953 fi
    4954 
    4955 fi
    4956 
    49574443ac_ext=c
    49584444ac_cpp='$CPP $CPPFLAGS'
     
    53604846fi
    53614847
    5362 { echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&5
    5363 echo $ECHO_N "checking for sys/wait.h that is POSIX.1 compatible... $ECHO_C" >&6; }
    5364 if test "${ac_cv_header_sys_wait_h+set}" = set; then
    5365   echo $ECHO_N "(cached) $ECHO_C" >&6
    5366 else
    5367   cat >conftest.$ac_ext <<_ACEOF
    5368 /* confdefs.h.  */
    5369 _ACEOF
    5370 cat confdefs.h >>conftest.$ac_ext
    5371 cat >>conftest.$ac_ext <<_ACEOF
    5372 /* end confdefs.h.  */
    5373 #include <sys/types.h>
    5374 #include <sys/wait.h>
    5375 #ifndef WEXITSTATUS
    5376 # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)
    5377 #endif
    5378 #ifndef WIFEXITED
    5379 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)
    5380 #endif
    5381 
    5382 int
    5383 main ()
    5384 {
    5385   int s;
    5386   wait (&s);
    5387   s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;
    5388   ;
    5389   return 0;
    5390 }
    5391 _ACEOF
    5392 rm -f conftest.$ac_objext
    5393 if { (ac_try="$ac_compile"
    5394 case "(($ac_try" in
    5395   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    5396   *) ac_try_echo=$ac_try;;
    5397 esac
    5398 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    5399   (eval "$ac_compile") 2>conftest.er1
    5400   ac_status=$?
    5401   grep -v '^ *+' conftest.er1 >conftest.err
    5402   rm -f conftest.er1
    5403   cat conftest.err >&5
    5404   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    5405   (exit $ac_status); } && {
    5406          test -z "$ac_c_werror_flag" ||
    5407          test ! -s conftest.err
    5408        } && test -s conftest.$ac_objext; then
    5409   ac_cv_header_sys_wait_h=yes
    5410 else
    5411   echo "$as_me: failed program was:" >&5
    5412 sed 's/^/| /' conftest.$ac_ext >&5
    5413 
    5414         ac_cv_header_sys_wait_h=no
    5415 fi
    5416 
    5417 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    5418 fi
    5419 { echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&5
    5420 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }
    5421 if test $ac_cv_header_sys_wait_h = yes; then
    5422 
    5423 cat >>confdefs.h <<\_ACEOF
    5424 #define HAVE_SYS_WAIT_H 1
    5425 _ACEOF
    5426 
    5427 fi
    5428 
    54294848# On IRIX 5.3, sys/types and inttypes.h are conflicting.
    54304849
     
    55034922
    55044923
    5505 
    5506 for ac_header in fcntl.h limits.h strings.h sys/file.h sys/time.h unistd.h getopt.h stdio.h
     4924for ac_header in string.h errno.h unistd.h stdio.h stdlib.h sys/stat.h sys/types.h
    55074925do
    55084926as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh`
     
    56495067
    56505068
    5651 { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5
    5652 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }
    5653 if test "${ac_cv_c_const+set}" = set; then
    5654   echo $ECHO_N "(cached) $ECHO_C" >&6
    5655 else
    5656   cat >conftest.$ac_ext <<_ACEOF
    5657 /* confdefs.h.  */
    5658 _ACEOF
    5659 cat confdefs.h >>conftest.$ac_ext
    5660 cat >>conftest.$ac_ext <<_ACEOF
    5661 /* end confdefs.h.  */
    5662 
    5663 int
    5664 main ()
    5665 {
    5666 /* FIXME: Include the comments suggested by Paul. */
    5667 #ifndef __cplusplus
    5668   /* Ultrix mips cc rejects this.  */
    5669   typedef int charset[2];
    5670   const charset cs;
    5671   /* SunOS 4.1.1 cc rejects this.  */
    5672   char const *const *pcpcc;
    5673   char **ppc;
    5674   /* NEC SVR4.0.2 mips cc rejects this.  */
    5675   struct point {int x, y;};
    5676   static struct point const zero = {0,0};
    5677   /* AIX XL C 1.02.0.0 rejects this.
    5678      It does not let you subtract one const X* pointer from another in
    5679      an arm of an if-expression whose if-part is not a constant
    5680      expression */
    5681   const char *g = "string";
    5682   pcpcc = &g + (g ? g-g : 0);
    5683   /* HPUX 7.0 cc rejects these. */
    5684   ++pcpcc;
    5685   ppc = (char**) pcpcc;
    5686   pcpcc = (char const *const *) ppc;
    5687   { /* SCO 3.2v4 cc rejects this.  */
    5688     char *t;
    5689     char const *s = 0 ? (char *) 0 : (char const *) 0;
    5690 
    5691     *t++ = 0;
    5692     if (s) return 0;
    5693   }
    5694   { /* Someone thinks the Sun supposedly-ANSI compiler will reject this.  */
    5695     int x[] = {25, 17};
    5696     const int *foo = &x[0];
    5697     ++foo;
    5698   }
    5699   { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */
    5700     typedef const int *iptr;
    5701     iptr p = 0;
    5702     ++p;
    5703   }
    5704   { /* AIX XL C 1.02.0.0 rejects this saying
    5705        "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */
    5706     struct s { int j; const int *ap[3]; };
    5707     struct s *b; b->j = 5;
    5708   }
    5709   { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */
    5710     const int foo = 10;
    5711     if (!foo) return 0;
    5712   }
    5713   return !cs[0] && !zero.x;
    5714 #endif
    5715 
    5716   ;
    5717   return 0;
    5718 }
    5719 _ACEOF
    5720 rm -f conftest.$ac_objext
    5721 if { (ac_try="$ac_compile"
    5722 case "(($ac_try" in
    5723   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    5724   *) ac_try_echo=$ac_try;;
    5725 esac
    5726 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    5727   (eval "$ac_compile") 2>conftest.er1
    5728   ac_status=$?
    5729   grep -v '^ *+' conftest.er1 >conftest.err
    5730   rm -f conftest.er1
    5731   cat conftest.err >&5
    5732   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    5733   (exit $ac_status); } && {
    5734          test -z "$ac_c_werror_flag" ||
    5735          test ! -s conftest.err
    5736        } && test -s conftest.$ac_objext; then
    5737   ac_cv_c_const=yes
    5738 else
    5739   echo "$as_me: failed program was:" >&5
    5740 sed 's/^/| /' conftest.$ac_ext >&5
    5741 
    5742         ac_cv_c_const=no
    5743 fi
    5744 
    5745 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    5746 fi
    5747 { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5
    5748 echo "${ECHO_T}$ac_cv_c_const" >&6; }
    5749 if test $ac_cv_c_const = no; then
    5750 
    5751 cat >>confdefs.h <<\_ACEOF
    5752 #define const
    5753 _ACEOF
    5754 
    5755 fi
    5756 
    5757 { echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&5
    5758 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; }
    5759 if test "${ac_cv_type_uid_t+set}" = set; then
    5760   echo $ECHO_N "(cached) $ECHO_C" >&6
    5761 else
    5762   cat >conftest.$ac_ext <<_ACEOF
    5763 /* confdefs.h.  */
    5764 _ACEOF
    5765 cat confdefs.h >>conftest.$ac_ext
    5766 cat >>conftest.$ac_ext <<_ACEOF
    5767 /* end confdefs.h.  */
    5768 #include <sys/types.h>
    5769 
    5770 _ACEOF
    5771 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
    5772   $EGREP "uid_t" >/dev/null 2>&1; then
    5773   ac_cv_type_uid_t=yes
    5774 else
    5775   ac_cv_type_uid_t=no
    5776 fi
    5777 rm -f conftest*
    5778 
    5779 fi
    5780 { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&5
    5781 echo "${ECHO_T}$ac_cv_type_uid_t" >&6; }
    5782 if test $ac_cv_type_uid_t = no; then
    5783 
    5784 cat >>confdefs.h <<\_ACEOF
    5785 #define uid_t int
    5786 _ACEOF
    5787 
    5788 
    5789 cat >>confdefs.h <<\_ACEOF
    5790 #define gid_t int
    5791 _ACEOF
    5792 
    5793 fi
    5794 
    5795 { echo "$as_me:$LINENO: checking for mode_t" >&5
    5796 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; }
    5797 if test "${ac_cv_type_mode_t+set}" = set; then
    5798   echo $ECHO_N "(cached) $ECHO_C" >&6
    5799 else
    5800   cat >conftest.$ac_ext <<_ACEOF
    5801 /* confdefs.h.  */
    5802 _ACEOF
    5803 cat confdefs.h >>conftest.$ac_ext
    5804 cat >>conftest.$ac_ext <<_ACEOF
    5805 /* end confdefs.h.  */
    5806 $ac_includes_default
    5807 typedef mode_t ac__type_new_;
    5808 int
    5809 main ()
    5810 {
    5811 if ((ac__type_new_ *) 0)
    5812   return 0;
    5813 if (sizeof (ac__type_new_))
    5814   return 0;
    5815   ;
    5816   return 0;
    5817 }
    5818 _ACEOF
    5819 rm -f conftest.$ac_objext
    5820 if { (ac_try="$ac_compile"
    5821 case "(($ac_try" in
    5822   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    5823   *) ac_try_echo=$ac_try;;
    5824 esac
    5825 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    5826   (eval "$ac_compile") 2>conftest.er1
    5827   ac_status=$?
    5828   grep -v '^ *+' conftest.er1 >conftest.err
    5829   rm -f conftest.er1
    5830   cat conftest.err >&5
    5831   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    5832   (exit $ac_status); } && {
    5833          test -z "$ac_c_werror_flag" ||
    5834          test ! -s conftest.err
    5835        } && test -s conftest.$ac_objext; then
    5836   ac_cv_type_mode_t=yes
    5837 else
    5838   echo "$as_me: failed program was:" >&5
    5839 sed 's/^/| /' conftest.$ac_ext >&5
    5840 
    5841         ac_cv_type_mode_t=no
    5842 fi
    5843 
    5844 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    5845 fi
    5846 { echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&5
    5847 echo "${ECHO_T}$ac_cv_type_mode_t" >&6; }
    5848 if test $ac_cv_type_mode_t = yes; then
    5849   :
    5850 else
    5851 
    5852 cat >>confdefs.h <<_ACEOF
    5853 #define mode_t int
    5854 _ACEOF
    5855 
    5856 fi
    5857 
    5858 { echo "$as_me:$LINENO: checking for size_t" >&5
    5859 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }
    5860 if test "${ac_cv_type_size_t+set}" = set; then
    5861   echo $ECHO_N "(cached) $ECHO_C" >&6
    5862 else
    5863   cat >conftest.$ac_ext <<_ACEOF
    5864 /* confdefs.h.  */
    5865 _ACEOF
    5866 cat confdefs.h >>conftest.$ac_ext
    5867 cat >>conftest.$ac_ext <<_ACEOF
    5868 /* end confdefs.h.  */
    5869 $ac_includes_default
    5870 typedef size_t ac__type_new_;
    5871 int
    5872 main ()
    5873 {
    5874 if ((ac__type_new_ *) 0)
    5875   return 0;
    5876 if (sizeof (ac__type_new_))
    5877   return 0;
    5878   ;
    5879   return 0;
    5880 }
    5881 _ACEOF
    5882 rm -f conftest.$ac_objext
    5883 if { (ac_try="$ac_compile"
    5884 case "(($ac_try" in
    5885   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    5886   *) ac_try_echo=$ac_try;;
    5887 esac
    5888 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    5889   (eval "$ac_compile") 2>conftest.er1
    5890   ac_status=$?
    5891   grep -v '^ *+' conftest.er1 >conftest.err
    5892   rm -f conftest.er1
    5893   cat conftest.err >&5
    5894   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    5895   (exit $ac_status); } && {
    5896          test -z "$ac_c_werror_flag" ||
    5897          test ! -s conftest.err
    5898        } && test -s conftest.$ac_objext; then
    5899   ac_cv_type_size_t=yes
    5900 else
    5901   echo "$as_me: failed program was:" >&5
    5902 sed 's/^/| /' conftest.$ac_ext >&5
    5903 
    5904         ac_cv_type_size_t=no
    5905 fi
    5906 
    5907 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    5908 fi
    5909 { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&5
    5910 echo "${ECHO_T}$ac_cv_type_size_t" >&6; }
    5911 if test $ac_cv_type_size_t = yes; then
    5912   :
    5913 else
    5914 
    5915 cat >>confdefs.h <<_ACEOF
    5916 #define size_t unsigned int
    5917 _ACEOF
    5918 
    5919 fi
    5920 
    5921 
    5922 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
    5923 # for constant arguments.  Useless!
    5924 { echo "$as_me:$LINENO: checking for working alloca.h" >&5
    5925 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; }
    5926 if test "${ac_cv_working_alloca_h+set}" = set; then
    5927   echo $ECHO_N "(cached) $ECHO_C" >&6
    5928 else
    5929   cat >conftest.$ac_ext <<_ACEOF
    5930 /* confdefs.h.  */
    5931 _ACEOF
    5932 cat confdefs.h >>conftest.$ac_ext
    5933 cat >>conftest.$ac_ext <<_ACEOF
    5934 /* end confdefs.h.  */
    5935 #include <alloca.h>
    5936 int
    5937 main ()
    5938 {
    5939 char *p = (char *) alloca (2 * sizeof (int));
    5940                           if (p) return 0;
    5941   ;
    5942   return 0;
    5943 }
    5944 _ACEOF
    5945 rm -f conftest.$ac_objext conftest$ac_exeext
    5946 if { (ac_try="$ac_link"
    5947 case "(($ac_try" in
    5948   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    5949   *) ac_try_echo=$ac_try;;
    5950 esac
    5951 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    5952   (eval "$ac_link") 2>conftest.er1
    5953   ac_status=$?
    5954   grep -v '^ *+' conftest.er1 >conftest.err
    5955   rm -f conftest.er1
    5956   cat conftest.err >&5
    5957   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    5958   (exit $ac_status); } && {
    5959          test -z "$ac_c_werror_flag" ||
    5960          test ! -s conftest.err
    5961        } && test -s conftest$ac_exeext &&
    5962        $as_test_x conftest$ac_exeext; then
    5963   ac_cv_working_alloca_h=yes
    5964 else
    5965   echo "$as_me: failed program was:" >&5
    5966 sed 's/^/| /' conftest.$ac_ext >&5
    5967 
    5968         ac_cv_working_alloca_h=no
    5969 fi
    5970 
    5971 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
    5972       conftest$ac_exeext conftest.$ac_ext
    5973 fi
    5974 { echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&5
    5975 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; }
    5976 if test $ac_cv_working_alloca_h = yes; then
    5977 
    5978 cat >>confdefs.h <<\_ACEOF
    5979 #define HAVE_ALLOCA_H 1
    5980 _ACEOF
    5981 
    5982 fi
    5983 
    5984 { echo "$as_me:$LINENO: checking for alloca" >&5
    5985 echo $ECHO_N "checking for alloca... $ECHO_C" >&6; }
    5986 if test "${ac_cv_func_alloca_works+set}" = set; then
    5987   echo $ECHO_N "(cached) $ECHO_C" >&6
    5988 else
    5989   cat >conftest.$ac_ext <<_ACEOF
    5990 /* confdefs.h.  */
    5991 _ACEOF
    5992 cat confdefs.h >>conftest.$ac_ext
    5993 cat >>conftest.$ac_ext <<_ACEOF
    5994 /* end confdefs.h.  */
    5995 #ifdef __GNUC__
    5996 # define alloca __builtin_alloca
    5997 #else
    5998 # ifdef _MSC_VER
    5999 #  include <malloc.h>
    6000 #  define alloca _alloca
    6001 # else
    6002 #  ifdef HAVE_ALLOCA_H
    6003 #   include <alloca.h>
    6004 #  else
    6005 #   ifdef _AIX
    6006  #pragma alloca
    6007 #   else
    6008 #    ifndef alloca /* predefined by HP cc +Olibcalls */
    6009 char *alloca ();
    6010 #    endif
    6011 #   endif
    6012 #  endif
    6013 # endif
    6014 #endif
    6015 
    6016 int
    6017 main ()
    6018 {
    6019 char *p = (char *) alloca (1);
    6020                                     if (p) return 0;
    6021   ;
    6022   return 0;
    6023 }
    6024 _ACEOF
    6025 rm -f conftest.$ac_objext conftest$ac_exeext
    6026 if { (ac_try="$ac_link"
    6027 case "(($ac_try" in
    6028   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    6029   *) ac_try_echo=$ac_try;;
    6030 esac
    6031 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    6032   (eval "$ac_link") 2>conftest.er1
    6033   ac_status=$?
    6034   grep -v '^ *+' conftest.er1 >conftest.err
    6035   rm -f conftest.er1
    6036   cat conftest.err >&5
    6037   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6038   (exit $ac_status); } && {
    6039          test -z "$ac_c_werror_flag" ||
    6040          test ! -s conftest.err
    6041        } && test -s conftest$ac_exeext &&
    6042        $as_test_x conftest$ac_exeext; then
    6043   ac_cv_func_alloca_works=yes
    6044 else
    6045   echo "$as_me: failed program was:" >&5
    6046 sed 's/^/| /' conftest.$ac_ext >&5
    6047 
    6048         ac_cv_func_alloca_works=no
    6049 fi
    6050 
    6051 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
    6052       conftest$ac_exeext conftest.$ac_ext
    6053 fi
    6054 { echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&5
    6055 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; }
    6056 
    6057 if test $ac_cv_func_alloca_works = yes; then
    6058 
    6059 cat >>confdefs.h <<\_ACEOF
    6060 #define HAVE_ALLOCA 1
    6061 _ACEOF
    6062 
    6063 else
    6064   # The SVR3 libPW and SVR4 libucb both contain incompatible functions
    6065 # that cause trouble.  Some versions do not even contain alloca or
    6066 # contain a buggy version.  If you still want to use their alloca,
    6067 # use ar to extract alloca.o from them instead of compiling alloca.c.
    6068 
    6069 ALLOCA=\${LIBOBJDIR}alloca.$ac_objext
    6070 
    6071 cat >>confdefs.h <<\_ACEOF
    6072 #define C_ALLOCA 1
    6073 _ACEOF
    6074 
    6075 
    6076 { echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&5
    6077 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; }
    6078 if test "${ac_cv_os_cray+set}" = set; then
    6079   echo $ECHO_N "(cached) $ECHO_C" >&6
    6080 else
    6081   cat >conftest.$ac_ext <<_ACEOF
    6082 /* confdefs.h.  */
    6083 _ACEOF
    6084 cat confdefs.h >>conftest.$ac_ext
    6085 cat >>conftest.$ac_ext <<_ACEOF
    6086 /* end confdefs.h.  */
    6087 #if defined CRAY && ! defined CRAY2
    6088 webecray
    6089 #else
    6090 wenotbecray
    6091 #endif
    6092 
    6093 _ACEOF
    6094 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |
    6095   $EGREP "webecray" >/dev/null 2>&1; then
    6096   ac_cv_os_cray=yes
    6097 else
    6098   ac_cv_os_cray=no
    6099 fi
    6100 rm -f conftest*
    6101 
    6102 fi
    6103 { echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&5
    6104 echo "${ECHO_T}$ac_cv_os_cray" >&6; }
    6105 if test $ac_cv_os_cray = yes; then
    6106   for ac_func in _getb67 GETB67 getb67; do
    6107     as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
    6108 { echo "$as_me:$LINENO: checking for $ac_func" >&5
    6109 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
    6110 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
    6111   echo $ECHO_N "(cached) $ECHO_C" >&6
    6112 else
    6113   cat >conftest.$ac_ext <<_ACEOF
    6114 /* confdefs.h.  */
    6115 _ACEOF
    6116 cat confdefs.h >>conftest.$ac_ext
    6117 cat >>conftest.$ac_ext <<_ACEOF
    6118 /* end confdefs.h.  */
    6119 /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
    6120    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
    6121 #define $ac_func innocuous_$ac_func
    6122 
    6123 /* System header to define __stub macros and hopefully few prototypes,
    6124     which can conflict with char $ac_func (); below.
    6125     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    6126     <limits.h> exists even on freestanding compilers.  */
    6127 
    6128 #ifdef __STDC__
    6129 # include <limits.h>
    6130 #else
    6131 # include <assert.h>
    6132 #endif
    6133 
    6134 #undef $ac_func
    6135 
    6136 /* Override any GCC internal prototype to avoid an error.
    6137    Use char because int might match the return type of a GCC
    6138    builtin and then its argument prototype would still apply.  */
    6139 #ifdef __cplusplus
    6140 extern "C"
    6141 #endif
    6142 char $ac_func ();
    6143 /* The GNU C library defines this for functions which it implements
    6144     to always fail with ENOSYS.  Some functions are actually named
    6145     something starting with __ and the normal name is an alias.  */
    6146 #if defined __stub_$ac_func || defined __stub___$ac_func
    6147 choke me
    6148 #endif
    6149 
    6150 int
    6151 main ()
    6152 {
    6153 return $ac_func ();
    6154   ;
    6155   return 0;
    6156 }
    6157 _ACEOF
    6158 rm -f conftest.$ac_objext conftest$ac_exeext
    6159 if { (ac_try="$ac_link"
    6160 case "(($ac_try" in
    6161   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    6162   *) ac_try_echo=$ac_try;;
    6163 esac
    6164 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    6165   (eval "$ac_link") 2>conftest.er1
    6166   ac_status=$?
    6167   grep -v '^ *+' conftest.er1 >conftest.err
    6168   rm -f conftest.er1
    6169   cat conftest.err >&5
    6170   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6171   (exit $ac_status); } && {
    6172          test -z "$ac_c_werror_flag" ||
    6173          test ! -s conftest.err
    6174        } && test -s conftest$ac_exeext &&
    6175        $as_test_x conftest$ac_exeext; then
    6176   eval "$as_ac_var=yes"
    6177 else
    6178   echo "$as_me: failed program was:" >&5
    6179 sed 's/^/| /' conftest.$ac_ext >&5
    6180 
    6181         eval "$as_ac_var=no"
    6182 fi
    6183 
    6184 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
    6185       conftest$ac_exeext conftest.$ac_ext
    6186 fi
    6187 ac_res=`eval echo '${'$as_ac_var'}'`
    6188                { echo "$as_me:$LINENO: result: $ac_res" >&5
    6189 echo "${ECHO_T}$ac_res" >&6; }
    6190 if test `eval echo '${'$as_ac_var'}'` = yes; then
    6191 
    6192 cat >>confdefs.h <<_ACEOF
    6193 #define CRAY_STACKSEG_END $ac_func
    6194 _ACEOF
    6195 
    6196     break
    6197 fi
    6198 
    6199   done
    6200 fi
    6201 
    6202 { echo "$as_me:$LINENO: checking stack direction for C alloca" >&5
    6203 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; }
    6204 if test "${ac_cv_c_stack_direction+set}" = set; then
    6205   echo $ECHO_N "(cached) $ECHO_C" >&6
    6206 else
    6207   if test "$cross_compiling" = yes; then
    6208   ac_cv_c_stack_direction=0
    6209 else
    6210   cat >conftest.$ac_ext <<_ACEOF
    6211 /* confdefs.h.  */
    6212 _ACEOF
    6213 cat confdefs.h >>conftest.$ac_ext
    6214 cat >>conftest.$ac_ext <<_ACEOF
    6215 /* end confdefs.h.  */
    6216 $ac_includes_default
    6217 int
    6218 find_stack_direction ()
    6219 {
    6220   static char *addr = 0;
    6221   auto char dummy;
    6222   if (addr == 0)
    6223     {
    6224       addr = &dummy;
    6225       return find_stack_direction ();
    6226     }
    6227   else
    6228     return (&dummy > addr) ? 1 : -1;
    6229 }
    6230 
    6231 int
    6232 main ()
    6233 {
    6234   return find_stack_direction () < 0;
    6235 }
    6236 _ACEOF
    6237 rm -f conftest$ac_exeext
    6238 if { (ac_try="$ac_link"
    6239 case "(($ac_try" in
    6240   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    6241   *) ac_try_echo=$ac_try;;
    6242 esac
    6243 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    6244   (eval "$ac_link") 2>&5
    6245   ac_status=$?
    6246   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6247   (exit $ac_status); } && { ac_try='./conftest$ac_exeext'
    6248   { (case "(($ac_try" in
    6249   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    6250   *) ac_try_echo=$ac_try;;
    6251 esac
    6252 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    6253   (eval "$ac_try") 2>&5
    6254   ac_status=$?
    6255   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6256   (exit $ac_status); }; }; then
    6257   ac_cv_c_stack_direction=1
    6258 else
    6259   echo "$as_me: program exited with status $ac_status" >&5
    6260 echo "$as_me: failed program was:" >&5
    6261 sed 's/^/| /' conftest.$ac_ext >&5
    6262 
    6263 ( exit $ac_status )
    6264 ac_cv_c_stack_direction=-1
    6265 fi
    6266 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext
    6267 fi
    6268 
    6269 
    6270 fi
    6271 { echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&5
    6272 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; }
    6273 
    6274 cat >>confdefs.h <<_ACEOF
    6275 #define STACK_DIRECTION $ac_cv_c_stack_direction
    6276 _ACEOF
    6277 
    6278 
    6279 fi
    6280 
    6281 { echo "$as_me:$LINENO: checking return type of signal handlers" >&5
    6282 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }
    6283 if test "${ac_cv_type_signal+set}" = set; then
    6284   echo $ECHO_N "(cached) $ECHO_C" >&6
    6285 else
    6286   cat >conftest.$ac_ext <<_ACEOF
    6287 /* confdefs.h.  */
    6288 _ACEOF
    6289 cat confdefs.h >>conftest.$ac_ext
    6290 cat >>conftest.$ac_ext <<_ACEOF
    6291 /* end confdefs.h.  */
    6292 #include <sys/types.h>
    6293 #include <signal.h>
    6294 
    6295 int
    6296 main ()
    6297 {
    6298 return *(signal (0, 0)) (0) == 1;
    6299   ;
    6300   return 0;
    6301 }
    6302 _ACEOF
    6303 rm -f conftest.$ac_objext
    6304 if { (ac_try="$ac_compile"
    6305 case "(($ac_try" in
    6306   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    6307   *) ac_try_echo=$ac_try;;
    6308 esac
    6309 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    6310   (eval "$ac_compile") 2>conftest.er1
    6311   ac_status=$?
    6312   grep -v '^ *+' conftest.er1 >conftest.err
    6313   rm -f conftest.er1
    6314   cat conftest.err >&5
    6315   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6316   (exit $ac_status); } && {
    6317          test -z "$ac_c_werror_flag" ||
    6318          test ! -s conftest.err
    6319        } && test -s conftest.$ac_objext; then
    6320   ac_cv_type_signal=int
    6321 else
    6322   echo "$as_me: failed program was:" >&5
    6323 sed 's/^/| /' conftest.$ac_ext >&5
    6324 
    6325         ac_cv_type_signal=void
    6326 fi
    6327 
    6328 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    6329 fi
    6330 { echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&5
    6331 echo "${ECHO_T}$ac_cv_type_signal" >&6; }
    6332 
    6333 cat >>confdefs.h <<_ACEOF
    6334 #define RETSIGTYPE $ac_cv_type_signal
    6335 _ACEOF
    6336 
    6337 
    6338 
    6339 
    6340 
    6341 
    6342 
    6343 
    6344 
    6345 
    6346 for ac_func in getcwd mkdir regcomp rmdir strdup strerror strspn strstr
    6347 do
    6348 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`
    6349 { echo "$as_me:$LINENO: checking for $ac_func" >&5
    6350 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }
    6351 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then
    6352   echo $ECHO_N "(cached) $ECHO_C" >&6
    6353 else
    6354   cat >conftest.$ac_ext <<_ACEOF
    6355 /* confdefs.h.  */
    6356 _ACEOF
    6357 cat confdefs.h >>conftest.$ac_ext
    6358 cat >>conftest.$ac_ext <<_ACEOF
    6359 /* end confdefs.h.  */
    6360 /* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func.
    6361    For example, HP-UX 11i <limits.h> declares gettimeofday.  */
    6362 #define $ac_func innocuous_$ac_func
    6363 
    6364 /* System header to define __stub macros and hopefully few prototypes,
    6365     which can conflict with char $ac_func (); below.
    6366     Prefer <limits.h> to <assert.h> if __STDC__ is defined, since
    6367     <limits.h> exists even on freestanding compilers.  */
    6368 
    6369 #ifdef __STDC__
    6370 # include <limits.h>
    6371 #else
    6372 # include <assert.h>
    6373 #endif
    6374 
    6375 #undef $ac_func
    6376 
    6377 /* Override any GCC internal prototype to avoid an error.
    6378    Use char because int might match the return type of a GCC
    6379    builtin and then its argument prototype would still apply.  */
    6380 #ifdef __cplusplus
    6381 extern "C"
    6382 #endif
    6383 char $ac_func ();
    6384 /* The GNU C library defines this for functions which it implements
    6385     to always fail with ENOSYS.  Some functions are actually named
    6386     something starting with __ and the normal name is an alias.  */
    6387 #if defined __stub_$ac_func || defined __stub___$ac_func
    6388 choke me
    6389 #endif
    6390 
    6391 int
    6392 main ()
    6393 {
    6394 return $ac_func ();
    6395   ;
    6396   return 0;
    6397 }
    6398 _ACEOF
    6399 rm -f conftest.$ac_objext conftest$ac_exeext
    6400 if { (ac_try="$ac_link"
    6401 case "(($ac_try" in
    6402   *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;
    6403   *) ac_try_echo=$ac_try;;
    6404 esac
    6405 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&5
    6406   (eval "$ac_link") 2>conftest.er1
    6407   ac_status=$?
    6408   grep -v '^ *+' conftest.er1 >conftest.err
    6409   rm -f conftest.er1
    6410   cat conftest.err >&5
    6411   echo "$as_me:$LINENO: \$? = $ac_status" >&5
    6412   (exit $ac_status); } && {
    6413          test -z "$ac_c_werror_flag" ||
    6414          test ! -s conftest.err
    6415        } && test -s conftest$ac_exeext &&
    6416        $as_test_x conftest$ac_exeext; then
    6417   eval "$as_ac_var=yes"
    6418 else
    6419   echo "$as_me: failed program was:" >&5
    6420 sed 's/^/| /' conftest.$ac_ext >&5
    6421 
    6422         eval "$as_ac_var=no"
    6423 fi
    6424 
    6425 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \
    6426       conftest$ac_exeext conftest.$ac_ext
    6427 fi
    6428 ac_res=`eval echo '${'$as_ac_var'}'`
    6429                { echo "$as_me:$LINENO: result: $ac_res" >&5
    6430 echo "${ECHO_T}$ac_res" >&6; }
    6431 if test `eval echo '${'$as_ac_var'}'` = yes; then
    6432   cat >>confdefs.h <<_ACEOF
    6433 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 1
    6434 _ACEOF
    6435 
    6436 fi
    6437 done
    6438 
    6439 
    64405069# Check whether --enable-tbz2tool was given.
    64415070if test "${enable_tbz2tool+set}" = set; then
     
    64525081
    64535082
    6454 # Check whether --enable-missingos was given.
    6455 if test "${enable_missingos+set}" = set; then
    6456   enableval=$enable_missingos; case "${enableval}" in
    6457   yes)  enable_missingos=true;;
    6458   no)   enable_missingos=false;;
    6459   auto) enable_missingos=auto;;
    6460   *)    { { echo "$as_me:$LINENO: error: bad value ${enableval} for --enable-missingos" >&5
    6461 echo "$as_me: error: bad value ${enableval} for --enable-missingos" >&2;}
    6462    { (exit 1); exit 1; }; };;
    6463 esac
    6464 else
    6465   enable_missingos=auto
    6466 fi
    6467 
    6468 
    64695083# Check whether --enable-just-compiled-sources was given.
    64705084if test "${enable_just_compiled_sources+set}" = set; then
     
    64825096
    64835097
    6484 # Check whether --with-user was given.
    6485 if test "${with_user+set}" = set; then
    6486   withval=$with_user; case "${withval}" in
    6487   ""|yes) { { echo "$as_me:$LINENO: error: bad value ${withval} for --with-user" >&5
    6488 echo "$as_me: error: bad value ${withval} for --with-user" >&2;}
     5098# Check whether --with-portage-user was given.
     5099if test "${with_portage_user+set}" = set; then
     5100  withval=$with_portage_user; case "${withval}" in
     5101  ""|yes) { { echo "$as_me:$LINENO: error: bad value ${withval} for --with-portage-user" >&5
     5102echo "$as_me: error: bad value ${withval} for --with-portage-user" >&2;}
    64895103   { (exit 1); exit 1; }; };;
    64905104  *) portageuser="${withval}";;
     
    64965110
    64975111
    6498 # Check whether --with-group was given.
    6499 if test "${with_group+set}" = set; then
    6500   withval=$with_group; case "${withval}" in
    6501   ""|yes) { { echo "$as_me:$LINENO: error: bad value ${withval} for --with-group" >&5
    6502 echo "$as_me: error: bad value ${withval} for --with-group" >&2;}
     5112# Check whether --with-portage-group was given.
     5113if test "${with_portage_group+set}" = set; then
     5114  withval=$with_portage_group; case "${withval}" in
     5115  ""|yes) { { echo "$as_me:$LINENO: error: bad value ${withval} for --with-portage-group" >&5
     5116echo "$as_me: error: bad value ${withval} for --with-portage-group" >&2;}
    65035117   { (exit 1); exit 1; }; };;
    65045118  *) portagegroup="${withval}";;
     
    65065120else
    65075121  portagegroup="portage"
    6508 fi
    6509 
    6510 
    6511 
    6512 # Check whether --with-wheelgid was given.
    6513 if test "${with_wheelgid+set}" = set; then
    6514   withval=$with_wheelgid; case "${withval}" in
    6515   ""|yes) { { echo "$as_me:$LINENO: error: bad value ${withval} for --with-wheelgid" >&5
    6516 echo "$as_me: error: bad value ${withval} for --with-wheelgid" >&2;}
    6517    { (exit 1); exit 1; }; };;
    6518   *) wheelgid="${withval}";;
    6519 esac
    6520 else
    6521   wheelgid="0"
    65225122fi
    65235123
     
    65305130echo "$as_me: error: bad value ${withval} for --with-rootuser" >&2;}
    65315131   { (exit 1); exit 1; }; };;
    6532   *) rootuser=${withval}
    6533      rootuid=`id -u ${withval}`;;
    6534 esac
    6535 else
    6536   rootuser=root
     5132  *) rootuser=${withval};;
     5133esac
     5134else
     5135  rootuser=${portageuser}
    65375136fi
    65385137
     
    65505149   { (exit 1); exit 1; }; }
    65515150fi
     5151{ echo "$as_me:$LINENO: checking for group id of ${rootuser}" >&5
     5152echo $ECHO_N "checking for group id of ${rootuser}... $ECHO_C" >&6; }
     5153rootgid=`${XCU_ID} -g ${rootuser}`
     5154if [ `echo ${rootgid} | ${EGREP} '^[[:digit:]]+$'` ]
     5155then
     5156        { echo "$as_me:$LINENO: result: ${rootgid}" >&5
     5157echo "${ECHO_T}${rootgid}" >&6; }
     5158else
     5159        { { echo "$as_me:$LINENO: error: error finding the group id of ${rootuser}" >&5
     5160echo "$as_me: error: error finding the group id of ${rootuser}" >&2;}
     5161   { (exit 1); exit 1; }; }
     5162fi
    65525163
    65535164
     
    65705181
    65715182
    6572 
    6573 if test x$enable_missingos = xauto
    6574 then
    6575   pyver=`python -c 'import sys;print sys.version[0:3]';`
    6576   case ${pyver} in
    6577     2.4)  ;;
    6578     2.3)  ;;
    6579     2.2)  enable_missingos=true;;
    6580     *)    { echo "$as_me:$LINENO: WARNING: unable to determine python version, ${pyver}" >&5
    6581 echo "$as_me: WARNING: unable to determine python version, ${pyver}" >&2;};;
    6582   esac
    6583 fi
    65845183
    65855184{ echo "$as_me:$LINENO: checking for ARCH to be used" >&5
     
    66095208ac_config_files="$ac_config_files man/Makefile"
    66105209
    6611 ac_config_files="$ac_config_files src/python-missingos/Makefile"
    6612 
    66135210ac_config_files="$ac_config_files bin/Makefile"
    66145211
     
    66445241fi
    66455242
    6646  if test x$enable_missingos = xtrue; then
    6647   BUILD_MISSINGOS_TRUE=
    6648   BUILD_MISSINGOS_FALSE='#'
    6649 else
    6650   BUILD_MISSINGOS_TRUE='#'
    6651   BUILD_MISSINGOS_FALSE=
    6652 fi
    6653 
    6654 #AM_CONDITIONAL(BUILD_FILTER_ENV, test x$enable_filter_env = xtrue)
    66555243
    66565244{ echo "$as_me:$LINENO: checking for a list of variables known by configure" >&5
     
    68265414   { (exit 1); exit 1; }; }
    68275415fi
    6828 if test -z "${BUILD_MISSINGOS_TRUE}" && test -z "${BUILD_MISSINGOS_FALSE}"; then
    6829   { { echo "$as_me:$LINENO: error: conditional \"BUILD_MISSINGOS\" was never defined.
    6830 Usually this means the macro was only invoked conditionally." >&5
    6831 echo "$as_me: error: conditional \"BUILD_MISSINGOS\" was never defined.
    6832 Usually this means the macro was only invoked conditionally." >&2;}
    6833    { (exit 1); exit 1; }; }
    6834 fi
    68355416
    68365417: ${CONFIG_STATUS=./config.status}
     
    72915872    "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;;
    72925873    "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;;
    7293     "src/python-missingos/Makefile") CONFIG_FILES="$CONFIG_FILES src/python-missingos/Makefile" ;;
    72945874    "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;;
    72955875    "pym/Makefile") CONFIG_FILES="$CONFIG_FILES pym/Makefile" ;;
     
    74996079XARGS!$XARGS$ac_delim
    75006080CPP!$CPP$ac_delim
    7501 ALLOCA!$ALLOCA$ac_delim
    75026081portageuser!$portageuser$ac_delim
    75036082portagegroup!$portagegroup$ac_delim
    7504 wheelgid!$wheelgid$ac_delim
    75056083rootuser!$rootuser$ac_delim
    75066084rootuid!$rootuid$ac_delim
     6085rootgid!$rootgid$ac_delim
    75076086DOMAIN_PREFIX!$DOMAIN_PREFIX$ac_delim
    75086087DEFAULT_PATH!$DEFAULT_PATH$ac_delim
     
    75136092BUILD_TBZ2TOOL_TRUE!$BUILD_TBZ2TOOL_TRUE$ac_delim
    75146093BUILD_TBZ2TOOL_FALSE!$BUILD_TBZ2TOOL_FALSE$ac_delim
    7515 BUILD_MISSINGOS_TRUE!$BUILD_MISSINGOS_TRUE$ac_delim
    7516 BUILD_MISSINGOS_FALSE!$BUILD_MISSINGOS_FALSE$ac_delim
    75176094LIBOBJS!$LIBOBJS$ac_delim
    75186095LTLIBOBJS!$LTLIBOBJS$ac_delim
    75196096_ACEOF
    75206097
    7521   if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 23; then
     6098  if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 20; then
    75226099    break
    75236100  elif $ac_last_try; then
  • vendor/prefix-portage/current/configure.in

    r3488 r3509  
    4747GENTOO_PATH_GNUPROG(GREP, [grep])
    4848
    49 dnl Checks for libraries.
    50 dnl Replace `main' with a function in -lc:
    51 AC_CHECK_LIB(c, main)
    52 dnl Replace `main' with a function in -ldl:
    53 AC_CHECK_LIB(dl, main)
    54 dnl Replace `main' with a function in -lgcc:
    55 AC_CHECK_LIB(gcc, main)
    56 dnl Replace `main' with a function in -lpthread:
    57 AC_CHECK_LIB(pthread, main)
    58 
    5949dnl Checks for header files.
    60 AC_HEADER_DIRENT
    6150AC_HEADER_STDC
    62 AC_HEADER_SYS_WAIT
    63 AC_CHECK_HEADERS(fcntl.h limits.h strings.h sys/file.h sys/time.h unistd.h getopt.h stdio.h)
    64 
    65 dnl Checks for typedefs, structures, and compiler characteristics.
    66 AC_C_CONST
    67 AC_TYPE_UID_T
    68 AC_TYPE_MODE_T
    69 AC_TYPE_SIZE_T
    70 
    71 dnl Checks for library functions.
    72 AC_FUNC_ALLOCA
    73 AC_TYPE_SIGNAL
    74 AC_CHECK_FUNCS(getcwd mkdir regcomp rmdir strdup strerror strspn strstr)
     51AC_CHECK_HEADERS([string.h errno.h unistd.h stdio.h stdlib.h sys/stat.h sys/types.h])
    7552
    7653AC_ARG_ENABLE(tbz2tool,
     
    8360[enable_tbz2tool=true])
    8461
    85 AC_ARG_ENABLE(missingos,
    86 AC_HELP_STRING([--enable-missingos],[build compatibility missingos code for python 2.2 (default auto)]),
    87 [case "${enableval}" in
    88   yes)  enable_missingos=true;;
    89   no)   enable_missingos=false;;
    90   auto) enable_missingos=auto;;
    91   *)    AC_MSG_ERROR(bad value ${enableval} for --enable-missingos);;
    92 esac],
    93 [enable_missingos=auto])
    94 
    9562AC_ARG_ENABLE(just-compiled-sources,
    9663AC_HELP_STRING([--enable-just-compiled-sources],[install just the bytecode, not the sources (default no)]),
     
    10269[enable_py_sources=true])
    10370
    104 AC_ARG_WITH(user,
    105 AC_HELP_STRING([--with-user=me],[use user 'me' for portage to work as (default portage)]),
     71AC_ARG_WITH(portage-user,
     72AC_HELP_STRING([--with-portage-user=myuser],[use user 'myuser' as portage owner (default portage)]),
    10673[case "${withval}" in
    107   ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-user);;
     74  ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-portage-user);;
    10875  *) portageuser="${withval}";;
    10976esac],
    11077[portageuser="portage"])
    11178
    112 AC_ARG_WITH(group,
    113 AC_HELP_STRING([--with-group=mygroup],[use group 'mygroup' for portage to work as (default portage)]),
     79AC_ARG_WITH(portage-group,
     80AC_HELP_STRING([--with-portage-group=mygroup],[use group 'mygroup' as portage users group (default portage)]),
    11481[case "${withval}" in
    115   ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-group);;
     82  ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-portage-group);;
    11683  *) portagegroup="${withval}";;
    11784esac],
    11885[portagegroup="portage"])
    11986
    120 AC_ARG_WITH(wheelgid,
    121 AC_HELP_STRING([--with-wheelgid=wheelgid],[let portage use 'wheelgid' as wheel group (default 0)]),
    122 [case "${withval}" in
    123   ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-wheelgid);;
    124   *) wheelgid="${withval}";;
    125 esac],
    126 [wheelgid="0"])
    127 
    12887AC_ARG_WITH(rootuser,
    129 AC_HELP_STRING([--with-rootuser=me],[declares 'me' as the portage owner (default root)]),
     88AC_HELP_STRING([--with-rootuser=myuser],[uses 'myuser' as owner of installed files (default is portage-user)]),
    13089[case "${withval}" in
    13190  ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-rootuser);;
    132   *) rootuser=${withval}
    133      rootuid=`id -u ${withval}`;;
     91  *) rootuser=${withval};;
    13492esac],
    135 [rootuser=root])
     93[rootuser=${portageuser}])
    13694
    13795AC_MSG_CHECKING([for user id of ${rootuser}])
     
    143101else
    144102        AC_MSG_ERROR([error finding the user id of ${rootuser}])
     103fi
     104AC_MSG_CHECKING([for group id of ${rootuser}])
     105rootgid=`${XCU_ID} -g ${rootuser}`
     106if [[ `echo ${rootgid} | ${EGREP} '^[[:digit:]]+$'` ]]
     107then
     108        AC_MSG_RESULT([${rootgid}])
     109else
     110        AC_MSG_ERROR([error finding the group id of ${rootuser}])
    145111fi
    146112
     
    156122[DEFAULT_PATH="${DEFAULT_PATH}"])
    157123
    158 
    159 if test x$enable_missingos = xauto
    160 then
    161   pyver=[`python -c 'import sys;print sys.version[0:3]';`]
    162   case ${pyver} in
    163     2.4)  ;;
    164     2.3)  ;;
    165     2.2)  enable_missingos=true;;
    166     *)    AC_MSG_WARN([unable to determine python version, ${pyver}]);;
    167   esac
    168 fi
    169124
    170125AC_MSG_CHECKING([for ARCH to be used])
     
    187142AC_CONFIG_FILES([ src/Makefile ])
    188143AC_CONFIG_FILES([ man/Makefile ])
    189 AC_CONFIG_FILES([ src/python-missingos/Makefile ])
    190144AC_CONFIG_FILES([ bin/Makefile ])
    191145AC_CONFIG_FILES([ pym/Makefile ])
     
    194148AC_SUBST(portageuser)
    195149AC_SUBST(portagegroup)
    196 AC_SUBST(wheelgid)
    197150AC_SUBST(rootuser)
    198151AC_SUBST(rootuid)
     152AC_SUBST(rootgid)
    199153AC_SUBST(DOMAIN_PREFIX)
    200154AC_SUBST(DEFAULT_PATH)
     
    203157AM_CONDITIONAL(INSTALL_PYTHON_SOURCES, test x$enable_py_sources = xtrue)
    204158AM_CONDITIONAL(BUILD_TBZ2TOOL, test x$enable_tbz2tool = xtrue)
    205 AM_CONDITIONAL(BUILD_MISSINGOS, test x$enable_missingos = xtrue)
    206 #AM_CONDITIONAL(BUILD_FILTER_ENV, test x$enable_filter_env = xtrue)
    207159
    208160AC_MSG_CHECKING([for a list of variables known by configure])
  • vendor/prefix-portage/current/depcomp

    • Property svn:executable set to *
  • vendor/prefix-portage/current/install-sh

    • Property svn:executable set to *
  • vendor/prefix-portage/current/ltmain.sh

    r3488 r3509  
    4444PROGRAM=ltmain.sh
    4545PACKAGE=libtool
    46 VERSION=1.5.23b
    47 TIMESTAMP=" (1.1220.2.437 2007/02/17 09:08:45)"
     46VERSION=1.5.24
     47TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)"
    4848
    4949# Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE).
     
    17061706      -no-install)
    17071707        case $host in
    1708         *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2*)
     1708        *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*)
    17091709          # The PATH hackery in wrapper scripts is required on Windows
    1710           # in order for the loader to find any dlls it needs.
     1710          # and Darwin in order for the loader to find any dlls it needs.
    17111711          $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2
    17121712          $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2
     
    32543254            ;;
    32553255          irix|nonstopux)
    3256             current=`expr $number_major + $number_minor - 1`
     3256            current=`expr $number_major + $number_minor`
    32573257            age="$number_minor"
    32583258            revision="$number_minor"
     3259            lt_irix_increment=no
    32593260            ;;
    32603261          esac
     
    33153316          # Darwin ld doesn't like 0 for these options...
    33163317          minor_current=`expr $current + 1`
    3317           verstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
     3318          xlcverstring="${wl}-compatibility_version ${wl}$minor_current ${wl}-current_version ${wl}$minor_current.$revision"
     3319          verstring="-compatibility_version $minor_current -current_version $minor_current.$revision"
    33183320          ;;
    33193321
     
    33293331
    33303332        irix | nonstopux)
    3331           major=`expr $current - $age + 1`
    3332 
     3333          if test "X$lt_irix_increment" = "Xno"; then
     3334            major=`expr $current - $age`
     3335          else
     3336            major=`expr $current - $age + 1`
     3337          fi
    33333338          case $version_type in
    33343339            nonstopux) verstring_prefix=nonstopux ;;
     
    65456550        eval "if test \"\${save_$lt_var+set}\" = set; then
    65466551                $lt_var=\$save_$lt_var; export $lt_var
    6547               else
    6548                 $lt_unset $lt_var
    65496552              fi"
    65506553      done
  • vendor/prefix-portage/current/man/Makefile.in

    r3488 r3509  
    5151DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    5252ACLOCAL = @ACLOCAL@
    53 ALLOCA = @ALLOCA@
    5453AMTAR = @AMTAR@
    5554ARCH = @ARCH@
     
    154153program_transform_name = @program_transform_name@
    155154psdir = @psdir@
     155rootgid = @rootgid@
    156156rootuid = @rootuid@
    157157rootuser = @rootuser@
     
    167167top_builddir = @top_builddir@
    168168top_srcdir = @top_srcdir@
    169 wheelgid = @wheelgid@
    170169man_MANS = dispatch-conf.1  \
    171170                ebuild.1  \
  • vendor/prefix-portage/current/man/ebuild.1

    r3488 r3509  
    1 .TH "EBUILD" "1" "Dec 2005" "Portage 2.1" "Portage"
     1.TH "EBUILD" "1" "Jun 2007" "Portage 2.1.3" "Portage"
    22.SH "NAME"
    33ebuild \- a low level interface to the Portage system
     
    179179.SH "FILES"
    180180.TP
    181 \fB/etc/make.conf\fR
     181.B /etc/make.conf
    182182Contains variables for the build\-process and overwrites those
    183183in make.globals.
     184.TP
     185.B /etc/portage/color.map
     186Contains variables customizing colors.
    184187.SH "SEE ALSO"
    185188.BR emerge (1),
    186189.BR ebuild (5),
    187 .BR make.conf (5)
     190.BR make.conf (5),
     191.BR color.map (5)
    188192.TP
    189193The \fI/usr/sbin/ebuild.sh\fR script.
  • vendor/prefix-portage/current/man/ebuild.5

    r3488 r3509  
    1 .TH "EBUILD" "5" "Jan 2007" "Portage 2.1.2" "Portage"
     1.TH "EBUILD" "5" "Jun 2007" "Portage 2.1.3" "Portage"
    22.SH "NAME"
    33ebuild \- the internal format, variables, and functions in an ebuild script
     
    321321\fBRESTRICT\fR = \fI[strip,mirror,fetch,userpriv]\fR
    322322This should be a space delimited list of portage features to restrict.
     323You may use conditional syntax to vary restrictions as seen above in DEPEND.
    323324.PD 0
    324325.RS
     
    331332see the \fBQA CONTROL VARIABLES\fR section for more specific exemptions.
    332333.TP
    333 .I confcache
    334 Prevent econf from using confcache.
     334.I bindist
     335Distribution of binary packages is restricted.
    335336.TP
    336337.I fetch
     
    869870Nicholas Jones <carpaski@gentoo.org>
    870871Mike Frysinger <vapier@gentoo.org>
    871 Arfrever Frehtes Taifersar Arahesis <FFTA@WP.PL>
     872Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@gmail.com>
    872873.fi
    873874.SH "FILES"
     
    877878The helper apps in \fI@PORTAGE_BASE@/bin\fR.
    878879.TP
    879 \fB/etc/make.conf\fR
     880.B /etc/make.conf
    880881Contains variables for the build\-process and overwrites those in make.defaults.
    881882.TP
    882 \fB/etc/make.globals\fR
     883.B /etc/make.globals
    883884Contains the default variables for the build\-process, you should edit
    884885\fI/etc/make.conf\fR instead.
     886.TP
     887.B /etc/portage/color.map
     888Contains variables customizing colors.
    885889.SH "SEE ALSO"
    886890.BR ebuild (1),
    887 .BR make.conf (5)
     891.BR make.conf (5),
     892.BR color.map (5)
  • vendor/prefix-portage/current/man/emerge.1

    r3488 r3509  
    1 .TH "EMERGE" "1" "Dec 2006" "Portage 2.1" "Portage"
     1.TH "EMERGE" "1" "Jun 2007" "Portage 2.1.3" "Portage"
    22.SH "NAME"
    33emerge \- Command\-line interface to the Portage system
     
    356356output from portage's displays.
    357357.TP
     358.BR "\-\-reinstall changed\-use"
     359Tells emerge to include installed packages where USE flags have
     360changed since installation.  Unlike \fB\-\-newuse\fR, this option does
     361not trigger reinstallation when flags that the user has not
     362enabled are added or removed.
     363.TP
    358364.BR "\-\-skipfirst"
    359365This option is only valid when used with \fB\-\-resume\fR.  It removes the
     
    573579listed below\fR.
    574580.TP
     581.B /etc/portage/color.map
     582Contains variables customizing colors.
     583.TP
    575584.B /etc/dispatch\-conf.conf
    576585Contains settings to handle automatic updates/backups of configuration
     
    605614.BR ebuild (5),
    606615.BR make.conf (5),
     616.BR color.map (5),
    607617.BR portage (5)
    608618.LP
  • vendor/prefix-portage/current/man/make.conf.5

    r3488 r3509  
    1 .TH "MAKE.CONF" "5" "Jan 2007" "Portage 2.1.2" "Portage"
     1.TH "MAKE.CONF" "5" "Jun 2007" "Portage 2.1.3" "Portage"
    22.SH "NAME"
    33make.conf \- custom settings for Portage
     
    9797.TP
    9898\fBDISTDIR\fR = \fI[path]\fR
    99 Defines the location of your local source file repository.
     99Defines the location of your local source file repository.  Note
     100that locations under /usr/portage are not necessarily safe for data storage.
     101See the \fBPORTDIR\fR documentation for more information.
    100102.br
    101103Defaults to /usr/portage/distfiles.
     
    271273\fBUSE\fR flag.
    272274.TP
     275.B unmerge-orphans
     276If a file is not claimed by another package in the same slot and it is not
     277protected by \fICONFIG_PROTECT\fR, unmerge it even if the modification time or
     278checksum differs from the file that was originally installed.
     279.TP
    273280.B userfetch
    274281When portage is run as root, drop privileges to portage:portage during the
     
    286293This variable contains the command used for fetching package sources from
    287294the internet.  It must contain the full path to the executable as well as the
    288 place\-holders \\${DISTDIR} and \\${URI}.
     295place\-holders \\${DISTDIR}, \\${FILE} and \\${URI}.  The command should be
     296written to place the fetched file at \\${DISTDIR}/\\${FILE}.
     297Also see \fBRESUMECOMMAND\fR.
    289298.TP
    290299\fBGENTOO_MIRRORS\fR = \fI[URLs]\fR
     
    319328.TP
    320329\fBPKGDIR\fR = \fI[path]\fR
    321 Defines the location where created .tbz2 binary packages will be stored.
     330Defines the location where created .tbz2 binary packages will be stored.  Note
     331that locations under /usr/portage are not necessarily safe for data storage.
     332See the \fBPORTDIR\fR documentation for more information.
    322333.br
    323334Defaults to /usr/portage/packages.
     
    325336.B PORT_LOGDIR
    326337This variable defines the directory in which per\-ebuild logs are kept.
    327 Logs are created only when this is set and writable.
     338Logs are created only when this is set. They are stored as
     339${CATEGORY}:${PF}:YYYYMMDD\-HHMMSS.log in the directory specified. If the
     340direcory does not exist, it will be created automatically and group permissions
     341will be applied to it.  If the directory already exists, portage will not
     342modify it's permissions.
    328343.TP
    329344\fBPORTAGE_BINHOST\fR = \fI"ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon\-xp/"\fR
     
    410425.TP
    411426\fBPORTDIR\fR = \fI[path]\fR
    412 Defines the location of your Portage tree.
     427Defines the location of the Portage tree. This is the repository for all
     428profile information as well as all ebuilds. If you change this, you must update
     429your /etc/make.profile symlink accordingly.
    413430.br
    414431Defaults to /usr/portage.
     
    416433\fB***Warning***\fR
    417434.br
    418 Storing data such as distfiles and binary packages in PORTDIR can
    419 be potentially dangerous. The default emerge configuration defaults to this
    420 behavior (which will work fine), however if you deviate from the default
    421 configuration by changing PKGDIR or DISTDIR, emerge \-\-sync may inadvertedly
    422 delete all your distfiles/binary packages. Please make sure to set
    423 \fBPORTAGE_EXTRA_RSYNC_OPTS\fR properly to insure the safety of files in PORTDIR.
     435Data stored inside \fBPORTDIR\fR is in peril of being overwritten or deleted by
     436the emerge \-\-sync command. The default value of
     437\fBPORTAGE_RSYNC_OPTS\fR will protect the default locations of
     438\fBDISTDIR\fR and \fBPKGDIR\fR, but users are warned that any other locations
     439inside \fBPORTDIR\fR are not necessarily safe for data storage.
    424440.TP
    425441\fBPORTDIR_OVERLAY\fR = \fI"[path] [different\-path] [etc...]"\fR
     
    445461This variable contains the command used for resuming package sources that
    446462have been partially downloaded.  It should be defined using the same format
    447 as \fBFETCHCOMMAND\fR.
     463as \fBFETCHCOMMAND\fR, and must include any additional option(s) that may
     464be necessary in order to continue a partially downloaded file located at
     465\\${DISTDIR}/\\${FILE}.
    448466.TP
    449467\fBROOT\fR = \fI[path]\fR
     
    517535.SH "FILES"
    518536.TP
    519 \fB/etc/make.conf\fR
     537.B /etc/make.conf
    520538Contains variables for the build\-process and overwrites those in make.defaults.
    521539.TP
    522 \fB/etc/make.globals\fR
     540.B /etc/make.globals
    523541Contains the default variables for the build\-process, you should edit \fI/etc/make.conf\fR instead.
    524542.TP
    525 \fB/usr/portage/profiles/use.desc\fR
     543.B /etc/portage/color.map
     544Contains variables customizing colors.
     545.TP
     546.B /usr/portage/profiles/use.desc
    526547Contains a list of all global USE flags.
    527548.TP
    528 \fB/usr/portage/profiles/use.local.desc\fR
     549.B /usr/portage/profiles/use.local.desc
    529550Contains a list of all local USE variables.
    530551.SH "SEE ALSO"
  • vendor/prefix-portage/current/man/portage.5

    r3488 r3509  
    1 .TH "PORTAGE" "5" "Dec 2005" "Portage 2.1" "Portage"
     1.TH "PORTAGE" "5" "Jun 2007" "Portage 2.1.3" "Portage"
    22.SH NAME
    33portage \- the heart of Gentoo
     
    4242.nf
    4343bashrc
     44color.map
    4445modules
    4546package.keywords
     
    366367any other bash script.
    367368.TP
     369.BR color.map
     370Contains variables customizing colors. See \fBcolor.map\fR(5).
     371.TP
    368372.BR modules
    369373This file can be used to override the metadata cache implementation.  In
     
    729733.BR ebuild (1),
    730734.BR ebuild (5),
    731 .BR make.conf (5)
     735.BR make.conf (5),
     736.BR color.map (5)
  • vendor/prefix-portage/current/missing

    • Property svn:executable set to *
  • vendor/prefix-portage/current/pym/emerge/__init__.py

    r3488 r3509  
    3232del os.environ["PORTAGE_LEGACY_GLOBALS"]
    3333from portage import digraph, portdbapi
    34 from portage.const import NEWS_LIB_PATH, CACHE_PATH
     34from portage.const import NEWS_LIB_PATH, CACHE_PATH, PRIVATE_PATH
    3535
    3636import emerge.help
     
    210210                if short_msg == None:
    211211                        short_msg = mystr
    212                 if "HOSTNAME" in os.environ.keys():
     212                if "HOSTNAME" in os.environ:
    213213                        short_msg = os.environ["HOSTNAME"]+": "+short_msg
    214214                xtermTitle(short_msg)
     
    345345        if "--update" in myopts or \
    346346                "--newuse" in myopts or \
     347                "--reinstall" in myopts or \
    347348                "--noreplace" in myopts or \
    348349                myaction in ("system", "world"):
     
    364365
    365366# search functionality
    366 class search:
     367class search(object):
    367368
    368369        #
     
    443444                                        self.matches["desc"].append([full_package,masked])
    444445                self.mlen=0
    445                 for mtype in self.matches.keys():
     446                for mtype in self.matches:
    446447                        self.matches[mtype].sort()
    447448                        self.mlen += len(self.matches[mtype])
     
    452453                print "[ Applications found : "+white(str(self.mlen))+" ]"
    453454                print " "
    454                 for mtype in self.matches.keys():
     455                for mtype in self.matches:
    455456                        for match,masked in self.matches[mtype]:
    456457                                if mtype=="pkg":
     
    588589                        #this doesn't match the package we're unmerging; keep it.
    589590                        newworldlist.append(x)
    590 
     591       
     592        newworldlist.sort()
     593       
    591594        portage.util.ensure_dirs(os.path.join(vardb.root, portage.PRIVATE_PATH),
    592595                gid=portage.portage_gid, mode=02770)
    593         portage.util.write_atomic(world_filename, "\n".join(newworldlist))
     596        portage.util.write_atomic(world_filename, "\n".join(newworldlist)+"\n")
    594597
    595598def genericdict(mylist):
     
    629632
    630633                MEDIUM   The upper boundary for medium dependencies.
     634                MEDIUM_SOFT   The upper boundary for medium-soft dependencies.
    631635                SOFT     The upper boundary for soft dependencies.
    632636                MIN      The lower boundary for soft dependencies.
    633637        """
    634         __slots__ = ("__weakref__", "satisfied", "buildtime", "runtime")
     638        __slots__ = ("__weakref__", "satisfied", "buildtime", "runtime", "runtime_post")
    635639        MEDIUM = -1
    636         SOFT   = -2
    637         MIN    = -4
     640        MEDIUM_SOFT = -2
     641        SOFT   = -3
     642        MIN    = -6
    638643        def __init__(self, **kwargs):
    639644                for myattr in self.__slots__:
     
    648653                        if self.runtime:
    649654                                return -1
     655                        if self.runtime_post:
     656                                return -2
    650657                if self.buildtime:
    651                         return -2
     658                        return -3
    652659                if self.runtime:
    653                         return -3
    654                 return -4
     660                        return -4
     661                if self.runtime_post:
     662                        return -5
     663                return -6
    655664        def __lt__(self, other):
    656665                return self.__int__() < other
     
    672681                if myvalue > self.MEDIUM:
    673682                        return "hard"
     683                if myvalue > self.MEDIUM_SOFT:
     684                        return "medium"
    674685                if myvalue > self.SOFT:
    675                         return "medium"
     686                        return "medium-soft"
    676687                return "soft"
    677688
     
    701712                                vdb_lock = portage.locks.lockdir(vdb_path)
    702713                        mykeys = ["SLOT", "COUNTER", "PROVIDE", "USE", "IUSE",
    703                                 "DEPEND", "RDEPEND", "PDEPEND"]
     714                                "DEPEND", "RDEPEND", "PDEPEND", "repository"]
    704715                        real_dbapi = real_vartree.dbapi
    705716                        slot_counters = {}
     
    912923        f.end_paragraph(1)
    913924
    914 class depgraph:
     925class depgraph(object):
    915926
    916927        pkg_tree_map = {
     
    934945                self._slot_node_map = {}
    935946                self.mydbapi = {}
    936                 self._mydbapi_keys = ["SLOT", "DEPEND", "RDEPEND", "PDEPEND"]
     947                self._mydbapi_keys = ["SLOT", "DEPEND", "RDEPEND", "PDEPEND",
     948                        "USE", "IUSE", "PROVIDE", "repository"]
    937949                self.useFlags = {}
    938950                self.trees = {}
     
    977989                self.orderedkeys=[]
    978990                self.outdatedpackages=[]
    979                 self.args_keys = []
     991                self._args_atoms = {}
     992                self._args_nodes = set()
     993                self._sets = {}
     994                self._sets_nodes = {}
    980995                self.blocker_digraph = digraph()
    981996                self.blocker_parents = {}
     
    10401055                f.end_paragraph(1)
    10411056                f.writer.flush()
     1057
     1058        def _reinstall_for_flags(self, forced_flags,
     1059                orig_use, orig_iuse, cur_use, cur_iuse):
     1060                if "--newuse" in self.myopts:
     1061                        if orig_iuse.symmetric_difference(
     1062                                cur_iuse).difference(forced_flags):
     1063                                return True
     1064                        elif orig_iuse.intersection(orig_use) != \
     1065                                cur_iuse.intersection(cur_use):
     1066                                return True
     1067                elif "changed-use" == self.myopts.get("--reinstall"):
     1068                        if orig_iuse.intersection(orig_use) != \
     1069                                cur_iuse.intersection(cur_use):
     1070                                return True
     1071                return False
    10421072
    10431073        def create(self, mybigkey, myparent=None, addme=1, myuse=None,
     
    10931123
    10941124                mydbapi = self.trees[myroot][self.pkg_tree_map[mytype]].dbapi
     1125                metadata = dict(izip(self._mydbapi_keys,
     1126                        mydbapi.aux_get(mykey, self._mydbapi_keys)))
     1127                if mytype == "ebuild":
     1128                        pkgsettings.setcpv(mykey, mydb=portdb)
     1129                        metadata["USE"] = pkgsettings["USE"]
     1130                        myuse = pkgsettings["USE"].split()
    10951131
    10961132                if not arg and myroot == self.target_root:
    1097                         cpv_slot = "%s:%s" % (mykey, mydbapi.aux_get(mykey, ["SLOT"])[0])
    1098                         arg = portage.best_match_to_list(cpv_slot, self.args_keys)
    1099 
    1100                 if myuse is None:
    1101                         self.pkgsettings[myroot].setcpv(mykey, mydb=portdb)
    1102                         myuse = self.pkgsettings[myroot]["USE"].split()
     1133                        try:
     1134                                arg = self._find_atom_for_pkg(self._args_atoms, mykey, metadata)
     1135                        except portage.exception.InvalidDependString, e:
     1136                                if mytype != "installed":
     1137                                        show_invalid_depstring_notice(tuple(mybigkey+["merge"]),
     1138                                                metadata["PROVIDE"], str(e))
     1139                                        return 0
     1140                                del e
    11031141
    11041142                merging=1
     
    11141152                            If the package has new iuse flags or different use flags then if
    11151153                            --newuse is specified, we need to merge the package. """
    1116                         if merging==0 and "--newuse" in self.myopts and \
     1154                        if merging == 0 and \
     1155                                ("--newuse" in self.myopts or
     1156                                "--reinstall" in self.myopts) and \
    11171157                                vardbapi.cpv_exists(mykey):
    11181158                                pkgsettings.setcpv(mykey, mydb=mydbapi)
     
    11211161                                forced_flags.update(pkgsettings.usemask)
    11221162                                old_use = vardbapi.aux_get(mykey, ["USE"])[0].split()
    1123                                 iuses = set(filter_iuse_defaults(
    1124                                         mydbapi.aux_get(mykey, ["IUSE"])[0].split()))
     1163                                iuses = set(filter_iuse_defaults(metadata["IUSE"].split()))
    11251164                                old_iuse = set(filter_iuse_defaults(
    11261165                                        vardbapi.aux_get(mykey, ["IUSE"])[0].split()))
    1127                                 if iuses.symmetric_difference(
    1128                                         old_iuse).difference(forced_flags):
     1166                                if self._reinstall_for_flags(
     1167                                        forced_flags, old_use, old_iuse, myuse, iuses):
    11291168                                        merging = 1
    1130                                 elif old_iuse.intersection(old_use) != \
    1131                                         iuses.intersection(myuse):
    1132                                         merging=1
    11331169
    11341170                if addme and merging == 1:
     
    11391175
    11401176                if addme:
    1141                         metadata = dict(izip(self._mydbapi_keys,
    1142                                 mydbapi.aux_get(mykey, self._mydbapi_keys)))
    11431177                        if merging == 0 and vardbapi.cpv_exists(mykey) and \
    11441178                                mytype != "installed":
     1179                                mytype = "installed"
    11451180                                mybigkey[0] = "installed"
    11461181                                mydbapi = vardbapi
     
    11481183                                metadata = dict(izip(self._mydbapi_keys,
    11491184                                        mydbapi.aux_get(mykey, self._mydbapi_keys)))
    1150                                 myuse = mydbapi.aux_get(mykey, ["USE"])[0].split()
     1185                                myuse = metadata["USE"].split()
    11511186                        slot_atom = "%s:%s" % (portage.dep_getkey(mykey), metadata["SLOT"])
    11521187                        existing_node = self._slot_node_map[myroot].get(
     
    12061241                                        priority=priority)
    12071242
     1243                if arg:
     1244                        self._args_nodes.add(jbigkey)
     1245                        try:
     1246                                for set_name, pkg_set in self._sets.iteritems():
     1247                                        atom = self._find_atom_for_pkg(pkg_set, mykey, metadata)
     1248                                        if atom:
     1249                                                self._sets_nodes[set_name].add(jbigkey)
     1250                        except portage.exception.InvalidDependString, e:
     1251                                if mytype != "installed":
     1252                                        show_invalid_depstring_notice(jbigkey,
     1253                                                metadata["PROVIDE"], str(e))
     1254                                        return 0
     1255                                del e
     1256
    12081257                # Do this even when addme is False (--onlydeps) so that the
    12091258                # parent/child relationship is always known in case
     
    12291278                edepend={}
    12301279                depkeys = ["DEPEND","RDEPEND","PDEPEND"]
    1231                 depvalues = mydbapi.aux_get(mykey, depkeys)
    1232                 for i in xrange(len(depkeys)):
    1233                         edepend[depkeys[i]] = depvalues[i]
     1280                for k in depkeys:
     1281                        edepend[k] = metadata[k]
    12341282
    12351283                if mytype == "ebuild":
     
    12661314                                # on a package being present AND must be built after that package.
    12671315                                if not self.select_dep(myroot, edepend["PDEPEND"], myparent=mp,
    1268                                         myuse=myuse, priority=DepPriority(), rev_deps=True,
     1316                                        myuse=myuse, priority=DepPriority(runtime_post=True),
    12691317                                        parent_arg=arg):
    12701318                                        return 0
     
    14281476                """ These are used inside self.create() in order to ensure packages
    14291477                that happen to match arguments are not incorrectly marked as nomerge."""
    1430                 self.args_keys = [x[1] for x in arg_atoms]
     1478                for myarg, myatom in arg_atoms:
     1479                        self._args_atoms.setdefault(
     1480                                portage.dep_getkey(myatom), []).append(myatom)
    14311481                for myarg, myatom in arg_atoms:
    14321482                                try:
     
    15321582                        mymerge = mycheck[1]
    15331583
    1534                 if not mymerge and arg and \
    1535                         portage.best_match_to_list(depstring, self.args_keys):
     1584                if not mymerge and arg:
    15361585                        # A provided package has been specified on the command line.  The
    15371586                        # package will not be merged and a warning will be displayed.
    1538                         self._pprovided_args.append(arg)
     1587                        cp = portage.dep_getkey(depstring)
     1588                        if cp in self._args_atoms and depstring in self._args_atoms[cp]:
     1589                                self._pprovided_args.append((arg, depstring))
    15391590
    15401591                if myparent:
     
    15961647                                                myeb_pkg = portage.best(myeb_pkg_matches)
    15971648
    1598                                 if myeb_pkg and "--newuse" in self.myopts:
     1649                                if myeb_pkg and \
     1650                                        ("--newuse" in self.myopts or \
     1651                                        "--reinstall" in self.myopts):
    15991652                                        iuses = set(filter_iuse_defaults(
    16001653                                                bindb.aux_get(myeb_pkg, ["IUSE"])[0].split()))
     
    16151668                                                cur_iuse = set(filter_iuse_defaults(
    16161669                                                        portdb.aux_get(myeb, ["IUSE"])[0].split()))
    1617                                         if iuses.symmetric_difference(
    1618                                                 cur_iuse).difference(forced_flags):
    1619                                                 myeb_pkg = None
    1620                                         elif iuses.intersection(old_use) != \
    1621                                                 cur_iuse.intersection(now_use):
     1670                                        if self._reinstall_for_flags(
     1671                                                forced_flags, old_use, iuses, now_use, cur_iuse):
    16221672                                                myeb_pkg = None
    16231673                                if myeb_pkg:
     
    20292079                        return retlist
    20302080                mygraph=self.digraph.copy()
     2081                for node in mygraph.order[:]:
     2082                        if node[-1] == "nomerge":
     2083                                mygraph.remove(node)
    20312084                self._merge_order_bias(mygraph)
    20322085                myblockers = self.blocker_digraph.copy()
     
    20432096                                        asap_nodes.append(node)
    20442097                                        break
    2045                 ignore_priority_range = [None]
    2046                 ignore_priority_range.extend(
    2047                         xrange(DepPriority.MIN, DepPriority.MEDIUM + 1))
     2098                ignore_priority_soft_range = [None]
     2099                ignore_priority_soft_range.extend(
     2100                        xrange(DepPriority.MIN, DepPriority.SOFT + 1))
    20482101                tree_mode = "--tree" in self.myopts
     2102                # Tracks whether or not the current iteration should prefer asap_nodes
     2103                # if available.  This is set to False when the previous iteration
     2104                # failed to select any nodes.  It is reset whenever nodes are
     2105                # successfully selected.
     2106                prefer_asap = True
    20492107                while not mygraph.empty():
    2050                         ignore_priority = None
    2051                         nodes = None
    2052                         if asap_nodes:
     2108                        selected_nodes = None
     2109                        if prefer_asap and asap_nodes:
    20532110                                """ASAP nodes are merged before their soft deps."""
     2111                                asap_nodes = [node for node in asap_nodes \
     2112                                        if mygraph.contains(node)]
    20542113                                for node in asap_nodes:
    2055                                         if not mygraph.contains(node):
    2056                                                 asap_nodes.remove(node)
    2057                                                 continue
    20582114                                        if not mygraph.child_nodes(node,
    20592115                                                ignore_priority=DepPriority.SOFT):
    2060                                                 nodes = [node]
     2116                                                selected_nodes = [node]
    20612117                                                asap_nodes.remove(node)
    20622118                                                break
    2063                         if not nodes:
    2064                                 for ignore_priority in ignore_priority_range:
     2119                        if not selected_nodes and \
     2120                                not (prefer_asap and asap_nodes):
     2121                                for ignore_priority in ignore_priority_soft_range:
    20652122                                        nodes = get_nodes(ignore_priority=ignore_priority)
    20662123                                        if nodes:
    20672124                                                break
    2068                         selected_nodes = None
    2069                         if nodes:
    2070                                 if ignore_priority <= DepPriority.SOFT:
     2125                                if nodes:
    20712126                                        if ignore_priority is None and not tree_mode:
    20722127                                                # Greedily pop all of these nodes since no relationship
     
    20872142                                                        # settle for a root node
    20882143                                                        selected_nodes = [nodes[0]]
    2089                                 else:
     2144                        if not selected_nodes:
     2145                                nodes = get_nodes(ignore_priority=DepPriority.MEDIUM)
     2146                                if nodes:
    20902147                                        """Recursively gather a group of nodes that RDEPEND on
    20912148                                        eachother.  This ensures that they are merged as a group
    20922149                                        and get their RDEPENDs satisfied as soon as possible."""
    2093                                         def gather_deps(mergeable_nodes, selected_nodes, node):
     2150                                        def gather_deps(ignore_priority,
     2151                                                mergeable_nodes, selected_nodes, node):
    20942152                                                if node in selected_nodes:
    20952153                                                        return True
     
    20982156                                                selected_nodes.add(node)
    20992157                                                for child in mygraph.child_nodes(node,
    2100                                                         ignore_priority=DepPriority.SOFT):
    2101                                                         if not gather_deps(
     2158                                                        ignore_priority=ignore_priority):
     2159                                                        if not gather_deps(ignore_priority,
    21022160                                                                mergeable_nodes, selected_nodes, child):
    21032161                                                                return False
    21042162                                                return True
    21052163                                        mergeable_nodes = set(nodes)
    2106                                         for node in nodes:
    2107                                                 selected_nodes = set()
    2108                                                 if gather_deps(
    2109                                                         mergeable_nodes, selected_nodes, node):
     2164                                        if prefer_asap and asap_nodes:
     2165                                                nodes = asap_nodes
     2166                                        for ignore_priority in xrange(DepPriority.SOFT,
     2167                                                DepPriority.MEDIUM_SOFT + 1):
     2168                                                for node in nodes:
     2169                                                        selected_nodes = set()
     2170                                                        if gather_deps(ignore_priority,
     2171                                                                mergeable_nodes, selected_nodes, node):
     2172                                                                break
     2173                                                        else:
     2174                                                                selected_nodes = None
     2175                                                if selected_nodes:
    21102176                                                        break
    2111                                                 else:
    2112                                                         selected_nodes = None
     2177
     2178                                        if prefer_asap and asap_nodes and not selected_nodes:
     2179                                                # We failed to find any asap nodes to merge, so ignore
     2180                                                # them for the next iteration.
     2181                                                prefer_asap = False
     2182                                                continue
     2183
     2184                                        if selected_nodes and ignore_priority > DepPriority.SOFT:
     2185                                                # Try to merge ignored medium deps as soon as possible.
     2186                                                for node in selected_nodes:
     2187                                                        children = set(mygraph.child_nodes(node))
     2188                                                        soft = children.difference(
     2189                                                                mygraph.child_nodes(node,
     2190                                                                ignore_priority=DepPriority.SOFT))
     2191                                                        medium_soft = children.difference(
     2192                                                                mygraph.child_nodes(node,
     2193                                                                ignore_priority=DepPriority.MEDIUM_SOFT))
     2194                                                        medium_soft.difference_update(soft)
     2195                                                        for child in medium_soft:
     2196                                                                if child in selected_nodes:
     2197                                                                        continue
     2198                                                                if child in asap_nodes:
     2199                                                                        continue
     2200                                                                # TODO: Try harder to make these nodes get
     2201                                                                # merged absolutely as soon as possible.
     2202                                                                asap_nodes.append(child)
    21132203
    21142204                        if not selected_nodes:
     
    21222212                                                circular_blocks = True
    21232213                                                blocker_deps = myblockers.leaf_nodes()
    2124                                         if blocker_deps:
    2125                                                 selected_nodes = [blocker_deps.pop()]
     2214                                        while blocker_deps:
     2215                                                # Some of these nodes might have already been selected
     2216                                                # by the normal node selection process after the
     2217                                                # circular_blocks flag has been set.  Therefore, we
     2218                                                # have to verify that they're still in the graph so
     2219                                                # that they're not selected more than once.
     2220                                                node = blocker_deps.pop()
     2221                                                if mygraph.contains(node):
     2222                                                        selected_nodes = [node]
     2223                                                        break
    21262224
    21272225                        if not selected_nodes:
     
    21632261                                sys.exit(1)
    21642262
     2263                        # At this point, we've succeeded in selecting one or more nodes, so
     2264                        # it's now safe to reset the prefer_asap to it's default state.
     2265                        prefer_asap = True
     2266
    21652267                        for node in selected_nodes:
    21662268                                retlist.append(list(node))
     
    21992301                        return [x for x in mylist \
    22002302                                if x in matches or not portdb.cpv_exists(x)]
     2303                def create_cp_dict(atom_list):
     2304                        cp_dict = {}
     2305                        for atom in atom_list:
     2306                                cp_dict.setdefault(portage.dep_getkey(atom), []).append(atom)
     2307                        return cp_dict
    22012308                world_problems = False
    22022309                if mode=="system":
    22032310                        mylist = getlist(self.settings, "system")
     2311                        self._sets["system"] = create_cp_dict(mylist)
     2312                        self._sets_nodes["system"] = set()
    22042313                else:
    22052314                        #world mode
    22062315                        worldlist = getlist(self.settings, "world")
     2316                        self._sets["world"] = create_cp_dict(worldlist)
     2317                        self._sets_nodes["world"] = set()
    22072318                        mylist = getlist(self.settings, "system")
     2319                        self._sets["system"] = create_cp_dict(mylist)
     2320                        self._sets_nodes["system"] = set()
    22082321                        worlddict=genericdict(worldlist)
    22092322
    2210                         for x in worlddict.keys():
     2323                        for x in worlddict:
    22112324                                if not portage.isvalidatom(x):
    22122325                                        world_problems = True
    2213                                 elif not self.trees[self.target_root]["vartree"].dbapi.match(x):
     2326                                        continue
     2327                                elif not vardb.match(x):
    22142328                                        world_problems = True
    2215                                 else:
    2216                                         mylist.append(x)
     2329                                        available = False
     2330                                        if "--usepkgonly" not in self.myopts and \
     2331                                                portdb.match(x):
     2332                                                available = True
     2333                                        elif "--usepkg" in self.myopts:
     2334                                                mymatches = bindb.match(x)
     2335                                                if "--usepkgonly" not in self.myopts:
     2336                                                        mymatches = visible(mymatches)
     2337                                                if mymatches:
     2338                                                        available = True
     2339                                        if not available:
     2340                                                continue
     2341                                mylist.append(x)
    22172342
    22182343                newlist = []
     
    22642389                                                        newlist.append(myslot_atom)
    22652390                mylist = newlist
    2266                
     2391
     2392                for myatom in mylist:
     2393                        self._args_atoms.setdefault(
     2394                                portage.dep_getkey(myatom), []).append(myatom)
     2395
    22672396                missing_atoms = []
    22682397                for mydep in mylist:
     
    22892418
    22902419                return 1
     2420
     2421        def _find_atom_for_pkg(self, pkg_set, cpv, metadata):
     2422                """Return the best match for a given package from the arguments, or
     2423                None if there are no matches.  This matches virtual arguments against
     2424                the PROVIDE metadata.  This can raise an InvalidDependString exception
     2425                if an error occurs while parsing PROVIDE."""
     2426                cpv_slot = "%s:%s" % (cpv, metadata["SLOT"])
     2427                cp = portage.dep_getkey(cpv)
     2428                atoms = pkg_set.get(cp)
     2429                if atoms:
     2430                        best_match = portage.best_match_to_list(cpv_slot, atoms)
     2431                        if best_match:
     2432                                return best_match
     2433                provides = portage.flatten(portage.dep.use_reduce(
     2434                        portage.dep.paren_reduce(metadata["PROVIDE"]),
     2435                        uselist=metadata["USE"].split()))
     2436                for provide in provides:
     2437                        provided_cp = portage.dep_getkey(provide)
     2438                        atoms = pkg_set.get(provided_cp)
     2439                        if atoms:
     2440                                transformed_atoms = [atom.replace(provided_cp, cp) for atom in atoms]
     2441                                best_match = portage.best_match_to_list(cpv_slot, transformed_atoms)
     2442                                if best_match:
     2443                                        return atoms[transformed_atoms.index(best_match)]
     2444                return None
    22912445
    22922446        def display(self,mylist,verbosity=None):
     
    23972551                                        traversed_nodes.add(graph_key)
    23982552                                        def add_parents(current_node, ordered):
    2399                                                 parent_nodes = mygraph.parent_nodes(current_node)
     2553                                                parent_nodes = None
     2554                                                # Do not traverse to parents if this node is an
     2555                                                # an argument or a direct member of a set that has
     2556                                                # been specified as an argument (system or world).
     2557                                                if current_node not in self._args_nodes:
     2558                                                        parent_nodes = mygraph.parent_nodes(current_node)
    24002559                                                if parent_nodes:
    24012560                                                        child_nodes = set(mygraph.child_nodes(current_node))
     
    24582617                # in size display (verbose mode)
    24592618                myfetchlist=[]
     2619
    24602620                for mylist_index in xrange(len(mylist)):
    24612621                        x, depth, ordered = mylist[mylist_index]
     
    24932653                                mydbapi = self.trees[myroot][self.pkg_tree_map[pkg_type]].dbapi
    24942654                                pkg_status = x[3]
     2655                                pkg_merge = ordered and pkg_status != "nomerge"
    24952656                                binary_package = True
    24962657                                if "ebuild" == pkg_type:
     
    26662827                                        # size verbose
    26672828                                        mysize=0
    2668                                         if x[0] == "ebuild" and ordered and x[-1] != "nomerge":
     2829                                        if pkg_type == "ebuild" and pkg_merge:
    26692830                                                try:
    26702831                                                        myfilesdict = portdb.getfetchsizes(pkg_key,
     
    26792840                                                        myfilesdict="[empty/missing/bad digest]"
    26802841                                                else:
    2681                                                         for myfetchfile in myfilesdict.keys():
     2842                                                        for myfetchfile in myfilesdict:
    26822843                                                                if myfetchfile not in myfetchlist:
    26832844                                                                        mysize+=myfilesdict[myfetchfile]
     
    26912852                                        file_name = portdb.findname(pkg_key)
    26922853                                        if file_name: # It might not exist in the tree
     2854                                                newrepo = pkgsettings["PORTDIR"]
     2855                                                newrepoindex = "0"
     2856                                                if self.trees[x[1]]["vartree"].dbapi.cpv_exists(pkg):
     2857                                                        oldrepo = self.trees[x[1]]["vartree"].dbapi.aux_get(pkg, ["repository"])[0]
     2858                                                else:
     2859                                                        oldrepo = ""
     2860                                                if oldrepo != "":
     2861                                                        oldrepo = portdb.getRepositoryPath(oldrepo)
    26932862                                                dir_name=os.path.abspath(os.path.dirname(file_name)+"/../..")
    2694                                                 if (overlays_real.count(dir_name)>0):
    2695                                                         verboseadd+=teal("["+str(overlays_real.index(
    2696                                                                 os.path.normpath(dir_name))+1)+"]")+" "
    2697                                                         display_overlays=True
     2863                                                if (overlays_real.count(dir_name) > 0):
     2864                                                        newrepoindex = overlays_real.index(os.path.normpath(dir_name))
     2865                                                        newrepo = overlays_real[newrepoindex]
     2866                                                        newrepoindex += 1
     2867                                               
     2868                                                # assing lookup indexes
     2869                                                if oldrepo == "":
     2870                                                        oldrepoindex = "?"
     2871                                                elif oldrepo == pkgsettings["PORTDIR"]:
     2872                                                        oldrepoindex = "0"
     2873                                                else:
     2874                                                        oldrepoindex = str(overlays_real.index(os.path.normpath(oldrepo)) + 1)
     2875                                                if oldrepoindex == newrepoindex \
     2876                                                                or not self.trees[x[1]]["vartree"].dbapi.cpv_exists(pkg):
     2877                                                        repoadd = newrepoindex
     2878                                                else:
     2879                                                        repoadd = "%s=>%s" % (oldrepoindex, newrepoindex)
     2880
     2881                                                verboseadd+=teal("[%s]" % repoadd)+" "
     2882                                                display_overlays=True
    26982883                                        else:
    26992884                                                verboseadd += "[No ebuild?]"
     
    27262911                                        myoldbest=blue("["+myoldbest+"]")
    27272912
     2913                                pkg_cp = xs[0]
     2914                                pkg_arg    = False
     2915                                pkg_world  = False
     2916                                pkg_system = False
     2917                                pkg_node = tuple(x)
     2918                                if pkg_node in self._args_nodes:
     2919                                        pkg_arg = True
     2920                                        world_nodes = self._sets_nodes.get("world")
     2921                                        if world_nodes and pkg_node in world_nodes:
     2922                                                pkg_world = True
     2923                                        if world_nodes is None:
     2924                                                # Don't colorize system package when in "world" mode.
     2925                                                system_nodes = self._sets_nodes.get("system")
     2926                                                if system_nodes and pkg_node in system_nodes:
     2927                                                        pkg_system = True
     2928
     2929                                def pkgprint(pkg):
     2930                                        if pkg_merge:
     2931                                                if pkg_arg:
     2932                                                        if pkg_world:
     2933                                                                return colorize("PKG_MERGE_WORLD", pkg)
     2934                                                        elif pkg_system:
     2935                                                                return colorize("PKG_MERGE_SYSTEM", pkg)
     2936                                                        else:
     2937                                                                return colorize("PKG_MERGE_ARG", pkg)
     2938                                                else:
     2939                                                        return colorize("PKG_MERGE", pkg)
     2940                                        else:
     2941                                                if pkg_arg:
     2942                                                        if pkg_world:
     2943                                                                return colorize("PKG_NOMERGE_WORLD", pkg)
     2944                                                        elif pkg_system:
     2945                                                                return colorize("PKG_NOMERGE_SYSTEM", pkg)
     2946                                                        else:
     2947                                                                return colorize("PKG_NOMERGE_ARG", pkg)
     2948                                                else:
     2949                                                        return colorize("PKG_NOMERGE", pkg)
     2950
    27282951                                if x[1]!="/":
    27292952                                        if myoldbest:
     
    27312954                                        if "--columns" in self.myopts:
    27322955                                                if "--quiet" in self.myopts:
    2733                                                         myprint=addl+" "+indent+darkgreen(xs[0])
     2956                                                        myprint=addl+" "+indent+pkgprint(pkg_cp)
    27342957                                                        myprint=myprint+darkblue(" "+xs[1]+xs[2])+" "
    27352958                                                        myprint=myprint+myoldbest
    27362959                                                        myprint=myprint+darkgreen("to "+x[1])
    27372960                                                else:
    2738                                                         myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0])
     2961                                                        myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_cp)
    27392962                                                        if (newlp-nc_len(myprint)) > 0:
    27402963                                                                myprint=myprint+(" "*(newlp-nc_len(myprint)))
     
    27452968                                                        myprint=myprint+darkgreen("to "+x[1])+" "+verboseadd
    27462969                                        else:
    2747                                                 if x[-1] == "nomerge" or not ordered:
    2748                                                         myprint = darkblue("[nomerge      ] ")
     2970                                                if not pkg_merge:
     2971                                                        myprint = "[%s      ] " % pkgprint("nomerge")
    27492972                                                else:
    27502973                                                        myprint = "[" + pkg_type + " " + addl + "] "
    2751                                                 myprint += indent + darkgreen(pkg_key) + " " + \
     2974                                                myprint += indent + pkgprint(pkg_key) + " " + \
    27522975                                                        myoldbest + darkgreen("to " + myroot) + " " + \
    27532976                                                        verboseadd
     
    27552978                                        if "--columns" in self.myopts:
    27562979                                                if "--quiet" in self.myopts:
    2757                                                         myprint=addl+" "+indent+darkgreen(xs[0])
     2980                                                        myprint=addl+" "+indent+pkgprint(pkg_cp)
    27582981                                                        myprint=myprint+" "+green(xs[1]+xs[2])+" "
    27592982                                                        myprint=myprint+myoldbest
    27602983                                                else:
    2761                                                         myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(xs[0])
     2984                                                        myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_cp)
    27622985                                                        if (newlp-nc_len(myprint)) > 0:
    27632986                                                                myprint=myprint+(" "*(newlp-nc_len(myprint)))
     
    27672990                                                        myprint=myprint+myoldbest+"  "+verboseadd
    27682991                                        else:
    2769                                                 if x[-1] == "nomerge" or not ordered:
    2770                                                         myprint=darkblue("[nomerge      ] "+indent+x[2]+" "+myoldbest+" ")+verboseadd
     2992                                                if not pkg_merge:
     2993                                                        myprint="["+pkgprint("nomerge")+"      ] "+indent+pkgprint(pkg_key)+" "+myoldbest+" "+verboseadd
    27712994                                                else:
    2772                                                         myprint="["+x[0]+" "+addl+"] "+indent+darkgreen(x[2])+" "+myoldbest+" "+verboseadd
     2995                                                        myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_key)+" "+myoldbest+" "+verboseadd
    27732996                                p.append(myprint)
    27742997
     
    28003023                        print counters
    28013024                        if overlays and display_overlays:
    2802                                 print "Portage overlays:"
     3025                                print "Portage tree and overlays:"
    28033026                                y=0
     3027                                print " "+teal("[0]"), self.settings["PORTDIR"]
    28043028                                for x in overlays:
    28053029                                        y=y+1
    28063030                                        print " "+teal("["+str(y)+"]"),x
     3031                                print " "+teal("[?]"), "indicates that the source repository could not be determined"
    28073032
    28083033                if "--changelog" in self.myopts:
     
    28133038
    28143039                if self._pprovided_args:
     3040                        arg_refs = {}
     3041                        for arg_atom in self._pprovided_args:
     3042                                arg, atom = arg_atom
     3043                                arg_refs[arg_atom] = []
     3044                                cp = portage.dep_getkey(atom)
     3045                                for set_name, pkg_set in self._sets.iteritems():
     3046                                        if cp in pkg_set and atom in pkg_set[cp]:
     3047                                                arg_refs[arg_atom].append(set_name)
    28153048                        msg = []
    28163049                        msg.append(bad("\nWARNING: "))
     
    28213054                                msg.append("A requested package will not be " + \
    28223055                                        "merged because it is listed in\n")
    2823                         msg.append("         package.provided:\n\n")
    2824                         for arg in self._pprovided_args:
    2825                                 msg.append("             " + arg + "\n")
     3056                        msg.append("package.provided:\n\n")
     3057                        problems_sets = set()
     3058                        for (arg, atom), refs in arg_refs.iteritems():
     3059                                ref_string = ""
     3060                                if refs:
     3061                                        problems_sets.update(refs)
     3062                                        refs.sort()
     3063                                        ref_string = ", ".join(["'%s'" % name for name in refs])
     3064                                        ref_string = " pulled in by " + ref_string
     3065                                msg.append("  %s%s\n" % (colorize("INFORM", arg), ref_string))
    28263066                        msg.append("\n")
     3067                        if "world" in problems_sets:
     3068                                msg.append("This problem can be solved in one of the following ways:\n\n")
     3069                                msg.append("  A) Use emaint to clean offending packages from world (if not installed).\n")
     3070                                msg.append("  B) Uninstall offending packages (cleans them from world).\n")
     3071                                msg.append("  C) Remove offending entries from package.provided.\n\n")
     3072                                msg.append("The best course of action depends on the reason that an offending\n")
     3073                                msg.append("package.provided entry exists.\n\n")
    28273074                        sys.stderr.write("".join(msg))
    28283075
     
    29573204
    29583205        def merge(self, mylist, favorites, mtimedb):
     3206                from portage.elog import elog_process
    29593207                failed_fetches = []
    29603208                fetchonly = "--fetchonly" in self.myopts or \
     
    30443292                                portage.write_atomic(
    30453293                                        os.path.join(self.target_root, portage.WORLD_FILE),
    3046                                         "\n".join(myfavdict.values()))
     3294                                                "\n".join(sorted(myfavdict.values())) + "\n")
    30473295
    30483296                        mtimedb["resume"]["mergelist"]=mymergelist[:]
     
    31903438                                                        tree="porttree")
    31913439                                                del pkgsettings["PORTAGE_BINPKG_TMPFILE"]
     3440                                                if retval != os.EX_OK or \
     3441                                                        "--buildpkgonly" in self.myopts:
     3442                                                        elog_process(pkg_key, pkgsettings)
    31923443                                                if retval != os.EX_OK:
    31933444                                                        return retval
     
    33213572                                                portage.write_atomic(
    33223573                                                os.path.join(myroot, portage.WORLD_FILE),
    3323                                                 "\n".join(myfavdict.values()))
     3574                                                "\n".join(sorted(myfavdict.values()))+"\n")
    33243575
    33253576                                if "--pretend" not in self.myopts and \
     
    35943845                                                slotmap[myslot]={}
    35953846                                        slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)]=mypkg
    3596                                 for myslot in slotmap.keys():
     3847                                for myslot in slotmap:
    35973848                                        counterkeys=slotmap[myslot].keys()
    35983849                                        counterkeys.sort()
     
    36213872                if vdb_lock:
    36223873                        portage.locks.unlockdir(vdb_lock)
    3623         for x in pkgmap.keys():
     3874        for x in pkgmap:
    36243875                for y in localtree.dep_match(x):
    36253876                        if y not in pkgmap[x]["omitted"] and \
     
    36773928                countdown(int(settings["CLEAN_DELAY"]), ">>> Unmerging")
    36783929
    3679         for x in pkgmap.keys():
     3930        for x in pkgmap:
    36803931                for y in pkgmap[x]["selected"]:
    36813932                        print ">>> Unmerging "+y+"..."
     
    37824033
    37834034
    3784 def display_news_notification(settings):
    3785         target_root = settings["ROOT"]
     4035def display_news_notification(trees):
     4036        for target_root in trees:
     4037                if len(trees) > 1 and target_root != "/":
     4038                        break
     4039        settings = trees[target_root]["vartree"].settings
     4040        portdb = trees[target_root]["porttree"].dbapi
     4041        vardb = trees[target_root]["vartree"].dbapi
    37864042        NEWS_PATH = os.path.join("metadata", "news")
    37874043        UNREAD_PATH = os.path.join(target_root, NEWS_LIB_PATH, "news")
    3788         porttree = portdbapi(porttree_root=settings["PORTDIR"], mysettings=settings)
    37894044        newsReaderDisplay = False
    37904045
    3791         for repo in porttree.getRepositories():
    3792                 unreadItems = checkUpdatedNewsItems(target_root, NEWS_PATH, UNREAD_PATH, repo)
     4046        for repo in portdb.getRepositories():
     4047                unreadItems = checkUpdatedNewsItems(
     4048                        portdb, vardb, NEWS_PATH, UNREAD_PATH, repo)
    37934049                if unreadItems:
    37944050                        if not newsReaderDisplay:
     
    38044060                print
    38054061
    3806 def post_emerge(settings, mtimedb, retval):
     4062def post_emerge(trees, mtimedb, retval):
    38074063        """
    38084064        Misc. things to run at the end of a merge session.
     
    38144070        Display preserved libs warnings
    38154071        Exit Emerge
    3816        
    3817         @param settings: Configuration settings (typically portage.settings)
    3818         @type settings: portage.config()
     4072
     4073        @param trees: A dictionary mapping each ROOT to it's package databases
     4074        @type trees: dict
    38194075        @param mtimedb: The mtimeDB to store data needed across merge invocations
    38204076        @type mtimedb: MtimeDB class instance
     
    38254081        1.  Calls sys.exit(retval)
    38264082        """
    3827         target_root = settings["ROOT"]
     4083        for target_root in trees:
     4084                if len(trees) > 1 and target_root != "/":
     4085                        break
     4086        vardbapi = trees[target_root]["vartree"].dbapi
     4087        settings = vardbapi.settings
    38284088        info_mtimes = mtimedb["info"]
    38294089
     
    38434103
    38444104        from portage.util import normalize_path
     4105        # Dump the mod_echo output now so that our other notifications are shown
     4106        # last.
     4107        from portage.elog import mod_echo
     4108        mod_echo.finalize()
     4109
    38454110        if "noinfo" not in settings.features:
    38464111                chk_updated_info_files(normalize_path(target_root + EPREFIX), infodirs, info_mtimes, retval)
    38474112        chk_updated_cfg_files(normalize_path(target_root + EPREFIX), config_protect)
    38484113       
    3849         display_news_notification(settings)
     4114        display_news_notification(trees)
    38504115       
    3851         from portage.dbapi.vartree import PreservedLibsRegistry
    3852         plib_registry = PreservedLibsRegistry(os.path.join(target_root, CACHE_PATH, "preserved_libs_registry"))
    3853         if plib_registry.hasEntries():
     4116        if vardbapi.plib_registry.hasEntries():
    38544117                print colorize("WARN", "!!!") + " existing preserved libs:"
    3855                 plibdata = plib_registry.getPreservedLibs()
    3856                 for cpv in plibdata.keys():
     4118                plibdata = vardbapi.plib_registry.getPreservedLibs()
     4119                for cpv in plibdata:
    38574120                        print colorize("WARN", ">>>") + " package: %s" % cpv
    38584121                        for f in plibdata[cpv]:
     
    38994162                        print " "+yellow("*")+" Type "+green("emerge --help config")+" to learn how to update config files."
    39004163
    3901 def checkUpdatedNewsItems( root, NEWS_PATH, UNREAD_PATH, repo_id ):
     4164def checkUpdatedNewsItems(portdb, vardb, NEWS_PATH, UNREAD_PATH, repo_id):
    39024165        """
    39034166        Examines news items in repodir + '/' + NEWS_PATH and attempts to find unread items
    39044167        Returns the number of unread (yet relevent) items.
    39054168       
    3906         @param root:
    3907         @type root:
     4169        @param portdb: a portage tree database
     4170        @type portdb: pordbapi
     4171        @param vardb: an installed package database
     4172        @type vardb: vardbapi
    39084173        @param NEWS_PATH:
    39094174        @type NEWS_PATH:
     
    39184183        """
    39194184        from portage.news import NewsManager
    3920         manager = NewsManager( root, NEWS_PATH, UNREAD_PATH )
     4185        manager = NewsManager(portdb, vardb, NEWS_PATH, UNREAD_PATH)
    39214186        return manager.getUnreadItems( repo_id, update=True )
    39224187
     
    44554720                print
    44564721       
    4457         display_news_notification(settings)
     4722        display_news_notification(trees)
    44584723
    44594724def action_metadata(settings, portdb, myopts):
     
    51605425                        mydepgraph.display(
    51615426                                mydepgraph.altlist(reversed=("--tree" in myopts)))
    5162                 if ("--buildpkgonly" in myopts):
    5163                         if not mydepgraph.digraph.hasallzeros(ignore_priority=DepPriority.MEDIUM):
    5164                                 print "\n!!! --buildpkgonly requires all dependencies to be merged."
    5165                                 print "!!! You have to merge the dependencies before you can build this package.\n"
    5166                                 sys.exit(1)
     5427                        if "--buildpkgonly" in myopts and \
     5428                                not mydepgraph.digraph.hasallzeros(ignore_priority=DepPriority.MEDIUM):
     5429                                        print "\n!!! --buildpkgonly requires all dependencies to be merged."
     5430                                        print "!!! You have to merge the dependencies before you can build this package.\n"
     5431                                        sys.exit(1)
    51675432        else:
    51685433                if ("--buildpkgonly" in myopts):
     
    52625527                        "type":"choice",
    52635528                        "choices":("y", "n")
     5529                },
     5530                "--reinstall": {
     5531                        "help":"specify conditions to trigger package reinstallation",
     5532                        "type":"choice",
     5533                        "choices":["changed-use"]
    52645534                }
    52655535        }
     
    54825752
    54835753        tmpcmdline = []
    5484         if "--ignore-default-opts" not in sys.argv:
     5754        if "--ignore-default-opts" not in myopts:
    54855755                tmpcmdline.extend(settings["EMERGE_DEFAULT_OPTS"].split())
    54865756        tmpcmdline.extend(sys.argv[1:])
     
    56305900        if portage.secpass < 2:
    56315901                # We've already allowed "--version" and "--help" above.
    5632                 if "--pretend" not in myopts and \
    5633                 myaction not in ("search","info"):
     5902                if "--pretend" not in myopts and myaction not in ("search","info"):
    56345903                        need_superuser = not \
    56355904                                ("--fetchonly" in myopts or \
    56365905                                "--fetch-all-uri" in myopts or \
    5637                                 myaction in ("metadata", "regen"))
     5906                                myaction in ("metadata", "regen") or \
     5907                                (myaction == "sync" and os.access(settings["PORTDIR"], os.W_OK)))
    56385908                        if portage.secpass < 1 or \
    56395909                                need_superuser:
     
    56485918                                        myopts["--pretend"] = True
    56495919                                        del myopts["--ask"]
    5650                                         print ("%s access would be required... " + \
     5920                                        print ("%s access is required... " + \
    56515921                                                "adding --pretend to options.\n") % access_desc
    56525922                                        if portage.secpass < 1 and not need_superuser:
    56535923                                                portage_group_warning()
    56545924                                else:
    5655                                         sys.stderr.write(("emerge: %s access would be " + \
     5925                                        sys.stderr.write(("emerge: %s access is " + \
    56565926                                                "required.\n\n") % access_desc)
    56575927                                        if portage.secpass < 1 and not need_superuser:
     
    57356005                        mtimedb["ldpath"]):
    57366006                        if "--pretend" not in myopts:
    5737                                 post_emerge(settings, mtimedb, 0)
     6007                                post_emerge(trees, mtimedb, os.EX_OK)
    57386008
    57396009        elif "depclean"==myaction:
     
    57426012                        myopts, spinner)
    57436013                if "--pretend" not in myopts:
    5744                         post_emerge(settings, mtimedb, 0)
     6014                        post_emerge(trees, mtimedb, os.EX_OK)
    57456015        # "update", "system", or just process files:
    57466016        else:
    57476017                validate_ebuild_environment(trees)
    57486018                if "--pretend" not in myopts:
    5749                         display_news_notification(settings)
     6019                        display_news_notification(trees)
    57506020                action_build(settings, trees, mtimedb,
    57516021                        myopts, myaction, myfiles, spinner)
    57526022                if "--pretend" not in myopts:
    5753                         post_emerge(settings, mtimedb, 0)
     6023                        post_emerge(trees, mtimedb, os.EX_OK)
    57546024                else:
    5755                         display_news_notification(settings)
     6025                        display_news_notification(trees)
    57566026
    57576027if __name__ == "__main__":
  • vendor/prefix-portage/current/pym/emerge/help.py

    r3488 r3509  
    11# Copyright 1999-2007 Gentoo Foundation
    22# Distributed under the terms of the GNU General Public License v2
    3 # $Id: help.py 6752 2007-06-08 07:10:30Z grobian $
     3# $Id: help.py 7085 2007-06-28 19:06:46Z grobian $
    44
    55
     
    1717        print bold("Options:")+" "+green("-")+"["+green("abBcCdDefgGhikKlnNoOpqPsStuvV")+"] ["+green("--oneshot")+"] ["+green("--newuse")+"] ["+green("--noconfmem")+"]"
    1818        print      "                                          [ " + green("--color")+" < " + turquoise("y") + " | "+ turquoise("n")+" >  ] [ "+green("--columns")+" ]"
    19         print      "                                                                 ["+green("--nospinner")+"]"
     19        print      "                                     [ "+green("--reinstall ")+turquoise("changed-use")+" ] ["+green("--nospinner")+"]"
    2020        print "                                          [ "+green("--deep")+"  ] [" + green("--with-bdeps")+" < " + turquoise("y") + " | "+ turquoise("n")+" > ]"
    2121        print bold("Actions:")+" [ "+green("--clean")+" | "+green("--depclean")+" | "+green("--prune")+" | "+green("--regen")+" | "+green("--search")+" | "+green("--unmerge")+" ]"
     
    294294                print "              output from portage's displays."
    295295                print
     296                print "       "+green("--reinstall ") + turquoise("changed-use")
     297                print "              Tells emerge to include installed packages where USE flags have"
     298                print "              changed since installation.  Unlike --newuse, this option does"
     299                print "              not trigger reinstallation when flags that the user has not"
     300                print "              enabled are added or removed."
     301                print
    296302                print "       "+green("--skipfirst")
    297303                print "              This option is only valid in a resume situation. It removes the"
  • vendor/prefix-portage/current/pym/portage/__init__.py

    r3488 r3509  
    55
    66
    7 VERSION="2.2.00.6804"
     7VERSION="2.2.00.7130-prefix"
    88
    99# ===========================================================================
     
    187187                else:
    188188                        raise portage.exception.DirectoryNotFound(mypath)
    189         except (IOError,OSError,portage.exception.PortageException):
     189        except EnvironmentError, e:
     190                if e.errno == portage.exception.PermissionDenied.errno:
     191                        raise portage.exception.PermissionDenied(mypath)
     192                del e
     193                if EmptyOnError:
     194                        return [], []
     195                return None, None
     196        except portage.exception.PortageException:
    190197                if EmptyOnError:
    191198                        return [], []
     
    195202                if dircache.has_key(mypath):
    196203                        cacheStale += 1
    197                 list = os.listdir(mypath)
     204                try:
     205                        list = os.listdir(mypath)
     206                except EnvironmentError, e:
     207                        if e.errno != errno.EACCES:
     208                                raise
     209                        del e
     210                        raise portage.exception.PermissionDenied(mypath)
    198211                ftype = []
    199212                for x in list:
     
    305318#beautiful directed graph object
    306319
    307 class digraph:
     320class digraph(object):
    308321        def __init__(self):
    309322                """Create an empty digraph"""
     
    807820
    808821def check_config_instance(test):
    809         if not test or (str(test.__class__) != 'portage.config'):
    810                 raise TypeError, "Invalid type for config object: %s" % test.__class__
    811 
    812 class config:
     822        if not isinstance(test, config):
     823                raise TypeError("Invalid type for config object: %s (should be %s)" % (test.__class__, config))
     824
     825class config(object):
    813826        """
    814827        This class encompasses the main portage configuration.  Data is pulled from
     
    10091022                                                                        (parentPath, parentsFile))
    10101023                                        self.profiles.append(currentPath)
    1011                                 addProfile(os.path.realpath(self.profile_path))
     1024                                try:
     1025                                        addProfile(os.path.realpath(self.profile_path))
     1026                                except portage.exception.ParseError, e:
     1027                                        writemsg("!!! Unable to parse profile: '%s'\n" % \
     1028                                                self.profile_path, noiselevel=-1)
     1029                                        writemsg("!!! ParseError: %s\n" % str(e), noiselevel=-1)
     1030                                        del e
     1031                                        self.profiles = []
    10121032                        if local_config:
    10131033                                custom_prof = os.path.join(
     
    16411661        def load_infodir(self,infodir):
    16421662                self.modifying()
    1643                 if self.configdict.has_key("pkg"):
    1644                         for x in self.configdict["pkg"].keys():
    1645                                 del self.configdict["pkg"][x]
     1663                if "pkg" in self.configdict:
     1664                        self.configdict["pkg"].clear()
    16461665                else:
    16471666                        writemsg("No pkg setup for settings instance?\n",
     
    21022121                virts = self.getvirtuals(myroot)
    21032122                if virts:
    2104                         myvkeys = virts.keys()
    2105                         for x in myvkeys:
     2123                        for x in virts:
    21062124                                vkeysplit = x.split("/")
    21072125                                if not self.virts_p.has_key(vkeysplit[1]):
     
    21912209
    21922210        def __getitem__(self,mykey):
    2193                 match = ''
    2194                 for x in self.lookuplist:
    2195                         if x is None:
    2196                                 writemsg("!!! lookuplist is null.\n")
    2197                         elif x.has_key(mykey):
    2198                                 match = x[mykey]
    2199                                 break
    2200                 return match
     2211                for d in self.lookuplist:
     2212                        if mykey in d:
     2213                                return d[mykey]
     2214                return '' # for backward compat, don't raise KeyError
     2215
     2216        def get(self, k, x=None):
     2217                for d in self.lookuplist:
     2218                        if k in d:
     2219                                return d[k]
     2220                return x
    22012221
    22022222        def has_key(self,mykey):
    2203                 for x in self.lookuplist:
    2204                         if x.has_key(mykey):
    2205                                 return 1
    2206                 return 0
     2223                return mykey in self
    22072224
    22082225        def __contains__(self, mykey):
    22092226                """Called to implement membership test operators (in and not in)."""
    2210                 return bool(self.has_key(mykey))
     2227                for d in self.lookuplist:
     2228                        if mykey in d:
     2229                                return True
     2230                return False
    22112231
    22122232        def setdefault(self, k, x=None):
    2213                 if k in self:
    2214                         return self[k]
     2233                v = self.get(k)
     2234                if v is not None:
     2235                        return v
    22152236                else:
    22162237                        self[k] = x
    22172238                        return x
    22182239
    2219         def get(self, k, x=None):
    2220                 if k in self:
    2221                         return self[k]
    2222                 else:
    2223                         return x
    2224 
    22252240        def keys(self):
    2226                 return unique_array(flatten([x.keys() for x in self.lookuplist]))
     2241                return list(self)
     2242
     2243        def __iter__(self):
     2244                keys = set()
     2245                for d in self.lookuplist:
     2246                        keys.update(d)
     2247                return iter(keys)
     2248
     2249        def iterkeys(self):
     2250                return iter(self)
    22272251
    22282252        def __setitem__(self,mykey,myvalue):
     
    22372261                "return our locally-maintained environment"
    22382262                mydict={}
    2239                 for x in self.keys():
     2263                for x in self:
    22402264                        myvalue = self[x]
    22412265                        if not isinstance(myvalue, basestring):
     
    24132437                        "usersandbox" not in features))
    24142438
    2415         if free:
     2439        if free or "SANDBOX_ACTIVE" in os.environ:
    24162440                keywords["opt_name"] += " bash"
    24172441                spawn_func = portage.process.spawn_bash
     
    26362660                                return 0
    26372661                        del distlocks_subdir
    2638         for myfile in filedict.keys():
     2662        for myfile in filedict:
    26392663                """
    26402664                fetched  status
     
    26932717                                                        writemsg("!!! Failed to adjust permissions:" + \
    26942718                                                                " %s\n" % str(e), noiselevel=-1)
    2695                                         if myfile not in mydigests:
     2719
     2720                                        # If the file is empty then it's obviously invalid. Remove
     2721                                        # the empty file and try to download if possible.
     2722                                        if mystat.st_size == 0:
     2723                                                if can_fetch:
     2724                                                        try:
     2725                                                                os.unlink(myfile_path)
     2726                                                        except EnvironmentError:
     2727                                                                pass
     2728                                        elif myfile not in mydigests:
    26962729                                                # We don't have a digest, but the file exists.  We must
    26972730                                                # assume that it is fully downloaded.
     
    28162849                                                                writemsg("!!! Failed to adjust permissions:" + \
    28172850                                                                        " %s\n" % str(e), noiselevel=-1)
     2851
     2852                                        # If the file is empty then it's obviously invalid.  Don't
     2853                                        # trust the return value from the fetcher.  Remove the
     2854                                        # empty file and try to download again.
     2855                                        try:
     2856                                                if os.stat(myfile_path).st_size == 0:
     2857                                                        os.unlink(myfile_path)
     2858                                                        fetched = 0
     2859                                                        continue
     2860                                        except EnvironmentError:
     2861                                                pass
    28182862
    28192863                                        if mydigests!=None and mydigests.has_key(myfile):
     
    28672911                                                                        eout = portage.output.EOutput()
    28682912                                                                        eout.quiet = mysettings.get("PORTAGE_QUIET", None) == "1"
    2869                                                                         for x_key in mydigests[myfile].keys():
     2913                                                                        for x_key in mydigests[myfile]:
    28702914                                                                                eout.ebegin("%s %s ;-)" % (myfile, x_key))
    28712915                                                                                eout.eend(0)
     
    29512995                        if required_hash_types.difference(myhashes):
    29522996                                missing_hashes.add(myfile)
     2997                                continue
     2998                        if myhashes["size"] == 0:
     2999                                missing_hashes.add(myfile)
    29533000                if missing_hashes:
    29543001                        missing_files = []
    29553002                        for myfile in missing_hashes:
    29563003                                try:
    2957                                         os.stat(os.path.join(mysettings["DISTDIR"], myfile))
     3004                                        st = os.stat(os.path.join(mysettings["DISTDIR"], myfile))
    29583005                                except OSError, e:
    29593006                                        if e.errno != errno.ENOENT:
     
    29613008                                        del e
    29623009                                        missing_files.append(myfile)
     3010                                else:
     3011                                        # If the file is empty then it's obviously invalid.
     3012                                        if st.st_size == 0:
     3013                                                missing_files.append(myfile)
    29633014                        if missing_files:
    29643015                                mytree = os.path.realpath(os.path.dirname(
     
    31233174        if alwaysdep or "noauto" not in mysettings.features:
    31243175                # process dependency first
    3125                 if "dep" in actionmap[mydo].keys():
     3176                if "dep" in actionmap[mydo]:
    31263177                        retval=spawnebuild(actionmap[mydo]["dep"],actionmap,mysettings,debug,alwaysdep=alwaysdep,logfile=logfile)
    31273178                        if retval:
     
    32223273        mysettings["PF"]       = mypv
    32233274
    3224         mysettings["ECLASSDIR"]   = os.path.join(mysettings["PORTDIR"], "eclass")
    3225         mysettings["SANDBOX_LOG"] = mycpv.replace(os.path.sep, "_-_")
     3275        mysettings["PORTDIR"] = os.path.realpath(mysettings["PORTDIR"])
     3276        mysettings["ECLASSDIR"]   = mysettings["PORTDIR"]+"/eclass"
     3277        mysettings["SANDBOX_LOG"] = mycpv.replace("/", "_-_")
    32263278
    32273279        mysettings["PROFILE_PATHS"] = "\n".join(mysettings.profiles)+"\n"+CUSTOM_PROFILE_PATH
     
    39323984                # merge the deps in so we have again a 'full' actionmap
    39333985                # be glad when this can die.
    3934                 for x in actionmap.keys():
     3986                for x in actionmap:
    39353987                        if len(actionmap_deps.get(x, [])):
    39363988                                actionmap[x]["dep"] = ' '.join(actionmap_deps[x])
    39373989
    3938                 if mydo in actionmap.keys():
     3990                if mydo in actionmap:
    39393991                        retval = spawnebuild(mydo,
    39403992                                actionmap, mysettings, debug, logfile=logfile)
     
    39694021                        return 1
    39704022
    3971                 if retval != os.EX_OK and tree == "porttree":
    3972                         for i in xrange(len(mydbapi.porttrees)-1):
    3973                                 t = mydbapi.porttrees[i+1]
    3974                                 if myebuild.startswith(t):
    3975                                         # Display the non-cannonical path, in case it's different, to
    3976                                         # prevent confusion.
    3977                                         overlays = mysettings["PORTDIR_OVERLAY"].split()
    3978                                         try:
    3979                                                 writemsg("!!! This ebuild is from an overlay: '%s'\n" % \
    3980                                                         overlays[i], noiselevel=-1)
    3981                                         except IndexError:
    3982                                                 pass
    3983                                         break
    39844023                return retval
    39854024
     
    40064045
    40074046expandcache={}
     4047
     4048def _movefile(src, dest, **kwargs):
     4049        """Calls movefile and raises a PortageException if an error occurs."""
     4050        if movefile(src, dest, **kwargs) is None:
     4051                raise portage.exception.PortageException(
     4052                        "mv '%s' '%s'" % (src, dest))
    40084053
    40094054def movefile(src,dest,newmtime=None,sstat=None,mysettings=None):
     
    49424987                return self.portdb.getfetchlist(pkg_key, mysettings=self.settings,
    49434988                        all=True, mytree=self.mytree)[1]
     4989        def __contains__(self):
     4990                return pkg_key in self.keys()
    49444991        def has_key(self, pkg_key):
    49454992                """Returns true if the given package exists within pkgdir."""
    4946                 return pkg_key in self.keys()
     4993                return pkg_key in self
    49474994        def keys(self):
    49484995                """Returns keys for all packages within pkgdir"""
  • vendor/prefix-portage/current/pym/portage/cache/anydbm.py

    r3488 r3509  
    6161                del self.__db[cpv]
    6262
    63         def iterkeys(self):
     63        def __iter__(self):
    6464                return iter(self.__db)
    6565
  • vendor/prefix-portage/current/pym/portage/cache/flat_hash.py

    r3488 r3509  
    103103
    104104
    105         def iterkeys(self):
     105        def __iter__(self):
    106106                """generator for walking the dir struct"""
    107107                dirs = [self.location]
  • vendor/prefix-portage/current/pym/portage/cache/flat_list.py

    r3488 r3509  
    8787
    8888
    89         def iterkeys(self):
     89        def __iter__(self):
    9090                """generator for walking the dir struct"""
    9191                dirs = [self._base]
  • vendor/prefix-portage/current/pym/portage/cache/metadata_overlay.py

    r3488 r3509  
    7676                return True
    7777
    78         def iterkeys(self):
     78        def __iter__(self):
    7979                s = set()
    80                 for cpv in self.db_rw.iterkeys():
    81                         if self.has_key(cpv): # validates whiteout when necessary
     80                for cpv in self.db_rw:
     81                        if cpv in self: # validates whiteout when necessary
    8282                                yield cpv
    8383                        # set includes whiteouts so they won't be yielded later
    8484                        s.add(cpv)
    85                 for cpv in self.db_ro.iterkeys():
     85                for cpv in self.db_ro:
    8686                        if cpv not in s:
    8787                                yield cpv
  • vendor/prefix-portage/current/pym/portage/cache/sql_template.py

    r3488 r3509  
    210210
    211211
    212         def iterkeys(self):
     212        def __iter__(self):
    213213                if not self.autocommits:
    214214                        try:    self.commit()
  • vendor/prefix-portage/current/pym/portage/cache/sqlite.py

    r3488 r3509  
    224224                        raise cache_errors.CacheCorruption(cpv, "key is not unique")
    225225
    226         def iterkeys(self):
     226        def __iter__(self):
    227227                """generator for walking the dir struct"""
    228228                cursor = self._db_cursor
  • vendor/prefix-portage/current/pym/portage/cache/template.py

    r3488 r3509  
    9696
    9797        def iterkeys(self):
    98                 raise NotImplementedError
     98                return iter(self)
    9999
    100100        def iteritems(self):
     
    123123                        raise NotImplementedError
    124124                return self.has_key(cpv)
     125
     126        def __iter__(self):
     127                """This method should always be overridden.  It is provided only for
     128                backward compatibility with modules that override iterkeys instead.  It
     129                will automatically raise a NotImplementedError if iterkeys has not been
     130                overridden."""
     131                if self.iterkeys is database.iterkeys:
     132                        # prevent a possible recursive loop
     133                        raise NotImplementedError(self)
     134                return self.iterkeys()
     135
     136        def get(self, k, x=None):
     137                try:
     138                        return self[k]
     139                except KeyError:
     140                        return x
    125141
    126142        def get_matches(self, match_dict):
     
    146162                                raise InvalidRestriction(key, match, "Key isn't valid")
    147163
    148                 for cpv in self.keys():
     164                for cpv in self.iterkeys():
    149165                        cont = True
    150166                        vals = self[cpv]
  • vendor/prefix-portage/current/pym/portage/cache/util.py

    r3488 r3509  
    1919                noise=verbose_instance
    2020
    21         dead_nodes = {}
    22         dead_nodes = dict.fromkeys(trg_cache.keys())
     21        dead_nodes = set(trg_cache)
    2322        count=0
    2423
     
    2928#               print "processing x=",x
    3029                count+=1
    31                 if dead_nodes.has_key(x):
    32                         del dead_nodes[x]
     30                dead_nodes.discard(x)
    3331                try:    entry = src_cache[x]
    3432                except KeyError, e:
     
    10098                        noise.exception(ce)
    10199                        del ce
    102         dead_nodes.clear()
    103100        noise.finish()
    104101
  • vendor/prefix-portage/current/pym/portage/cache/volatile.py

    r3488 r3509  
    1717                super(database, self).__init__(*args, **config)
    1818                self._data = {}
    19                 self.iterkeys = self._data.iterkeys
     19                self.__iter__ = self._data.__iter__
    2020                self._delitem = self._data.__delitem__
    2121                self.__contains__ = self._data.__contains__
  • vendor/prefix-portage/current/pym/portage/checksum.py

    r3488 r3509  
    44# $Id: portage_checksum.py 3835 2006-07-11 00:59:10Z zmedico $
    55
    6 if not hasattr(__builtins__, "set"):
    7         from sets import Set as set
    8 
    96from portage.const import PRIVATE_PATH,PRELINK_BINARY,HASHING_BLOCKSIZE
    107import os
    118import errno
    12 import shutil
    139import stat
    1410import portage.exception
    1511import portage.process
    16 import portage.util
    1712import portage.locks
    1813import commands
    19 import sha
    20 
    21 
    22 # actual hash functions first
     14import md5, sha
    2315
    2416#dict of all available hash functions
    2517hashfunc_map = {}
    26 
    27 # We _try_ to load this module. If it fails we do the slightly slower fallback.
     18hashorigin_map = {}
     19
     20def _generate_hash_function(hashtype, hashobject, origin="unknown"):
     21        def pyhash(filename):
     22                """
     23                Run a checksum against a file.
     24       
     25                @param filename: File to run the checksum against
     26                @type filename: String
     27                @return: The hash and size of the data
     28                """
     29                f = open(filename, 'rb')
     30                blocksize = HASHING_BLOCKSIZE
     31                data = f.read(blocksize)
     32                size = 0L
     33                sum = hashobject()
     34                while data:
     35                        sum.update(data)
     36                        size = size + len(data)
     37                        data = f.read(blocksize)
     38                f.close()
     39
     40                return (sum.hexdigest(), size)
     41        hashfunc_map[hashtype] = pyhash
     42        hashorigin_map[hashtype] = origin
     43        return pyhash
     44
     45# Define hash functions, try to use the best module available. Later definitions
     46# override earlier ones
     47
     48# Use the internal modules as last fallback
     49md5hash = _generate_hash_function("MD5", md5.new, origin="internal")
     50sha1hash = _generate_hash_function("SHA1", sha.new, origin="internal")
     51
     52# Use pycrypto when available, prefer it over the internal fallbacks
     53try:
     54        from Crypto.Hash import MD5, SHA, SHA256, RIPEMD
     55       
     56        md5hash = _generate_hash_function("MD5", MD5.new, origin="pycrypto")
     57        sha1hash = _generate_hash_function("SHA1", SHA.new, origin="pycrypto")
     58        sha256hash = _generate_hash_function("SHA256", SHA256.new, origin="pycrypto")
     59        rmd160hash = _generate_hash_function("RMD160", RIPEMD.new, origin="pycrypto")
     60except ImportError, e:
     61        pass
     62
     63# Use hashlib from python-2.5 if available and prefer it over pycrypto and internal fallbacks.
     64# Need special handling for RMD160 as it may not always be provided by hashlib.
     65try:
     66        import hashlib
     67       
     68        md5hash = _generate_hash_function("MD5", hashlib.md5, origin="hashlib")
     69        sha1hash = _generate_hash_function("SHA1", hashlib.sha1, origin="hashlib")
     70        sha256hash = _generate_hash_function("SHA256", hashlib.sha256, origin="hashlib")
     71        try:
     72                hashlib.new('ripemd160')
     73        except ValueError:
     74                pass
     75        else:
     76                def rmd160():
     77                        return hashlib.new('ripemd160')
     78                rmd160hash = _generate_hash_function("RMD160", rmd160, origin="hashlib")
     79except ImportError, e:
     80        pass
     81       
     82
     83# Use python-fchksum if available, prefer it over all other MD5 implementations
    2884try:
    2985        import fchksum
     
    3187        def md5hash(filename):
    3288                return fchksum.fmd5t(filename)
    33 
    34 except ImportError:
    35         import md5
    36         def md5hash(filename):
    37                 return pyhash(filename, md5)
    38 hashfunc_map["MD5"] = md5hash
    39 
    40 def sha1hash(filename):
    41         return pyhash(filename, sha)
    42 hashfunc_map["SHA1"] = sha1hash
    43        
    44 # Keep pycrypto optional for now, there are no internal fallbacks for these
    45 try:
    46         import Crypto.Hash.SHA256
    47        
    48         def sha256hash(filename):
    49                 return pyhash(filename, Crypto.Hash.SHA256)
    50         hashfunc_map["SHA256"] = sha256hash
     89        hashfunc_map["MD5"] = md5hash
     90        hashorigin_map["MD5"] = "python-fchksum"
     91
    5192except ImportError:
    5293        pass
    5394
    54 try:
    55         import Crypto.Hash.RIPEMD
    56        
    57         def rmd160hash(filename):
    58                 return pyhash(filename, Crypto.Hash.RIPEMD)
    59         hashfunc_map["RMD160"] = rmd160hash
    60 except ImportError:
    61         pass
    62 
     95# There is only one implementation for size
    6396def getsize(filename):
    6497        size = os.stat(filename).st_size
     
    80113def perform_all(x, calc_prelink=0):
    81114        mydict = {}
    82         for k in hashfunc_map.keys():
     115        for k in hashfunc_map:
    83116                mydict[k] = perform_checksum(x, hashfunc_map[k], calc_prelink)[0]
    84117        return mydict
     
    86119def get_valid_checksum_keys():
    87120        return hashfunc_map.keys()
     121
     122def get_hash_origin(hashtype):
     123        if hashtype not in hashfunc_map:
     124                raise KeyError(hashtype)
     125        return hashorigin_map.get(hashtype, "unknown")
    88126
    89127def verify_all(filename, mydict, calc_prelink=0, strict=0):
     
    132170                return False, ("Insufficient data for checksum verification", got, expected)
    133171
    134         for x in mydict.keys():
     172        for x in mydict:
    135173                if   x == "size":
    136174                        continue
    137                 elif x in hashfunc_map.keys():
     175                elif x in hashfunc_map:
    138176                        myhash = perform_checksum(filename, x, calc_prelink=calc_prelink)[0]
    139177                        if mydict[x] != myhash:
     
    145183                                        break
    146184        return file_is_ok,reason
    147 
    148 def pyhash(filename, hashobject):
    149         """
    150         Run a checksum against a file.
    151 
    152         @param filename: File to run the checksum against
    153         @type filename: String
    154         @param hashname: The hash object that will execute the checksum on the file
    155         @type hashname: Object
    156         @return: The hash and size of the data
    157         """
    158         f = open(filename, 'rb')
    159         blocksize = HASHING_BLOCKSIZE
    160         data = f.read(blocksize)
    161         size = 0L
    162         sum = hashobject.new()
    163         while data:
    164                 sum.update(data)
    165                 size = size + len(data)
    166                 data = f.read(blocksize)
    167         f.close()
    168 
    169         return (sum.hexdigest(), size)
    170185
    171186def perform_checksum(filename, hashname="MD5", calc_prelink=0):
     
    238253        for x in hashes:
    239254                if x not in hashfunc_map:
    240                         raise portage.exception.DigestException, x+" hash function not available (needs dev-python/pycrypto)"
     255                        raise portage.exception.DigestException, x+" hash function not available (needs dev-python/pycrypto or >=dev-lang/python-2.5)"
    241256                rVal[x] = perform_checksum(filename, x, calc_prelink)[0]
    242257        return rVal
  • vendor/prefix-portage/current/pym/portage/const_autotool.py

    r3488 r3509  
    1 # Copyright: 2005 Gentoo Foundation
    2 # Author(s): Brian Harring (ferringb@gentoo.org)
    3 # License: GPL2
    4 # $Id:$
     1# Copyright: 2005-2007 Gentoo Foundation
     2# Distributed under the terms of the GNU General Public License v2
     3# $Id: $
    54
    65# all vars that are to wind up in portage_const must have their name listed in __all__
    76
    8 __all__ = ["EPREFIX", "SYSCONFDIR", "PORTAGE_BASE", "portageuser", "portagegroup", "rootuser", "rootuid", "wheelgid"]
     7__all__ = ["EPREFIX", "SYSCONFDIR", "PORTAGE_BASE", "portageuser",
     8                "portagegroup", "rootuser", "rootuid"]
    99
    1010from os import path
     
    1616portageuser="@portageuser@"
    1717rootuser="@rootuser@"
    18 rootuid=int("@rootuid@")
    19 wheelgid=int("@wheelgid@")
     18rootuid=@rootuid@
  • vendor/prefix-portage/current/pym/portage/cvstree.py

    r3488 r3509  
    6565                basedir=basedir+"/"
    6666        mylist=[]
    67         for myfile in entries["files"].keys():
     67        for myfile in entries["files"]:
    6868                if "cvs" in entries["files"][myfile]["status"]:
    6969                        if "0" == entries["files"][myfile]["revision"]:
    7070                                mylist.append(basedir+myfile)
    7171        if recursive:
    72                 for mydir in entries["dirs"].keys():
     72                for mydir in entries["dirs"]:
    7373                        mylist+=findnew(entries["dirs"][mydir],recursive,basedir+mydir)
    7474        return mylist
     
    8282                basedir=basedir+"/"
    8383        mylist=[]
    84         for myfile in entries["files"].keys():
     84        for myfile in entries["files"]:
    8585                if "cvs" in entries["files"][myfile]["status"]:
    8686                        if "current" not in entries["files"][myfile]["status"]:
     
    8989                                                mylist.append(basedir+myfile)
    9090        if recursive:
    91                 for mydir in entries["dirs"].keys():
     91                for mydir in entries["dirs"]:
    9292                        mylist+=findchanged(entries["dirs"][mydir],recursive,basedir+mydir)
    9393        return mylist
     
    101101                basedir=basedir+"/"
    102102        mylist=[]
    103         for myfile in entries["files"].keys():
     103        for myfile in entries["files"]:
    104104                if "cvs" in entries["files"][myfile]["status"]:
    105105                        if "exists" not in entries["files"][myfile]["status"]:
     
    107107                                        mylist.append(basedir+myfile)
    108108        if recursive:
    109                 for mydir in entries["dirs"].keys():
     109                for mydir in entries["dirs"]:
    110110                        mylist+=findmissing(entries["dirs"][mydir],recursive,basedir+mydir)
    111111        return mylist
     
    121121
    122122        #ignore what cvs ignores.
    123         for myfile in entries["files"].keys():
     123        for myfile in entries["files"]:
    124124                if "cvs" not in entries["files"][myfile]["status"]:
    125125                        mylist.append(basedir+myfile)
    126126        if recursive:
    127                 for mydir in entries["dirs"].keys():
     127                for mydir in entries["dirs"]:
    128128                        mylist+=findunadded(entries["dirs"][mydir],recursive,basedir+mydir)
    129129        return mylist
     
    136136                basedir=basedir+"/"
    137137        mylist=[]
    138         for myfile in entries["files"].keys():
     138        for myfile in entries["files"]:
    139139                if "removed" in entries["files"][myfile]["status"]:
    140140                        mylist.append(basedir+myfile)
    141141        if recursive:
    142                 for mydir in entries["dirs"].keys():
     142                for mydir in entries["dirs"]:
    143143                        mylist+=findremoved(entries["dirs"][mydir],recursive,basedir+mydir)
    144144        return mylist
  • vendor/prefix-portage/current/pym/portage/data.py

    r3488 r3509  
    22# Copyright 1998-2004 Gentoo Foundation
    33# Distributed under the terms of the GNU General Public License v2
    4 # $Id:$
     4# $Id: $
    55
    66if not hasattr(__builtins__, "set"):
     
    88
    99import os, sys, pwd, grp
    10 from portage.const import wheelgid, rootuid, portageuser, portagegroup
    1110from portage.util import writemsg
     11from portage.const import rootuid, portageuser, portagegroup
    1212from portage.output import green,red
    1313from portage.output import create_color_func
     
    6868
    6969uid=os.getuid()
    70 wheelgroup=grp.getgrgid(wheelgid)[0]
     70wheelgid=0
    7171
    72 if uid==0 or uid==int(rootuid):
     72if uid==rootuid:
    7373        secpass=2
    7474try:
    75         if (not secpass) and (wheelgid in os.getgroups()):
    76                 secpass=1
     75        wheelgid=grp.getgrnam("wheel")[2]
    7776except KeyError:
    78         writemsg("portage initialization: your system doesn't have a '%s' group.\n" % wheelgroup)
    79         writemsg("Please fix this as it is a normal system requirement. '%s' is GID %d\n" % (wheelgroup, wheelgid))
    80         writemsg("`emerge baselayout` and a config update with dispatch-conf, etc-update\n")
    81         writemsg("or cfg-update should remedy this problem.\n")
    8277        pass
    8378
     
    9085except KeyError:
    9186        portage_uid=0
    92         portage_gid=wheelgid
     87        portage_gid=0
    9388        writemsg("\n")
    94         writemsg(  red("portage: "+portageuser+" user or group missing. Please update baselayout\n"))
    95         writemsg(  red("         and merge portage user(250) and group(250) into your passwd\n"))
    96         writemsg(  red("         and group files. Non-root compilation is disabled until then.\n"))
    97         writemsg(      "         Also note that non-root/wheel users will need to be added to\n")
    98         writemsg(      "         the portage group to do portage commands.\n")
    99         writemsg("\n")
    100         writemsg(      "         For the defaults, line 1 goes into passwd, and 2 into group.\n")
    101         writemsg(green("         portage:x:250:250:portage:/var/tmp/portage:/bin/false\n"))
    102         writemsg(green("         portage::250:portage\n"))
     89        writemsg(  red("portage: "+portageuser+" user or group missing.i\n"))
     90        writemsg(  red("         In Prefix Portage this is quite dramatic\n"))
     91        writemsg(  red("         since it means you have thrown away yourself.\n"))
     92        writemsg(      "         Re-add yourself, or rebootstrap Gentoo Prefix.\n")
    10393        writemsg("\n")
    10494        portage_group_warning()
  • vendor/prefix-portage/current/pym/portage/dbapi/bintree.py

    r3488 r3509  
    11# Copyright 1998-2007 Gentoo Foundation
    22# Distributed under the terms of the GNU General Public License v2
    3 # $Id: bintree.py 6804 2007-06-11 14:26:02Z grobian $
     3# $Id: bintree.py 7033 2007-06-25 12:07:54Z grobian $
    44
    55from portage.dep import isvalidatom, isjustname, dep_getkey, match_from_list
     
    1111from portage.update import update_dbentries
    1212
    13 from portage import listdir, dep_expand
     13from portage import dep_expand, listdir, _movefile
    1414
    1515import portage.xpak, portage.getbinpkg
     
    207207                                                raise
    208208                                        del e
    209                                 os.rename(tbz2path, new_path)
     209                                _movefile(tbz2path, new_path, mysettings=self.settings)
    210210                                self._remove_symlink(mycpv)
    211211                                if new_path.split(os.path.sep)[-2] == "All":
     
    300300                                        raise
    301301                                del e
    302                         os.rename(src_path, os.path.join(self.pkgdir, "All", myfile))
     302                        dest_path = os.path.join(self.pkgdir, "All", myfile)
     303                        _movefile(src_path, dest_path, mysettings=self.settings)
    303304                        self._create_symlink(cpv)
    304305                self._pkg_paths[cpv] = os.path.join("All", myfile)
     
    318319                                raise
    319320                        del e
    320                 os.rename(os.path.join(self.pkgdir, "All", myfile), dest_path)
     321                src_path = os.path.join(self.pkgdir, "All", myfile)
     322                _movefile(src_path, dest_path, mysettings=self.settings)
    321323                self._pkg_paths[cpv] = mypath
    322324
     
    430432                                                                self.dbapi._aux_cache[mycpv] = aux_cache
    431433                                                        continue
     434                                        if not os.access(full_path, os.R_OK):
     435                                                writemsg("!!! Permission denied to read " + \
     436                                                        "binary package: '%s'\n" % full_path,
     437                                                        noiselevel=-1)
     438                                                self.invalids.append(myfile[:-5])
     439                                                continue
    432440                                        mytbz2 = portage.xpak.tbz2(full_path)
    433441                                        # For invalid packages, mycat could be None.
     
    501509                        # from xpak.
    502510                        if update_pkgindex and os.access(self.pkgdir, os.W_OK):
    503                                 cpv_all = self._pkg_paths.keys()
    504                                 stale = set(metadata).difference(cpv_all)
     511                                stale = [cpv for cpv in metadata if cpv not in self._pkg_paths]
    505512                                for cpv in stale:
    506513                                        del metadata[cpv]
     
    677684                                wantnewlockfile=1)
    678685                        if filename is not None:
    679                                 os.rename(filename, self.getname(cpv))
     686                                _movefile(filename, self.getname(cpv), mysettings=self.settings)
    680687                        if self._all_directory and \
    681688                                self.getname(cpv).split(os.path.sep)[-2] == "All":
     
    823830
    824831        def isremote(self, pkgname):
    825                 "Returns true if the package is kept remotely."
    826                 remote = pkgname in self._remotepkgs and \
    827                         not os.path.exists(self.getname(pkgname))
    828                 return remote
     832                """Returns true if the package is kept remotely and it has not been
     833                downloaded (or it is only partially downloaded)."""
     834                if pkgname not in self._remotepkgs:
     835                        return False
     836                pkg_path = self.getname(pkgname)
     837                if os.path.exists(pkg_path) and \
     838                        os.path.basename(pkg_path) not in self.invalids:
     839                        return False
     840                return True
    829841
    830842        def get_use(self, pkgname):
     
    834846
    835847        def gettbz2(self, pkgname):
    836                 "fetches the package from a remote site, if necessary."
     848                """Fetches the package from a remote site, if necessary.  Attempts to
     849                resume if the file appears to be partially downloaded."""
    837850                print "Fetching '"+str(pkgname)+"'"
    838                 mysplit  = pkgname.split("/")
    839                 tbz2name = mysplit[1]+".tbz2"
    840                 if not self.isremote(pkgname):
     851                tbz2_path = self.getname(pkgname)
     852                tbz2name = os.path.basename(tbz2_path)
     853                resume = False
     854                if os.path.exists(tbz2_path):
    841855                        if (tbz2name not in self.invalids):
    842856                                return
    843857                        else:
     858                                resume = True
    844859                                writemsg("Resuming download of this tbz2, but it is possible that it is corrupt.\n",
    845860                                        noiselevel=-1)
    846                 tbz2_path = self.getname(pkgname)
     861               
    847862                mydest = os.path.dirname(self.getname(pkgname))
    848863                try:
     
    850865                except (OSError, IOError):
    851866                        pass
    852                 from urlparse import urljoin
    853                 base_url = self._remote_base_uri
    854                 fcmd = self.settings["RESUMECOMMAND"]
     867                from urlparse import urlparse
     868                # urljoin doesn't work correctly with unrecognized protocols like sftp
    855869                if self._remote_has_index:
    856870                        rel_url = self._remotepkgs[pkgname].get("PATH")
    857871                        if not rel_url:
    858872                                rel_url = pkgname+".tbz2"
    859                         url = urljoin(base_url, rel_url)
    860                         success = portage.getbinpkg.file_get(url, mydest, fcmd=fcmd)
     873                        url = self._remote_base_uri.rstrip("/") + "/" + rel_url.lstrip("/")
    861874                else:
    862                         url = urljoin(base_url, tbz2name)
    863                         success = portage.getbinpkg.file_get(url, mydest, fcmd=fcmd)
     875                        url = self.settings["PORTAGE_BINHOST"].rstrip("/") + "/" + tbz2name
     876                protocol = urlparse(url)[0]
     877                fcmd_prefix = "FETCHCOMMAND"
     878                if resume:
     879                        fcmd_prefix = "RESUMECOMMAND"
     880                fcmd = self.settings.get(fcmd_prefix + "_" + protocol.upper())
     881                if not fcmd:
     882                        fcmd = self.settings.get(fcmd_prefix)
     883                success = portage.getbinpkg.file_get(url, mydest, fcmd=fcmd)
    864884                if success and "strict" in self.settings.features:
    865885                        metadata = self._remotepkgs[pkgname]
  • vendor/prefix-portage/current/pym/portage/dbapi/porttree.py

    r3488 r3509  
    11# Copyright 1998-2007 Gentoo Foundation
    22# Distributed under the terms of the GNU General Public License v2
    3 # $Id: porttree.py 6804 2007-06-11 14:26:02Z grobian $
     3# $Id: porttree.py 7128 2007-07-02 17:31:24Z grobian $
    44
    55from portage.cache.cache_errors import CacheError
     
    2020
    2121from portage import eclass_cache, auxdbkeys, auxdbkeylen, doebuild, flatten, \
    22         listdir, dep_expand, eapi_is_supported, key_expand, dep_check, config
     22        listdir, dep_expand, eapi_is_supported, key_expand, dep_check
    2323
    2424import os, stat, sys
     
    3232                portdbapi.portdbapi_instances.append(self)
    3333
     34                from portage import config
    3435                if mysettings:
    3536                        self.mysettings = mysettings
     
    9192                                self.treemap[repo_name] = path
    9293                        except (OSError,IOError):
     94                                writemsg("Note: The repository at %s does not have a profiles/repo_name entry.\n" % path \
     95                                                + "      This can reduce the functionality of the repository in some cases.\n")
    9396                                pass
    9497               
     
    145148                        # unhandled exception thrown from constructor
    146149                        return
    147                 for x in self.auxdb.keys():
     150                for x in self.auxdb:
    148151                        self.auxdb[x].sync()
    149152                self.auxdb.clear()
     
    193196                TreeMap = {id: path}
    194197                """
    195                 return [k for k in self.treemap.keys() if k]
     198                return [k for k in self.treemap if k]
    196199
    197200        def findname2(self, mycpv, mytree=None):
     
    349352                for x in mylist:
    350353                        if x == "INHERITED":
    351                                 returnme.append(' '.join(mydata.get("_eclasses_", {}).keys()))
     354                                returnme.append(' '.join(mydata.get("_eclasses_", [])))
    352355                        else:
    353356                                returnme.append(mydata.get(x,""))
     
    650653                pkgdict = self.mysettings.pkeywordsdict
    651654                aux_keys = ["KEYWORDS", "LICENSE", "EAPI", "SLOT"]
     655
     656                # Hack: Need to check the env directly here as otherwise stacking
     657                # doesn't work properly as negative values are lost in the config
     658                # object (bug #139600)
     659                egroups = self.mysettings.configdict["backupenv"].get(
     660                        "ACCEPT_KEYWORDS", "").split()
     661
    652662                for mycpv in mylist:
    653663                        try:
     
    671681                                for atom in matches:
    672682                                        pgroups.extend(pkgdict[cp][atom])
     683                                pgroups.extend(egroups)
    673684                                if matches:
    674685                                        # normalize pgroups with incrementals logic so it
  • vendor/prefix-portage/current/pym/portage/dbapi/vartree.py

    r3488 r3509  
    11# Copyright 1998-2007 Gentoo Foundation
    22# Distributed under the terms of the GNU General Public License v2
    3 # $Id: vartree.py 6804 2007-06-11 14:26:02Z grobian $
     3# $Id: vartree.py 7128 2007-07-02 17:31:24Z grobian $
    44
    55from portage.checksum import perform_md5
     
    1212from portage.elog import elog_process
    1313from portage.exception import InvalidPackageName, InvalidAtom, \
    14         UnsupportedAPIException, FileNotFound
     14        FileNotFound, PermissionDenied, UnsupportedAPIException
    1515from portage.locks import lockdir, unlockdir
    1616from portage.output import bold, red, green
     
    2121from portage.versions import pkgsplit, catpkgsplit, catsplit, best, pkgcmp
    2222
    23 from portage import listdir, dep_expand, config, flatten, key_expand, \
    24         doebuild_environment, doebuild, env_update, dircache, \
    25         abssymlink, movefile, bsd_chflags
     23from portage import listdir, dep_expand, flatten, key_expand, \
     24        doebuild_environment, doebuild, env_update, \
     25        abssymlink, movefile, _movefile, bsd_chflags
     26
     27from portage.elog.messages import ewarn
    2628
    2729import os, sys, stat, errno, commands, copy, time
     
    5254                        if e.errno == errno.ENOENT:
    5355                                self._data = {}
     56                        elif e.errno == PermissionDenied.errno:
     57                                raise PermissionDenied(self._filename)
    5458                        else:
    5559                                raise e
     
    107111        def hasEntries(self):
    108112                """ Check if this registry contains any records. """
    109                 return (len(self._data.keys()) > 0)
     113                return len(self._data) > 0
    110114       
    111115        def getPreservedLibs(self):
     
    115119                """
    116120                rValue = {}
    117                 for cps in self._data.keys():
     121                for cps in self._data:
    118122                        rValue[self._data[cps][0]] = self._data[cps][2]
    119123                return rValue
     
    155159                                                obj_dict[lib].append(mysplit[0])
    156160                mapfile = open(self._filename, "w")
    157                 for lib in obj_dict.keys():
     161                for lib in obj_dict:
    158162                        mapfile.write(lib+" "+",".join(obj_dict[lib])+"\n")
    159163                mapfile.close()
     
    184188                self.vartree = vartree
    185189                self._aux_cache_keys = set(["SLOT", "COUNTER", "PROVIDE", "USE",
    186                         "IUSE", "DEPEND", "RDEPEND", "PDEPEND", "NEEDED"])
     190                        "IUSE", "DEPEND", "RDEPEND", "PDEPEND", "NEEDED", "repository"])
    187191                self._aux_cache = None
    188192                self._aux_cache_version = "1"
     
    190194                        CACHE_PATH.lstrip(os.path.sep), "vdb_metadata.pickle")
    191195
    192                 self.libmap = LibraryPackageMap(os.path.join(self.root, CACHE_PATH, "library_consumers"), self)
    193                 self.plib_registry = PreservedLibsRegistry(os.path.join(self.root, CACHE_PATH, "preserved_libs_registry"))
     196                self.libmap = LibraryPackageMap(os.path.join(self.root, CACHE_PATH.lstrip(os.sep), "library_consumers"), self)
     197                try:
     198                        self.plib_registry = PreservedLibsRegistry(
     199                                os.path.join(self.root, PRIVATE_PATH, "preserved_libs_registry"))
     200                except PermissionDenied:
     201                        # apparently this user isn't allowed to access PRIVATE_PATH
     202                        self.plib_registry = None
    194203
    195204        def getpath(self, mykey, filename=None):
     
    302311                                #dest already exists; keep this puppy where it is.
    303312                                continue
    304                         os.rename(origpath, newpath)
     313                        _movefile(origpath, newpath, mysettings=self.settings)
    305314
    306315                        # We need to rename the ebuild now.
     
    311320                                        os.rename(os.path.join(newpath, old_pf + ".ebuild"),
    312321                                                os.path.join(newpath, new_pf + ".ebuild"))
    313                                 except OSError, e:
     322                                except EnvironmentError, e:
    314323                                        if e.errno != errno.ENOENT:
    315324                                                raise
     
    644653                        self.dbapi = copy.deepcopy(clone.dbapi)
    645654                        self.populated = 1
     655                        from portage import config
    646656                        self.settings = config(clone=clone.settings)
    647657                else:
     
    909919                """
    910920                contents_file = os.path.join(self.dbdir, "CONTENTS")
    911                 if not os.path.exists(contents_file):
    912                         return None
    913921                if self.contentscache is not None:
    914922                        return self.contentscache
    915923                pkgfiles = {}
    916                 myc = open(contents_file,"r")
     924                try:
     925                        myc = open(contents_file,"r")
     926                except EnvironmentError, e:
     927                        if e.errno != errno.ENOENT:
     928                                raise
     929                        del e
     930                        self.contentscache = pkgfiles
     931                        return pkgfiles
    917932                mylines = myc.readlines()
    918933                myc.close()
     
    962977                                        pkgfiles[" ".join(mydat[1:])] = [mydat[0]]
    963978                                else:
    964                                         return None
     979                                        writemsg("!!! Unrecognized CONTENTS entry on " + \
     980                                                "line %d: '%s'\n" % (pos, line), noiselevel=-1)
    965981                        except (KeyError, IndexError):
    966                                 print "portage: CONTENTS line", pos, "corrupt!"
     982                                writemsg("!!! Unrecognized CONTENTS entry on " + \
     983                                        "line %d: '%s'\n" % (pos, line), noiselevel=-1)
    967984                self.contentscache = pkgfiles
    968985                return pkgfiles
    969986
    970987        def unmerge(self, pkgfiles=None, trimworld=1, cleanup=1,
    971                 ldpath_mtimes=None, new_contents=None):
     988                ldpath_mtimes=None, others_in_slot=None):
    972989                """
    973990                Calls prerm
     
    9851002                @param ldpath_mtimes: mtimes to pass to env_update (see env_update)
    9861003                @type ldpath_mtimes: Dictionary
    987                 @param new_contents: contents from a new instance that will replace this one
    988                 @type new_contents: Dictionary
     1004                @param others_in_slot: all dblink instances in this slot, excluding self
     1005                @type others_in_slot: list
    9891006                @rtype: Integer
    9901007                @returns:
     
    9971014                """
    9981015
    999                 # When new_contents is supplied, the security check has already been
     1016                # When others_in_slot is supplied, the security check has already been
    10001017                # done for this slot, so it shouldn't be repeated until the next
    10011018                # replacement or unmerge operation.
    1002                 if new_contents is None:
     1019                if others_in_slot is None:
    10031020                        slot = self.vartree.dbapi.aux_get(self.mycpv, ["SLOT"])[0]
    10041021                        slot_matches = self.vartree.dbapi.match(
    10051022                                "%s:%s" % (dep_getkey(self.mycpv), slot))
    1006                         retval = self._security_check(slot_matches)
     1023                        others_in_slot = []
     1024                        for cur_cpv in slot_matches:
     1025                                if cur_cpv == self.mycpv:
     1026                                        continue
     1027                                others_in_slot.append(dblink(self.cat, catsplit(cur_cpv)[1],
     1028                                        self.vartree.root, self.settings, vartree=self.vartree))
     1029                        retval = self._security_check([self] + others_in_slot)
    10071030                        if retval:
    10081031                                return retval
     
    10391062                builddir_lock = None
    10401063                catdir_lock = None
     1064                retval = -1
    10411065                try:
    10421066                        if myebuildpath:
     
    10611085                                        return retval
    10621086
    1063                         self._unmerge_pkgfiles(pkgfiles, new_contents=new_contents)
     1087                        self._unmerge_pkgfiles(pkgfiles, others_in_slot)
    10641088                       
    10651089                        # Remove the registration of preserved libs for this pkg instance
     
    10711095                                         mydbapi=self.vartree.dbapi, vartree=self.vartree)
    10721096
    1073                                 # process logs created during pre/postrm
    1074                                 elog_process(self.mycpv, self.settings)
    1075 
    10761097                                # XXX: Decide how to handle failures here.
    10771098                                if retval != os.EX_OK:
    10781099                                        writemsg("!!! FAILED postrm: %s\n" % retval, noiselevel=-1)
    10791100                                        return retval
    1080                                 doebuild(myebuildpath, "cleanrm", self.myroot, self.settings,
    1081                                         tree="vartree", mydbapi=self.vartree.dbapi,
    1082                                         vartree=self.vartree)
    1083                        
     1101
    10841102                        # regenerate reverse NEEDED map
    10851103                        self.vartree.dbapi.libmap.update()
     
    10871105                finally:
    10881106                        if builddir_lock:
    1089                                 unlockdir(builddir_lock)
     1107                                try:
     1108                                        if myebuildpath:
     1109                                                # process logs created during pre/postrm
     1110                                                elog_process(self.mycpv, self.settings)
     1111                                                if retval == os.EX_OK:
     1112                                                        doebuild(myebuildpath, "cleanrm", self.myroot,
     1113                                                                self.settings, tree="vartree",
     1114                                                                mydbapi=self.vartree.dbapi,
     1115                                                                vartree=self.vartree)
     1116                                finally:
     1117                                        unlockdir(builddir_lock)
    10901118                        try:
    10911119                                if myebuildpath and not catdir_lock:
     
    11061134                return os.EX_OK
    11071135
    1108         def _unmerge_pkgfiles(self, pkgfiles, new_contents=None):
     1136        def _unmerge_pkgfiles(self, pkgfiles, others_in_slot):
    11091137                """
    11101138               
     
    11141142                @param pkgfiles: typically self.getcontents()
    11151143                @type pkgfiles: Dictionary { filename: [ 'type', '?', 'md5sum' ] }
    1116                 @param new_contents: contents from a new instance that will replace this one
    1117                 @type new_contents: Dictionary
     1144                @param others_in_slot: all dblink instances in this slot, excluding self
     1145                @type others_in_slot: list
    11181146                @rtype: None
    11191147                """
    1120                 global dircache
    1121                 dircache={}
    11221148
    11231149                if not pkgfiles:
     
    11251151                        pkgfiles = self.getcontents()
    11261152
    1127                 if not new_contents:
    1128                         counter = self.vartree.dbapi.cpv_counter(self.mycpv)
     1153                if others_in_slot is None:
     1154                        others_in_slot = []
    11291155                        slot = self.vartree.dbapi.aux_get(self.mycpv, ["SLOT"])[0]
    11301156                        slot_matches = self.vartree.dbapi.match(
    11311157                                "%s:%s" % (dep_getkey(self.mycpv), slot))
    1132                         new_cpv = None
    1133                         if slot_matches:
    1134                                 max_counter = -1
    1135                                 for cur_cpv in slot_matches:
    1136                                         cur_counter = self.vartree.dbapi.cpv_counter(cur_cpv)
    1137                                         if cur_counter == counter and \
    1138                                                 cur_cpv == self.mycpv:
    1139                                                 continue
    1140                                         if cur_counter > max_counter:
    1141                                                 max_counter = cur_counter
    1142                                                 new_cpv = cur_cpv
    1143                         if new_cpv:
    1144                                 # The current instance has been replaced by a newer instance.
    1145                                 new_cat, new_pkg = catsplit(new_cpv)
    1146                                 new_contents = dblink(new_cat, new_pkg, self.vartree.root,
    1147                                         self.settings, vartree=self.vartree).getcontents()
     1158                        for cur_cpv in slot_matches:
     1159                                if cur_cpv == self.mycpv:
     1160                                        continue
     1161                                others_in_slot.append(dblink(self.cat, catsplit(cur_cpv)[1],
     1162                                        self.vartree.root, self.settings,
     1163                                        vartree=self.vartree))
     1164                dest_root = normalize_path(self.vartree.root).rstrip(os.path.sep) + \
     1165                        os.path.sep
     1166                dest_root_len = len(dest_root)
     1167
     1168                unmerge_orphans = "unmerge-orphans" in self.settings.features
    11481169
    11491170                if pkgfiles:
     
    11541175                        #process symlinks second-to-last, directories last.
    11551176                        mydirs = []
    1156                         modprotect = "/lib/modules/"
     1177                        modprotect = os.path.join(self.vartree.root, "lib/modules/")
     1178                        def show_unmerge(zing, desc, file_type, file_name):
     1179                                        writemsg_stdout("%s %s %s %s\n" % \
     1180                                                (zing, desc.ljust(8), file_type, file_name))
    11571181                        for objkey in mykeys:
    11581182                                obj = normalize_path(objkey)
    1159                                 if new_contents and obj in new_contents:
    1160                                         # A new instance of this package claims the file, so don't
    1161                                         # unmerge it.
    1162                                         writemsg_stdout("--- !owned %s %s\n" % \
    1163                                                 (pkgfiles[objkey][0], obj))
    1164                                         continue
     1183                                file_data = pkgfiles[objkey]
     1184                                file_type = file_data[0]
    11651185                                statobj = None
    11661186                                try:
     
    11741194                                        pass
    11751195                                islink = lstatobj is not None and stat.S_ISLNK(lstatobj.st_mode)
    1176                                 if statobj is None:
    1177                                         if not islink:
    1178                                                 #we skip this if we're dealing with a symlink
    1179                                                 #because os.stat() will operate on the
    1180                                                 #link target rather than the link itself.
    1181                                                 writemsg_stdout("--- !found " + str(pkgfiles[objkey][0]) + " %s\n" % obj)
     1196                                if lstatobj is None:
     1197                                                show_unmerge("---", "!found", file_type, obj)
     1198                                                continue
     1199                                if obj.startswith(dest_root):
     1200                                        relative_path = obj[dest_root_len:]
     1201                                        is_owned = False
     1202                                        for dblnk in others_in_slot:
     1203                                                if dblnk.isowner(relative_path, dest_root):
     1204                                                        is_owned = True
     1205                                                        break
     1206                                        if is_owned:
     1207                                                # A new instance of this package claims the file, so
     1208                                                # don't unmerge it.
     1209                                                show_unmerge("---", "replaced", file_type, obj)
    11821210                                                continue
    11831211                                # next line includes a tweak to protect modules from being unmerged,
     
    11871215                                # should be able to be independently specified.
    11881216                                if obj.startswith(modprotect):
    1189                                         writemsg_stdout("--- cfgpro %s %s\n" % (pkgfiles[objkey][0], obj))
     1217                                        show_unmerge("---", "cfgpro", file_type, obj)
     1218                                        continue
     1219
     1220                                # Don't unlink symlinks to directories here since that can
     1221                                # remove /lib and /usr/lib symlinks.
     1222                                if unmerge_orphans and \
     1223                                        lstatobj and not stat.S_ISDIR(lstatobj.st_mode) and \
     1224                                        not (islink and statobj and stat.S_ISDIR(statobj.st_mode)) and \
     1225                                        not self.isprotected(obj):
     1226                                        try:
     1227                                                # Remove permissions to ensure that any hardlinks to
     1228                                                # suid/sgid files are rendered harmless.
     1229                                                if statobj and not islink:
     1230                                                        os.chmod(obj, 0)
     1231                                                os.unlink(obj)
     1232                                        except EnvironmentError, e:
     1233                                                pass
     1234                                        show_unmerge("<<<", "", file_type, obj)
    11901235                                        continue
    11911236
    11921237                                lmtime = str(lstatobj[stat.ST_MTIME])
    11931238                                if (pkgfiles[objkey][0] not in ("dir", "fif", "dev")) and (lmtime != pkgfiles[objkey][1]):
    1194                                         writemsg_stdout("--- !mtime %s %s\n" % (pkgfiles[objkey][0], obj))
     1239                                        show_unmerge("---", "!mtime", file_type, obj)
    11951240                                        continue
    11961241
    11971242                                if pkgfiles[objkey][0] == "dir":
    11981243                                        if statobj is None or not stat.S_ISDIR(statobj.st_mode):
    1199                                                 writemsg_stdout("--- !dir   %s %s\n" % ("dir", obj))
     1244                                                show_unmerge("---", "!dir", file_type, obj)
    12001245                                                continue
    12011246                                        mydirs.append(obj)
    12021247                                elif pkgfiles[objkey][0] == "sym":
    12031248                                        if not islink:
    1204                                                 writemsg_stdout("--- !sym   %s %s\n" % ("sym", obj))
     1249                                                show_unmerge("---", "!sym", file_type, obj)
    12051250                                                continue
     1251                                        # Go ahead and unlink symlinks to directories here when
     1252                                        # they're actually recorded as symlinks in the contents.
     1253                                        # Normally, symlinks such as /lib -> lib64 are not recorded
     1254                                        # as symlinks in the contents of a package.  If a package
     1255                                        # installs something into ${D}/lib/, it is recorded in the
     1256                                        # contents as a directory even if it happens to correspond
     1257                                        # to a symlink when it's merged to the live filesystem.
    12061258                                        try:
    12071259                                                os.unlink(obj)
    1208                                                 writemsg_stdout("<<<        %s %s\n" % ("sym", obj))
     1260                                                show_unmerge("<<<", "", file_type, obj)
    12091261                                        except (OSError, IOError),e:
    1210                                                 writemsg_stdout("!!!        %s %s\n" % ("sym", obj))
     1262                                                show_unmerge("!!!", "", file_type, obj)
    12111263                                elif pkgfiles[objkey][0] == "obj":
    12121264                                        if statobj is None or not stat.S_ISREG(statobj.st_mode):
    1213                                                 writemsg_stdout("--- !obj   %s %s\n" % ("obj", obj))
     1265                                                show_unmerge("---", "!obj", file_type, obj)
    12141266                                                continue
    12151267                                        mymd5 = None
     
    12181270                                        except FileNotFound, e:
    12191271                                                # the file has disappeared between now and our stat call
    1220                                                 writemsg_stdout("--- !obj   %s %s\n" % ("obj", obj))
     1272                                                show_unmerge("---", "!obj", file_type, obj)
    12211273                                                continue
    12221274
     
    12241276                                        # string.lower allows for backwards compatibility.
    12251277                                        if mymd5 != pkgfiles[objkey][2].lower():
    1226                                                 writemsg_stdout("--- !md5   %s %s\n" % ("obj", obj))
     1278                                                show_unmerge("---", "!md5", file_type, obj)
    12271279                                                continue
    12281280                                        try:
    12291281                                                # Remove permissions to ensure that any hardlinks to
    12301282                                                # suid/sgid files are rendered harmless.
    1231                                                 os.chmod(obj, 0)
     1283                                                if not islink:
     1284                                                        os.chmod(obj, 0)
    12321285                                                os.unlink(obj)
    12331286                                        except (OSError, IOError), e:
    12341287                                                pass
    1235                                         writemsg_stdout("<<<        %s %s\n" % ("obj", obj))
     1288                                        show_unmerge("<<<", "", file_type, obj)
    12361289                                elif pkgfiles[objkey][0] == "fif":
    12371290                                        if not stat.S_ISFIFO(lstatobj[stat.ST_MODE]):
    1238                                                 writemsg_stdout("--- !fif   %s %s\n" % ("fif", obj))
     1291                                                show_unmerge("---", "!fif", file_type, obj)
    12391292                                                continue
    1240                                         writemsg_stdout("---        %s %s\n" % ("fif", obj))
     1293                                        show_unmerge("---", "", file_type, obj)
    12411294                                elif pkgfiles[objkey][0] == "dev":
    1242                                         writemsg_stdout("---        %s %s\n" % ("dev", obj))
     1295                                        show_unmerge("---", "", file_type, obj)
    12431296
    12441297                        mydirs.sort()
     
    12481301                                try:
    12491302                                        os.rmdir(obj)
    1250                                         writemsg_stdout("<<<        %s %s\n" % ("dir", obj))
    1251                                 except (OSError, IOError):
    1252                                         writemsg_stdout("--- !empty dir %s\n" % obj)
     1303                                        show_unmerge("<<<", "", "dir", obj)
     1304                                except EnvironmentError:
     1305                                        show_unmerge("---", "!empty", "dir", obj)
    12531306
    12541307                #remove self from vartree database so that our own virtual gets zapped if we're the last node
     
    12711324                destfile = normalize_path(
    12721325                        os.path.join(destroot, filename.lstrip(os.path.sep)))
    1273                 try:
    1274                         mylstat = os.lstat(destfile)
    1275                 except (OSError, IOError):
    1276                         return True
    12771326
    12781327                pkgfiles = self.getcontents()
    1279                 if pkgfiles and filename in pkgfiles:
     1328                if pkgfiles and destfile in pkgfiles:
    12801329                        return True
    12811330                if pkgfiles:
     1331                        try:
     1332                                mylstat = os.lstat(destfile)
     1333                        except EnvironmentError, e:
     1334                                if e.errno != errno.ENOENT:
     1335                                        raise
     1336                                del e
     1337                                return True
    12821338                        if self._contents_inodes is None:
    12831339                                self._contents_inodes = set()
     
    12991355                # get list of libraries from old package instance
    13001356                old_contents = self._installed_instance.getcontents().keys()
    1301                 old_libs = set([os.path.basename(x) for x in old_contents]).intersection(libmap.keys())
     1357                old_libs = set([os.path.basename(x) for x in old_contents]).intersection(libmap)
    13021358
    13031359                # get list of libraries from new package instance
    1304                 mylibs = set([os.path.basename(x) for x in mycontents]).intersection(libmap.keys())
     1360                mylibs = set([os.path.basename(x) for x in mycontents]).intersection(libmap)
    13051361
    13061362                # check which libs are present in the old, but not the new package instance
     
    13601416                del preserve_paths
    13611417       
    1362         def _collision_protect(self, srcroot, destroot, otherversions, mycontents, mysymlinks):
     1418        def _collision_protect(self, srcroot, destroot, mypkglist, mycontents, mysymlinks):
    13631419                        collision_ignore = set([normalize_path(myignore) for myignore in \
    13641420                                self.settings.get("COLLISION_IGNORE", "").split()])
     
    13741430                        stopmerge = False
    13751431                        i=0
    1376 
    1377                         otherpkg=[]
    1378                         mypkglist=[]
    1379 
    1380                         if self.pkg in otherversions:
    1381                                 otherversions.remove(self.pkg)  # we already checked this package
    1382 
    1383                         myslot = self.settings["SLOT"]
    1384                         for v in otherversions:
    1385                                 # only allow versions with same slot to overwrite files
    1386                                 if myslot == self.vartree.dbapi.aux_get("/".join((self.cat, v)), ["SLOT"])[0]:
    1387                                         mypkglist.append(
    1388                                                 dblink(self.cat, v, destroot, self.settings,
    1389                                                         vartree=self.vartree))
    1390 
    13911432                        collisions = []
    13921433
     
    14051446                                if i % 1000 == 0:
    14061447                                        print str(i)+" files checked ..."
     1448                                dest_path = normalize_path(
     1449                                        os.path.join(destroot, f.lstrip(os.path.sep)))
     1450                                try:
     1451                                        dest_lstat = os.lstat(dest_path)
     1452                                except EnvironmentError, e:
     1453                                        if e.errno != errno.ENOENT:
     1454                                                raise
     1455                                        del e
     1456                                        continue
    14071457                                if f[0] != "/":
    14081458                                        f="/"+f
     
    14671517                                pass
    14681518
    1469         def _security_check(self, slot_matches):
    1470                 if not slot_matches:
     1519        def _security_check(self, installed_instances):
     1520                if not installed_instances:
    14711521                        return 0
    14721522                file_paths = set()
    1473                 for cpv in slot_matches:
    1474                         file_paths.update(dblink(self.cat, catsplit(cpv)[1],
    1475                                 self.vartree.root, self.settings,
    1476                                 vartree=self.vartree).getcontents())
     1523                for dblnk in installed_instances:
     1524                        file_paths.update(dblnk.getcontents())
    14771525                inode_map = {}
     1526                real_paths = set()
    14781527                for path in file_paths:
    14791528                        try:
     
    14841533                                del e
    14851534                                continue
    1486                         if stat.S_ISREG(s.st_mode) and \
    1487                                 s.st_nlink > 1 and \
     1535                        if not stat.S_ISREG(s.st_mode):
     1536                                continue
     1537                        path = os.path.realpath(path)
     1538                        if path in real_paths:
     1539                                continue
     1540                        real_paths.add(path)
     1541                        if s.st_nlink > 1 and \
    14881542                                s.st_mode & (stat.S_ISUID | stat.S_ISGID):
    14891543                                k = (s.st_dev, s.st_ino)
     
    15581612                slot_matches = self.vartree.dbapi.match(
    15591613                        "%s:%s" % (self.mysplit[0], self.settings["SLOT"]))
    1560                 retval = self._security_check(slot_matches)
     1614                if self.mycpv not in slot_matches and \
     1615                        self.vartree.dbapi.cpv_exists(self.mycpv):
     1616                        # handle multislot or unapplied slotmove
     1617                        slot_matches.append(self.mycpv)
     1618
     1619                others_in_slot = []
     1620                from portage import config
     1621                for cur_cpv in slot_matches:
     1622                        # Clone the config in case one of these has to be unmerged since
     1623                        # we need it to have private ${T} etc... for things like elog.
     1624                        others_in_slot.append(dblink(self.cat, catsplit(cur_cpv)[1],
     1625                                self.vartree.root, config(clone=self.settings),
     1626                                vartree=self.vartree))
     1627                retval = self._security_check(others_in_slot)
    15611628                if retval:
    15621629                        return retval
     
    15641631                if slot_matches:
    15651632                        # Used by self.isprotected().
    1566                         max_cpv = None
     1633                        max_dblnk = None
    15671634                        max_counter = -1
    1568                         for cur_cpv in slot_matches:
    1569                                 cur_counter = self.vartree.dbapi.cpv_counter(cur_cpv)
     1635                        for dblnk in others_in_slot:
     1636                                cur_counter = self.vartree.dbapi.cpv_counter(dblnk.mycpv)
    15701637                                if cur_counter > max_counter:
    15711638                                        max_counter = cur_counter
    1572                                         max_cpv = cur_cpv
    1573                         slot_matches = [max_cpv]
    1574                         self._installed_instance = dblink(self.cat,
    1575                                 catsplit(slot_matches[0])[1], destroot, self.settings,
    1576                                 vartree=self.vartree)
     1639                                        max_dblnk = dblnk
     1640                        self._installed_instance = max_dblnk
    15771641
    15781642                # get current counter value (counter_tick also takes care of incrementing it)
     
    16011665                                mylinklist = filter(os.path.islink, [os.path.join(srcroot, x) for x in listdir(srcroot, recursive=1, filesonly=0, followSymlinks=False)])
    16021666                                mylinklist = [x[len(srcroot):] for x in mylinklist]
    1603                         self._collision_protect(srcroot, destroot, otherversions, myfilelist+mylinklist, mylinklist)
    1604 
    1605                 if os.stat(srcroot).st_dev == os.stat(destroot).st_dev:
     1667                        self._collision_protect(srcroot, destroot, others_in_slot,
     1668                                myfilelist+mylinklist, mylinklist)
     1669
     1670                if True:
    16061671                        """ The merge process may move files out of the image directory,
    16071672                        which causes invalidation of the .installed flag."""
     
    16371702                        self.copyfile(inforoot+"/"+x)
    16381703
     1704                # do we have a origin repository name for the current package
     1705                repopath = os.sep.join(self.settings["O"].split(os.sep)[:-2])
     1706                # bindbapi has no getRepositories() method
     1707                if mydbapi and hasattr(mydbapi, "getRepositories"):
     1708                        foundname = False
     1709                        for reponame in mydbapi.getRepositories():
     1710                                if mydbapi.getRepositoryPath(reponame) == repopath:
     1711                                        fd = open(os.path.join(self.dbtmpdir, "repository"), "w")
     1712                                        fd.write(reponame+"\n")
     1713                                        fd.close()
     1714                                        foundname = True
     1715                                        break
     1716                        if not foundname:
     1717                                ewarn("Could not determine name of source repository at %s" % repopath, phase="preinst", key=self.mycpv)
     1718
    16391719                # write local package counter for recording
    16401720                lcfile = open(os.path.join(self.dbtmpdir, "COUNTER"),"w")
     
    16981778                outfile.flush()
    16991779                outfile.close()
    1700                 self.contentscache = None
    1701                 new_contents = self.getcontents()
    1702 
    1703                 if os.path.exists(self.dbpkgdir):
     1780
     1781                for dblnk in others_in_slot:
     1782                        if dblnk.mycpv != self.mycpv:
     1783                                continue
    17041784                        writemsg_stdout(">>> Safely unmerging already-installed instance...\n")
    1705                         dblink(self.cat, self.pkg, destroot, self.settings,
    1706                                 vartree=self.vartree).unmerge(trimworld=0,
    1707                                         ldpath_mtimes=prev_mtimes, new_contents=new_contents)
     1785                        self.contentscache = None
     1786                        others_in_slot.append(self)  # self has just been merged
     1787                        others_in_slot.remove(dblnk) # dblnk will unmerge itself now
     1788                        dblnk.unmerge(trimworld=0, ldpath_mtimes=prev_mtimes,
     1789                                others_in_slot=others_in_slot)
    17081790                        writemsg_stdout(">>> Original instance of package unmerged safely.\n")
     1791                        break
    17091792
    17101793                # We hold both directory locks.
    17111794                self.dbdir = self.dbpkgdir
    17121795                self.delete()
    1713                 movefile(self.dbtmpdir, self.dbpkgdir, mysettings=self.settings)
     1796                _movefile(self.dbtmpdir, self.dbpkgdir, mysettings=self.settings)
    17141797                contents = self.getcontents()
    17151798
     
    17481831                        target_root=self.settings["ROOT"], prev_mtimes=prev_mtimes,
    17491832                        contents=contents, env=self.settings.environ())
    1750                 #dircache may break autoclean because it remembers the -MERGING-pkg file
    1751                 global dircache
    1752                 if dircache.has_key(self.dbcatdir):
    1753                         del dircache[self.dbcatdir]
     1833
    17541834                writemsg_stdout(">>> %s %s\n" % (self.mycpv,"merged."))
    1755 
    1756                 # Process ebuild logfiles
    1757                 elog_process(self.mycpv, self.settings)
    1758                 if "noclean" not in self.settings.features:
    1759                         doebuild(myebuild, "clean", destroot, self.settings,
    1760                                 tree=self.treetype, mydbapi=mydbapi, vartree=self.vartree)
    17611835                return os.EX_OK
    17621836
     
    19011975                                        if bsd_chflags:
    19021976                                                # Save then clear flags on dest.
    1903                                                 dflags = os.lstat(mydest).st_flags
     1977                                                dflags = mydstat.st_flags
    19041978                                                if dflags != 0:
    19051979                                                        bsd_chflags.lchflags(mydest, 0)
     
    20302104        def merge(self, mergeroot, inforoot, myroot, myebuild=None, cleanup=0,
    20312105                mydbapi=None, prev_mtimes=None):
     2106                retval = -1
     2107                self.lockdb()
    20322108                try:
    2033                         self.lockdb()
    2034                         return self.treewalk(mergeroot, myroot, inforoot, myebuild,
     2109                        retval = self.treewalk(mergeroot, myroot, inforoot, myebuild,
    20352110                                cleanup=cleanup, mydbapi=mydbapi, prev_mtimes=prev_mtimes)
     2111                        # Process ebuild logfiles
     2112                        elog_process(self.mycpv, self.settings)
     2113                        if retval == os.EX_OK and "noclean" not in self.settings.features:
     2114                                if myebuild is None:
     2115                                        myebuild = os.path.join(inforoot, self.pkg + ".ebuild")
     2116                                doebuild(myebuild, "clean", myroot, self.settings,
     2117                                        tree=self.treetype, mydbapi=mydbapi, vartree=self.vartree)
    20362118                finally:
    20372119                        self.unlockdb()
     2120                return retval
    20382121
    20392122        def getstring(self,name):
     
    20832166                return os.path.exists(os.path.join(self.dbdir, "CATEGORY"))
    20842167
    2085 def tar_contents(contents, root, tar, onProgress=None):
    2086         from portage import normalize_path
     2168def tar_contents(contents, root, tar, protect=None, onProgress=None):
     2169        from portage.util import normalize_path
    20872170        root = normalize_path(root).rstrip(os.path.sep) + os.path.sep
    20882171        id_strings = {}
     
    21242207
    21252208                if stat.S_ISREG(lst.st_mode):
    2126                         f = file(path)
    2127                         try:
    2128                                 tar.addfile(tarinfo, f)
    2129                         finally:
    2130                                 f.close()
     2209                        if protect and protect(path):
     2210                                # Create an empty file as a place holder in order to avoid
     2211                                # potential collision-protect issues.
     2212                                tarinfo.size = 0
     2213                                tar.addfile(tarinfo)
     2214                        else:
     2215                                f = open(path)
     2216                                try:
     2217                                        tar.addfile(tarinfo, f)
     2218                                finally:
     2219                                        f.close()
    21312220                else:
    21322221                        tar.addfile(tarinfo)
  • vendor/prefix-portage/current/pym/portage/dbapi/virtual.py

    r3488 r3509  
    11# Copyright 1998-2007 Gentoo Foundation
    22# Distributed under the terms of the GNU General Public License v2
    3 # $Id: virtual.py 6734 2007-06-05 16:37:29Z grobian $
     3# $Id: virtual.py 6944 2007-06-22 08:46:32Z grobian $
    44
    55
     
    4141        def cp_all(self):
    4242                returnme=[]
    43                 for x in self.cpdict.keys():
     43                for x in self.cpdict:
    4444                        returnme.extend(self.cpdict[x])
    4545                return returnme
  • vendor/prefix-portage/current/pym/portage/eclass_cache.py

    r3488 r3509  
    88from portage.data import portage_gid
    99
    10 class cache:
     10class cache(object):
    1111        """
    1212        Maintains the cache information about eclasses used in ebuild.
  • vendor/prefix-portage/current/pym/portage/elog/__init__.py

    r3488 r3509  
    22# Copyright 2006-2007 Gentoo Foundation
    33# Distributed under the terms of the GNU General Public License v2
    4 # $Id: __init__.py 6593 2007-05-23 16:27:03Z grobian $
     4# $Id: __init__.py 7128 2007-07-02 17:31:24Z grobian $
    55
    66from portage.const import EBUILD_PHASES
     
    1616def _merge_logentries(a, b):
    1717        rValue = {}
    18         phases = set(a.keys()+b.keys())
     18        phases = set(a)
     19        phases.update(b)
    1920        for p in phases:
    2021                rValue[p] = []
     
    4142
    4243_elog_atexit_handlers = []
    43 def elog_process(cpv, mysettings):
     44_preserve_logentries = {}
     45def elog_process(cpv, mysettings, phasefilter=None):
    4446        ebuild_logentries = collect_ebuild_messages(os.path.join(mysettings["T"], "logging"))
    4547        all_logentries = collect_messages()
     
    4951                all_logentries[cpv] = ebuild_logentries
    5052
     53        for key in _preserve_logentries.keys():
     54                if all_logentries.has_key(key):
     55                        all_logentries[key] = _merge_logentries(_preserve_logentries[key], all_logentries[key])
     56                else:
     57                        all_logentries[key] = _preserve_logentries[key]
     58                del _preserve_logentries[key]
     59
     60        if phasefilter != None:
     61                for key in all_logentries:
     62                        all_logentries[key], _preserve_logentries[key] = phasefilter(all_logentries[key])
     63
    5164        my_elog_classes = set(mysettings.get("PORTAGE_ELOG_CLASSES", "").split())
    5265
    53 
    54         for key in all_logentries.keys():
     66        for key in all_logentries:
    5567                default_logentries = filter_loglevels(all_logentries[key], my_elog_classes)
    5668
     
    97109                                if hasattr(m, "finalize") and not m.finalize in _elog_atexit_handlers:
    98110                                        _elog_atexit_handlers.append(m.finalize)
    99                                         atexit_register(m.finalize, mysettings)
     111                                        atexit_register(m.finalize)
    100112                        except (ImportError, AttributeError), e:
    101113                                writemsg("!!! Error while importing logging modules " + \
  • vendor/prefix-portage/current/pym/portage/elog/filtering.py

    r3488 r3509  
    44# $Id: __init__.py 6458 2007-04-30 02:31:30Z genone $
    55
     6from portage.const import EBUILD_PHASES
     7
    68def filter_loglevels(logentries, loglevels):
    79        # remove unwanted entries from all logentries
    810        rValue = {}
    911        loglevels = map(str.upper, loglevels)
    10         for phase in logentries.keys():
     12        for phase in logentries:
    1113                for msgtype, msgcontent in logentries[phase]:
    1214                        if msgtype.upper() in loglevels or "*" in loglevels:
     
    1618        return rValue
    1719       
     20def filter_phases(logentries, phases):
     21        rValue1 = {}
     22        rValue2 = {}
     23        phases = map(str.lower, phases)
     24        for phase in logentries:
     25                if phase in phases:
     26                        rValue1[phase] = logentries[phase]
     27                else:
     28                        rValue2[phase] = logentries[phase]
     29        return (rValue1, rValue2)
     30
     31def filter_mergephases(logentries):
     32        myphases = EBUILD_PHASES[:]
     33        myphases.remove("prerm")
     34        myphases.remove("postrm")
     35        return filter_phases(logentries, myphases)
     36
     37def filter_unmergephases(logentries):
     38        return filter_phases(logentries, ["prerm", "postrm", "other"])
  • vendor/prefix-portage/current/pym/portage/elog/messages.py

    r3488 r3509  
    8585
    8686import sys
    87 for f in _functions.keys():
     87for f in _functions:
    8888        setattr(sys.modules[__name__], f, _make_msgfunction(_functions[f][0], _functions[f][1]))
    8989del f, _functions
  • vendor/prefix-portage/current/pym/portage/elog/mod_custom.py

    r3488 r3509  
    22# Copyright 2006-2007 Gentoo Foundation
    33# Distributed under the terms of the GNU General Public License v2
    4 # $Id: mod_custom.py 6593 2007-05-23 16:27:03Z grobian $
     4# $Id: mod_custom.py 6944 2007-06-22 08:46:32Z grobian $
    55
    66import portage.elog_modules.mod_save, portage.process, portage.exception
     
    99        elogfilename = portage.elog_modules.mod_save.process(mysettings, key, logentries, fulltext)
    1010       
    11         if (not "PORTAGE_ELOG_COMMAND" in mysettings.keys()) \
    12                         or len(mysettings["PORTAGE_ELOG_COMMAND"]) == 0:
     11        if not mysettings.get("PORTAGE_ELOG_COMMAND"):
    1312                raise portage.exception.MissingParameter("!!! Custom logging requested but PORTAGE_ELOG_COMMAND is not defined")
    1413        else:
  • vendor/prefix-portage/current/pym/portage/elog/mod_echo.py

    r3488 r3509  
    22# Copyright 2007 Gentoo Foundation
    33# Distributed under the terms of the GNU General Public License v2
    4 # $Id: mod_echo.py 6593 2007-05-23 16:27:03Z grobian $
     4# $Id: mod_echo.py 7054 2007-06-27 07:57:53Z grobian $
    55
    66from portage.output import EOutput
    77from portage.const import EBUILD_PHASES
    88
    9 _items = {}
     9_items = []
    1010def process(mysettings, key, logentries, fulltext):
    11         _items[key] = logentries
     11        global _items
     12        _items.append((mysettings, key, logentries))
    1213
    13 def finalize(mysettings):
     14def finalize():
     15        global _items
    1416        printer = EOutput()
    15         for key in _items.keys():
     17        for mysettings, key, logentries in _items:
     18                root_msg = ""
     19                if mysettings["ROOT"] != "/":
     20                        root_msg = " merged to %s" % mysettings["ROOT"]
    1621                print
    17                 printer.einfo("Messages for package %s:" % key)
     22                printer.einfo("Messages for package %s%s:" % (key, root_msg))
    1823                print
    1924                for phase in EBUILD_PHASES:
    20                         if not phase in _items[key]:
     25                        if phase not in logentries:
    2126                                continue
    22                         for msgtype, msgcontent in _items[key][phase]:
     27                        for msgtype, msgcontent in logentries[phase]:
    2328                                fmap = {"INFO": printer.einfo,
    2429                                                "WARN": printer.ewarn,
     
    2833                                for line in msgcontent:
    2934                                        fmap[msgtype](line.strip("\n"))
     35        _items = []
    3036        return
  • vendor/prefix-portage/current/pym/portage/elog/mod_mail_summary.py

    r3488 r3509  
    22# Copyright 2006-2007 Gentoo Foundation
    33# Distributed under the terms of the GNU General Public License v2
    4 # $Id: mod_mail_summary.py 6593 2007-05-23 16:27:03Z grobian $
     4# $Id: mod_mail_summary.py 6993 2007-06-24 15:46:46Z grobian $
    55
    66import portage.mail, socket, os, time
     
    99_items = {}
    1010def process(mysettings, key, logentries, fulltext):
     11        global _items
    1112        header = ">>> Messages generated for package %s by process %d on %s:\n\n" % \
    1213                (key, os.getpid(), time.strftime("%Y%m%d-%H%M%S", time.gmtime(time.time())))
    13         _items[key] = header + fulltext
     14        config_root = mysettings["PORTAGE_CONFIGROOT"]
     15        mysettings, items = _items.setdefault(config_root, (mysettings, {}))
     16        items[key] = header + fulltext
    1417
    15 def finalize(mysettings):
    16         if len(_items) == 0:
     18def finalize():
     19        global _items
     20        for mysettings, items in _items.itervalues():
     21                _finalize(mysettings, items)
     22        _items.clear()
     23
     24def _finalize(mysettings, items):
     25        if len(items) == 0:
    1726                return
    18         elif len(_items) == 1:
     27        elif len(items) == 1:
    1928                count = "one package"
    2029        else:
     
    3241        mybody = "elog messages for the following packages generated by " + \
    3342                "process %d on host %s:\n" % (os.getpid(), socket.getfqdn())
    34         for key in _items.keys():
     43        for key in items:
    3544                 mybody += "- %s\n" % key
    3645
    37         mymessage = portage.mail.create_message(myfrom, myrecipient, mysubject, mybody, attachments=_items.values())
     46        mymessage = portage.mail.create_message(myfrom, myrecipient, mysubject,
     47                mybody, attachments=items.values())
    3848        portage.mail.send_mail(mysettings, mymessage)
    3949
  • vendor/prefix-portage/current/pym/portage/env/config.py

    r3488 r3509  
    3030
    3131                self.data, self.errors = self._loader.load()
     32
     33        def __iter__(self):
     34                return iter(self.data)
    3235
    3336class PackageKeywordsFile(UserConfigKlass):
  • vendor/prefix-portage/current/pym/portage/exception.py

    r3488 r3509  
    5454
    5555class PermissionDenied(PortageException):
     56        from errno import EACCES as errno
    5657        """Permission denied"""
    5758
  • vendor/prefix-portage/current/pym/portage/getbinpkg.py

    r3488 r3509  
    8080        optional connection. If connection is already active, it is passed on.
    8181        baseurl is reduced to address and is returned in tuple (conn,address)"""
     82
    8283        parts = baseurl.split("://",1)
    8384        if len(parts) != 2:
     
    8586        protocol,url_parts = parts
    8687        del parts
    87         host,address = url_parts.split("/",1)
     88
     89        url_parts = url_parts.split("/")
     90        host = url_parts[0]
     91        if len(url_parts) < 2:
     92                address = "/"
     93        else:
     94                address = "/"+"/".join(url_parts[1:])
    8895        del url_parts
    89         address = "/"+address
    9096
    9197        userpass_host = host.split("@",1)
     
    137143                        conn.set_pasv(passive)
    138144                        conn.set_debuglevel(0)
     145                elif protocol == "sftp":
     146                        try:
     147                                import paramiko
     148                        except ImportError:
     149                                raise NotImplementedError(
     150                                        "paramiko must be installed for sftp support")
     151                        t = paramiko.Transport(host)
     152                        t.connect(username=username, password=password)
     153                        conn = paramiko.SFTPClient.from_transport(t)
    139154                else:
    140155                        raise NotImplementedError, "%s is not a supported protocol." % protocol
     
    303318                else:
    304319                        listing = conn.nlst(address)
     320        elif protocol == "sftp":
     321                listing = conn.listdir(address)
    305322        else:
    306323                raise TypeError, "Unknown protocol. '%s'" % protocol
     
    328345        elif protocol in ["ftp"]:
    329346                data,rc,msg = make_ftp_request(conn, address, -chunk_size)
     347        elif protocol == "sftp":
     348                f = conn.open(address)
     349                try:
     350                        f.seek(-chunk_size, 2)
     351                        data = f.read()
     352                finally:
     353                        f.close()
    330354        else:
    331355                raise TypeError, "Unknown protocol. '%s'" % protocol
     
    362386                return file_get_lib(baseurl,dest,conn)
    363387
    364         fcmd = fcmd.replace("${DISTDIR}",dest)
    365         fcmd = fcmd.replace("${URI}", baseurl)
    366         fcmd = fcmd.replace("${FILE}", os.path.basename(baseurl))
    367         mysplit = fcmd.split()
    368         mycmd   = mysplit[0]
    369         myargs  = [os.path.basename(mycmd)]+mysplit[1:]
    370         mypid=os.fork()
    371         if mypid == 0:
    372                 try:
    373                         os.execv(mycmd,myargs)
    374                 except OSError:
    375                         pass
    376                 sys.stderr.write("!!! Failed to spawn fetcher.\n")
    377                 sys.stderr.flush()
    378                 os._exit(1)
    379         retval=os.waitpid(mypid,0)[1]
    380         if (retval & 0xff) == 0:
    381                 retval = retval >> 8
    382         else:
    383                 sys.stderr.write("Spawned processes caught a signal.\n")
    384                 sys.exit(1)
    385         if retval != 0:
     388        variables = {
     389                "DISTDIR": dest,
     390                "URI":     baseurl,
     391                "FILE":    os.path.basename(baseurl)
     392        }
     393        import shlex, StringIO
     394        from portage.util import varexpand
     395        from portage.process import spawn
     396        lexer = shlex.shlex(StringIO.StringIO(fcmd), posix=True)
     397        lexer.whitespace_split = True
     398        myfetch = [varexpand(x, mydict=variables) for x in lexer]
     399        retval = spawn(myfetch, env=os.environ.copy())
     400        if retval != os.EX_OK:
    386401                sys.stderr.write("Fetcher exited with a failure condition.\n")
    387402                return 0
     
    405420        elif protocol in ["ftp"]:
    406421                data,rc,msg = make_ftp_request(conn, address, dest=dest)
     422        elif protocol == "sftp":
     423                rc = 0
     424                try:
     425                        f = conn.open(address)
     426                except SystemExit:
     427                        raise
     428                except Exception:
     429                        rc = 1
     430                else:
     431                        try:
     432                                if dest:
     433                                        bufsize = 8192
     434                                        while True:
     435                                                data = f.read(bufsize)
     436                                                if not data:
     437                                                        break
     438                                                dest.write(data)
     439                        finally:
     440                                f.close()
    407441        else:
    408442                raise TypeError, "Unknown protocol. '%s'" % protocol
     
    517551                x = os.path.basename(x)
    518552                binpkg_filenames.add(x)
    519                 if ((not metadata[baseurl]["data"].has_key(x)) or \
    520                     (x not in metadata[baseurl]["data"].keys())):
     553                if x not in metadata[baseurl]["data"]:
    521554                        sys.stderr.write(yellow("x"))
    522555                        metadata[baseurl]["modified"] = 1
  • vendor/prefix-portage/current/pym/portage/gpg.py

    r3488 r3509  
    3131
    3232
    33 class FileChecker:
     33class FileChecker(object):
    3434        def __init__(self,keydir=None,keyring=None,requireSignedRing=False,minimumTrust=EXISTS):
    3535                self.minimumTrust     = TRUSTED  # Default we require trust. For rings.
  • vendor/prefix-portage/current/pym/portage/locks.py

    r3488 r3509  
    286286        results.append("Found %(count)s locks" % {"count":mycount})
    287287       
    288         for x in mylist.keys():
     288        for x in mylist:
    289289                if mylist[x].has_key(myhost) or remove_all_locks:
    290290                        mylockname = hardlock_name(path+"/"+x)
     
    292292                           not os.path.exists(path+"/"+x) or \
    293293                                 remove_all_locks:
    294                                 for y in mylist[x].keys():
     294                                for y in mylist[x]:
    295295                                        for z in mylist[x][y]:
    296296                                                filename = path+"/"+x+".hardlock-"+y+"-"+z
  • vendor/prefix-portage/current/pym/portage/manifest.py

    r3488 r3509  
    8080class Manifest1Entry(ManifestEntry):
    8181        def __str__(self):
    82                 myhashkeys = self.hashes.keys()
    83                 for hashkey in myhashkeys:
     82                for hashkey in self.hashes:
    8483                        if hashkey != "size":
    8584                                break
     
    346345
    347346        def checkIntegrity(self):
    348                 for t in self.fhashdict.keys():
     347                for t in self.fhashdict:
    349348                        for f in self.fhashdict[t]:
    350                                 if not portage.const.MANIFEST2_REQUIRED_HASH in self.fhashdict[t][f].keys():
     349                                if portage.const.MANIFEST2_REQUIRED_HASH not in self.fhashdict[t][f]:
    351350                                        raise MissingParameter("Missing %s checksum: %s %s" % (portage.const.MANIFEST2_REQUIRED_HASH, t, f))
    352351
     
    489488                                pass
    490489                        if f in distfilehashes and \
     490                                not required_hash_types.difference(distfilehashes[f]) and \
    491491                                ((assumeDistHashesSometimes and mystat is None) or \
    492492                                (assumeDistHashesAlways and mystat is None) or \
    493493                                (assumeDistHashesAlways and mystat is not None and \
    494494                                len(distfilehashes[f]) == len(self.hashes) and \
    495                                 distfilehashes[f]["size"] == mystat.st_size)) and \
    496                                 not required_hash_types.difference(distfilehashes[f]):
     495                                distfilehashes[f]["size"] == mystat.st_size)):
    497496                                self.fhashdict["DIST"][f] = distfilehashes[f]
    498497                        else:
  • vendor/prefix-portage/current/pym/portage/news.py

    r3488 r3509  
    55
    66from portage.const import INCREMENTALS, PROFILE_PATH, NEWS_LIB_PATH
    7 from portage import config, vartree, vardbapi, portdbapi
    87from portage.util import ensure_dirs, apply_permissions
    98from portage.data import portage_gid
     
    2726        TIMESTAMP_FILE = "news-timestamp"
    2827
    29         def __init__(self, root, NEWS_PATH, UNREAD_PATH, LANGUAGE_ID='en'):
     28        def __init__(self, portdb, vardb, NEWS_PATH, UNREAD_PATH, LANGUAGE_ID='en'):
    3029                self.NEWS_PATH = NEWS_PATH
    3130                self.UNREAD_PATH = UNREAD_PATH
    32                 self.TIMESTAMP_PATH = os.path.join(root, NEWS_LIB_PATH, NewsManager.TIMESTAMP_FILE)
    33                 self.target_root = root
     31                self.TIMESTAMP_PATH = os.path.join(vardb.root,
     32                        NEWS_LIB_PATH, NewsManager.TIMESTAMP_FILE)
     33                self.target_root = vardb.root
    3434                self.LANGUAGE_ID = LANGUAGE_ID
    35                 self.config = config(config_root = os.environ.get("PORTAGE_CONFIGROOT", "/"),
    36                                 target_root = root, config_incrementals = INCREMENTALS)
    37                 self.vdb = vardbapi(settings = self.config, root = root,
    38                         vartree = vartree(root = root, settings = self.config))
    39                 self.portdb = portdbapi(porttree_root = self.config["PORTDIR"], mysettings = self.config)
     35                self.config = vardb.settings
     36                self.vdb = vardb
     37                self.portdb = portdb
     38
     39                portdir = portdb.porttree_root
     40                profiles_base = os.path.join(portdir, "profiles") + os.path.sep
     41                from portage.util import normalize_path
     42                profile_path = normalize_path(
     43                        os.path.realpath(portdb.mysettings.profile_path))
     44                if profile_path.startswith(profiles_base):
     45                        profile_path = profile_path[len(profiles_base):]
     46                self._profile_path = profile_path
    4047
    4148                # Ensure that the unread path exists and is writable.
     
    7986                        except (TypeError, ValueError), e:
    8087                                continue
    81                         if item.isRelevant(profile=os.readlink(PROFILE_PATH), config=config, vardb=self.vdb):
     88                        if item.isRelevant(profile=self._profile_path,
     89                                config=self.config, vardb=self.vdb):
    8290                                updates.append(item)
    8391                del path
  • vendor/prefix-portage/current/pym/portage/output.py

    r3488 r3509  
    114114
    115115codes["darkteal"]   = codes["turquoise"]
    116 codes["darkyellow"] = codes["brown"]
     116# Some terminals have darkyellow instead of brown.
     117codes["0xAAAA00"]   = codes["brown"]
     118codes["darkyellow"] = codes["0xAAAA00"]
    117119codes["fuscia"]     = codes["fuchsia"]
    118120codes["white"]      = codes["bold"]
     
    130132codes["SECURITY_WARN"] = codes["red"]
    131133codes["MERGE_LIST_PROGRESS"] = codes["yellow"]
     134codes["PKG_MERGE"]           = codes["darkgreen"]
     135codes["PKG_MERGE_ARG"]       = codes["darkgreen"]
     136codes["PKG_MERGE_SYSTEM"]    = codes["green"]
     137codes["PKG_MERGE_WORLD"]     = codes["green"]
     138codes["PKG_NOMERGE"]         = codes["darkblue"]
     139codes["PKG_NOMERGE_ARG"]     = codes["darkblue"]
     140codes["PKG_NOMERGE_SYSTEM"]  = codes["blue"]
     141codes["PKG_NOMERGE_WORLD"]   = codes["blue"]
    132142
    133143def parse_color_map():
     
    203213                                if shell:
    204214                                        spawn([shell, "-c", prompt_command], env=os.environ,
    205                                                 fdpipes={0:sys.stdin.fileno(),1:sys.stderr.fileno(),
     215                                                fd_pipes={0:sys.stdin.fileno(),1:sys.stderr.fileno(),
    206216                                                2:sys.stderr.fileno()})
    207217                                else:
     
    257267        `stty size` is parsed.
    258268        """
     269        if not sys.stdout.isatty():
     270                return -1, -1
    259271        try:
    260272                import curses
    261                 curses.setupterm()
    262                 return curses.tigetnum('lines'), curses.tigetnum('cols')
     273                try:
     274                        curses.setupterm()
     275                        return curses.tigetnum('lines'), curses.tigetnum('cols')
     276                except curses.error:
     277                        pass
    263278        except ImportError:
    264279                pass
     
    282297        spawn(cmd, env=os.environ, fd_pipes={0:fd})
    283298
    284 class EOutput:
     299class EOutput(object):
    285300        """
    286301        Performs fancy terminal formatting for status and informational messages.
     
    519534                maxval = self._maxval
    520535                position = self._position
    521                 if cols < 3:
     536                percentage_str_width = 4
     537                square_brackets_width = 2
     538                if cols < percentage_str_width:
    522539                        return ""
    523                 bar_space = cols - 6
     540                bar_space = cols - percentage_str_width - square_brackets_width
    524541                if maxval == 0:
    525542                        max_bar_width = bar_space-3
     
    546563                        return image
    547564                else:
    548                         max_bar_width = bar_space-1
    549565                        percentage = int(100 * float(curval) / maxval)
    550566                        if percentage == 100:
    551                                 percentage = 99
    552                         image = ("%d%% " % percentage).rjust(4)
     567                                percentage_str_width += 1
     568                                bar_space -= 1
     569                        max_bar_width = bar_space - 1
     570                        image = ("%d%% " % percentage).rjust(percentage_str_width)
    553571                        if cols < min_columns:
    554572                                return image
  • vendor/prefix-portage/current/pym/portage/tests/__init__.py

    r3488 r3509  
    22# Copyright 2006 Gentoo Foundation
    33# Distributed under the terms of the GNU General Public License v2
    4 # $Id: __init__.py 6312 2007-03-28 19:20:08Z grobian $
     4# $Id: __init__.py 6943 2007-06-22 08:42:54Z grobian $
    55
    66import os, sys, time, unittest
     
    88
    99def main():
    10         testDirs = ["bin", "util","versions", "dep", "xpak", "env/config"]
     10        testDirs = ["bin", "dep", "ebuild",
     11                "env/config", "util", "versions", "xpak"]
    1112        suite = unittest.TestSuite()
    1213        basedir = os.path.dirname(__file__)
  • vendor/prefix-portage/current/pym/portage/tests/bin/setup_env.py

    r3488 r3509  
    88from portage.tests import TestCase
    99from portage.process import spawn
     10from portage.const import PORTAGE_BIN_PATH
    1011
    1112bindir = join(dirname(dirname(abspath(__file__))), "..", "..", "..", "bin")
     
    1617os.environ["PF"] = "portage-tests-0.09-r1"
    1718os.environ["PATH"] = bindir + ":" + os.environ["PATH"]
     19os.environ["PORTAGE_BIN_PATH"] = PORTAGE_BIN_PATH
    1820
    1921def binTestsCleanup():
  • vendor/prefix-portage/current/pym/portage/tests/env/config/test_PackageMaskFile.py

    r3488 r3509  
    1919                        f = PackageMaskFile(self.fname)
    2020                        f.load()
    21                         [atom for atom in f.keys() if self.assertTrue(atom in self.atoms)]
     21                        for atom in f:
     22                                self.assertTrue(atom in self.atoms)
    2223                finally:
    2324                        self.NukeFile()
  • vendor/prefix-portage/current/pym/portage/tests/env/config/test_PortageModulesFile.py

    r3488 r3509  
    1919                self.BuildFile()
    2020                f = PortageModulesFile(self.fname)
    21                 for k in f.keys():
     21                for k in f:
    2222                        self.assertEqual( f[k], self.items[k] )
    2323                self.NukeFile()
  • vendor/prefix-portage/current/pym/portage/tests/runTests

    • Property svn:executable set to *
  • vendor/prefix-portage/current/pym/portage/tests/util/test_varExpand.py

    r3488 r3509  
    22# Copyright 2006 Gentoo Foundation
    33# Distributed under the terms of the GNU General Public License v2
    4 # $Id: test_varExpand.py 6532 2007-05-13 20:52:10Z grobian $
     4# $Id: test_varExpand.py 6944 2007-06-22 08:46:32Z grobian $
    55
    66from portage.tests import TestCase
     
    1212
    1313                varDict = { "a":"5", "b":"7", "c":"-5" }
    14                 for key in varDict.keys():
     14                for key in varDict:
    1515                        result = varexpand( "$%s" % key, varDict )
    1616                       
  • vendor/prefix-portage/current/pym/portage/update.py

    r3488 r3509  
    208208                                                sys.stdout.flush()
    209209
    210         write_atomic(os.path.join(config_root, WORLD_FILE), "\n".join(worldlist))
     210        worldlist.sort()
     211        write_atomic(os.path.join(config_root, WORLD_FILE), "\n".join(worldlist)+"\n")
    211212
    212213        protect_obj = ConfigProtect(
  • vendor/prefix-portage/current/pym/portage/util.py

    r3488 r3509  
    7878        Returns a new dictlist."""
    7979        new_dl = {}
    80         for key in myDict.keys():
     80        for key in myDict:
    8181                new_dl[key] = []
    8282                new_dl[key] = map(func,myDict[key])
     
    120120                if mydict is None:
    121121                        continue
    122                 for y in mydict.keys():
     122                for y in mydict:
    123123                        if not y in final_dict:
    124124                                final_dict[y] = []
     
    282282                                myfile.write(x+"\n")
    283283                else:
    284                         for x in mydict.keys():
     284                        for x in mydict:
    285285                                myfile.write("%s %s\n" % (x, " ".join(mydict[x])))
    286286                myfile.close()
  • vendor/prefix-portage/current/pym/portage/xpak.py

    r3488 r3509  
    225225        os.chdir(origdir)
    226226
    227 class tbz2:
     227class tbz2(object):
    228228        def __init__(self,myfile):
    229229                self.file=myfile
  • vendor/prefix-portage/current/src/Makefile.am

    r3488 r3509  
    77endif
    88
    9 if BUILD_MISSINGOS
    10 SUBDIRS += python-missingos
    11 endif
    12 
    139tbz2tool_SOURCES = tbz2tool.c
    1410
  • vendor/prefix-portage/current/src/Makefile.in

    r3488 r3509  
    3636bin_PROGRAMS = $(am__EXEEXT_1)
    3737@BUILD_TBZ2TOOL_TRUE@am__append_1 = tbz2tool
    38 @BUILD_MISSINGOS_TRUE@am__append_2 = python-missingos
    3938subdir = src
    4039DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in
     
    7372ETAGS = etags
    7473CTAGS = ctags
    75 DIST_SUBDIRS = python-missingos
     74DIST_SUBDIRS = $(SUBDIRS)
    7675DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
    7776ACLOCAL = @ACLOCAL@
    78 ALLOCA = @ALLOCA@
    7977AMTAR = @AMTAR@
    8078ARCH = @ARCH@
     
    179177program_transform_name = @program_transform_name@
    180178psdir = @psdir@
     179rootgid = @rootgid@
    181180rootuid = @rootuid@
    182181rootuser = @rootuser@
     
    192191top_builddir = @top_builddir@
    193192top_srcdir = @top_srcdir@
    194 wheelgid = @wheelgid@
    195 SUBDIRS = $(am__append_2)
     193SUBDIRS =
    196194tbz2tool_SOURCES = tbz2tool.c
    197195MAINTAINERCLEANFILES = Makefile.in
  • vendor/prefix-portage/current/src/bsd-flags/setup.py

    • Property svn:executable set to *
  • vendor/prefix-portage/current/svnlogmsg.awk

    • Property svn:executable set to *
Note: See TracChangeset for help on using the changeset viewer.