- Timestamp:
- Jul 3, 2007, 11:02:52 PM (18 years ago)
- Location:
- trunk/essentials/sys-apps/prefix-portage
- Files:
-
- 1 deleted
- 145 edited
- 12 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk/essentials/sys-apps/prefix-portage/Makefile.in
r3488 r3511 38 38 $(srcdir)/subst-install.vars.in.in \ 39 39 $(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 \ 43 42 install-sh ltmain.sh missing 44 43 ACLOCAL_M4 = $(top_srcdir)/aclocal.m4 … … 50 49 configure.lineno config.status.lineno 51 50 mkinstalldirs = $(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 51 CONFIG_CLEAN_FILES = subst-install subst-install.vars.in bin/Makefile \ 52 pym/Makefile cnf/Makefile 55 53 SOURCES = 56 54 DIST_SOURCES = … … 79 77 distcleancheck_listfiles = find . -type f -print 80 78 ACLOCAL = @ACLOCAL@ 81 ALLOCA = @ALLOCA@82 79 AMTAR = @AMTAR@ 83 80 ARCH = @ARCH@ … … 182 179 program_transform_name = @program_transform_name@ 183 180 psdir = @psdir@ 181 rootgid = @rootgid@ 184 182 rootuid = @rootuid@ 185 183 rootuser = @rootuser@ … … 195 193 top_builddir = @top_builddir@ 196 194 top_srcdir = @top_srcdir@ 197 wheelgid = @wheelgid@198 195 SUBDIRS = src man bin pym cnf 199 196 AUTOMAKE_OPTIONS = dist-bzip2 no-dist-gzip … … 242 239 cd $(top_builddir) && $(SHELL) ./config.status $@ 243 240 subst-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.in246 241 cd $(top_builddir) && $(SHELL) ./config.status $@ 247 242 bin/Makefile: $(top_builddir)/config.status $(top_srcdir)/bin/Makefile.in -
trunk/essentials/sys-apps/prefix-portage/RELEASE-NOTES
r3488 r3511 18 18 For packages that don't specify any other KEYWORDS you can use the new ** token 19 19 as documented in portage(5) to disable KEYWORDS filtering completely. 20 21 portage-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. 20 29 21 30 portage-2.1.2 -
trunk/essentials/sys-apps/prefix-portage/acinclude.m4
r3488 r3511 43 43 AC_PATH_PROG([XCU_ID], [id], no, $1) 44 44 45 dnl is is there at all?46 if test "$PYTHON" = "no" ; then47 AC_MSG_ERROR([no python found in your path])48 fi49 50 45 dnl does it support all the bells and whistles we need? 51 46 AC_MSG_CHECKING([whether $XCU_ID is good enough]) -
trunk/essentials/sys-apps/prefix-portage/bin/archive-conf
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/check-implicit-pointer-usage.py
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/chkcontents
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/clean_locks
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/dispatch-conf
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/dobin
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/doconfd
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/dodir
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/dodoc
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/doenvd
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/doexe
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/dohard
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/dohtml
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/doinfo
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/doinitd
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/doins
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/dolib
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/dolib.a
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/dolib.so
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/doman
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/domo
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/dosbin
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/dosed
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/dosym
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/ebuild
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/ebuild.sh
-
Property svn:executable
set to
*
r3505 r3511 80 80 [ ! -z "$PREROOTPATH" ] && export PATH="${PREROOTPATH%%:}${PATH_SEP}$PATH" 81 81 82 source " @PORTAGE_BASE@"/bin/isolated-functions.sh&>/dev/null82 source "${PORTAGE_BIN_PATH}/isolated-functions.sh" &>/dev/null 83 83 84 84 OCC="$CC" … … 204 204 # return shell-true/shell-false if exists. 205 205 # Takes single depend-type atoms. 206 if "@PORTAGE_BASE@"/bin/portageq 'has_version' "${ROOT}" "$1"; then 207 return 0 208 else 209 return 1 210 fi 206 "${PORTAGE_BIN_PATH}"/portageq has_version "${ROOT}" "$1" 207 local retval=$? 208 case "${retval}" in 209 0) 210 return 0 211 ;; 212 1) 213 return 1 214 ;; 215 *) 216 die "unexpected portageq exit code: ${retval}" 217 ;; 218 esac 211 219 } 212 220 … … 215 223 die "portageq calls are not allowed in the global scope" 216 224 fi 217 " @PORTAGE_BASE@"/bin/portageq"$@"225 "${PORTAGE_BIN_PATH}/portageq" "$@" 218 226 } 219 227 … … 230 238 # returns the best/most-current match. 231 239 # Takes single depend-type atoms. 232 " @PORTAGE_BASE@"/bin/portageq'best_version' "${ROOT}" "$1"240 "${PORTAGE_BIN_PATH}/portageq" 'best_version' "${ROOT}" "$1" 233 241 } 234 242 … … 521 529 if ! ${CONFCACHE} ${CONFCACHE_ARG} ${TMP_CONFCACHE_DIR} "${ECONF_SOURCE}/configure" \ 522 530 --prefix="${EPREFIX}"/usr \ 523 --host= "${CHOST}"\531 --host=${CHOST} \ 524 532 --mandir="${EPREFIX}"/usr/share/man \ 525 533 --infodir="${EPREFIX}"/usr/share/info \ … … 1672 1680 # Save current environment and touch a success file. (echo for success) 1673 1681 umask 002 1674 set | @EGREP@-v "^SANDBOX_" > "${T}/environment" 2>/dev/null1675 export | @EGREP@-v "^declare -x SANDBOX_" | \1676 @SED@'s:^declare -rx:declare -x:' >> "${T}/environment" 2>/dev/null1682 set | egrep -v "^SANDBOX_" > "${T}/environment" 2>/dev/null 1683 export | egrep -v "^declare -x SANDBOX_" | \ 1684 sed 's:^declare -rx:declare -x:' >> "${T}/environment" 2>/dev/null 1677 1685 chown ${PORTAGE_USER:-portage}:${PORTAGE_GROUP:-portage} "${T}/environment" &>/dev/null 1678 1686 chmod g+w "${T}/environment" &>/dev/null -
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/ecompress
-
Property svn:executable
set to
*
r3488 r3511 25 25 [[ -n $2 ]] && vecho "${0##*/}: --suffix takes no additional arguments" 1>&2 26 26 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" 41 44 ;; 42 45 --bin) -
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/ecompressdir
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/emaint
-
Property svn:executable
set to
*
r3488 r3511 70 70 errors = [] 71 71 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") 73 74 except portage.exception.PortageException: 74 75 errors.append(self.world_file + " could not be opened for writing") -
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/emake
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/emerge
-
Property svn:executable
set to
*
r3488 r3511 14 14 if __name__ == "__main__": 15 15 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) -
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/emerge-webrsync
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/env-update
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/env-update.sh
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/eprefixify
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/etc-update
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/find-requires
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/fix-db.py
-
Property svn:executable
set to
*
r3488 r3511 138 138 actions = {} 139 139 writemsg("\n\n") 140 for catpkg in bad .keys():140 for catpkg in bad: 141 141 bad[catpkg].sort() 142 142 … … 157 157 if (len(sys.argv) > 1) and (sys.argv[1] == "--fix"): 158 158 writemsg("These are only directions, at the moment.") 159 for catpkg in actions .keys():159 for catpkg in actions: 160 160 action = actions[catpkg] 161 161 writemsg("We will now '%s' '%s'..." % (action, catpkg)) -
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/fixdbentries
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/fixpackages
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/fowners
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/fperms
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/isolated-functions.sh
-
Property svn:executable
set to
*
r3488 r3511 24 24 fi 25 25 26 e cho"Call stack:"26 eerror "Call stack:" 27 27 for (( n = ${#FUNCNAME[@]} - 1, p = ${#BASH_ARGV[@]} ; n > $strip ; n-- )) ; do 28 28 funcname=${FUNCNAME[${n} - 1]} … … 38 38 (( p -= ${BASH_ARGC[${n} - 1]} )) 39 39 fi 40 e cho" ${sourcefile}, line ${lineno}: Called ${funcname}${args:+ ${args}}"40 eerror " ${sourcefile}, line ${lineno}: Called ${funcname}${args:+ ${args}}" 41 41 done 42 42 } … … 45 45 local funcname="$1" lineno="$2" exitcode="$3" 46 46 shift 3 47 e cho >&248 e cho "!!! ERROR: $CATEGORY/$PF failed." >&249 dump_trace 2 1>&250 e cho " $(basename "${BASH_SOURCE[1]}"), line ${BASH_LINENO[0]}: Called die" 1>&251 e cho >&252 e cho "!!! ${*:-(no error message)}" >&253 e cho "!!! If you need support, post the topmost build error, and the call stack if relevant." >&247 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." 54 54 [ -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}'." 57 56 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 64 62 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 65 70 66 71 if [ "${EBUILD_PHASE/depend}" == "${EBUILD_PHASE}" ]; then -
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/md5check.py
-
Property svn:executable
set to
*
r3488 r3511 69 69 continue 70 70 71 if mybn not in md5sums .keys():71 if mybn not in md5sums: 72 72 portage.util.writemsg("Missing md5sum: %s in %s\n" % (mybn, mycpv)) 73 73 else: 74 if mybn in md5_list .keys():74 if mybn in md5_list: 75 75 if (md5_list[mybn]["MD5"] != md5sums[mybn]["MD5"]) or \ 76 76 (md5_list[mybn]["size"] != md5sums[mybn]["size"]): … … 90 90 91 91 #portage.writemsg(str(bn_list)+"\n") 92 for x in md5sums .keys():92 for x in md5sums: 93 93 if x not in bn_list: 94 94 portage.writemsg("Extra md5sum: %s in %s\n" % (x, mycpv)) … … 97 97 print col_list 98 98 print 99 print str(len(md5_list .keys()))+" unique distfile md5s."99 print str(len(md5_list))+" unique distfile md5s." 100 100 print str(len(bn_list))+" unique distfile names." -
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/md5check.sh
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/misc-functions.sh
r3488 r3511 557 557 # for $PKGDIR and/or $PKGDIR/All. 558 558 export SANDBOX_ON="0" 559 [ -z "${PORTAGE_BINPKG_TMPFILE}" ] && \ 560 PORTAGE_BINPKG_TMPFILE="${PKGDIR}/${CATEGORY}/${PVR}.tbz2" 559 561 mkdir -p "${PORTAGE_BINPKG_TMPFILE%/*}" || die "mkdir failed" 560 562 tar ${tar_options} -cf - . | bzip2 -f > "${PORTAGE_BINPKG_TMPFILE}" || \ -
trunk/essentials/sys-apps/prefix-portage/bin/newbin
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/newconfd
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/newdoc
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/newenvd
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/newexe
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/newinitd
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/newins
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/newlib.a
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/newlib.so
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/newman
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/newsbin
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/pemerge.py
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/pkgname
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/portage_gpg_update.sh
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/portageq
-
Property svn:executable
set to
*
r3488 r3511 44 44 # and will automaticly add a command by the same name as the function! 45 45 # 46 47 46 48 47 def has_version(argv): … … 285 284 print portage.db[argv[0]]["porttree"].dbapi.getRepositoryPath(argv[1]) 286 285 286 def 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 305 list_preserved_libs.uses_root = True 306 287 307 #----------------------------------------------------------------------------- 288 308 # … … 302 322 # file, and formatting each functions documentation. 303 323 # 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: 309 330 # Drop non-functions 310 331 obj = globals()[name] … … 356 377 usage(sys.argv) 357 378 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) 358 382 359 383 main() -
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/prepall
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/prepalldocs
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/prepallinfo
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/prepallman
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/prepallstrip
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/prepinfo
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/preplib
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/prepman
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/prepstrip
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/quickpkg
-
Property svn:executable
set to
*
r3488 r3511 7 7 8 8 def 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 13 15 import tarfile 14 16 import portage … … 23 25 successes = [] 24 26 missing = [] 27 config_files_excluded = 0 28 include_config = options.include_config == "y" 29 include_unmodified_config = options.include_unmodified_config == "y" 25 30 for arg in args: 26 31 try: … … 45 50 pkgs_for_arg = 0 46 51 for cpv in matches: 52 excluded_config_files = [] 47 53 bintree.prevent_collision(cpv) 48 54 cat, pkg = catsplit(cpv) … … 55 61 # unmerged by a concurrent process 56 62 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) 57 81 eout.ebegin("Building package for %s" % cpv) 58 82 pkgs_for_arg += 1 59 83 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 60 101 xpdata = xpak.xpak(dblnk.dbdir) 61 102 binpkg_tmpfile = os.path.join(bintree.pkgdir, … … 63 104 ensure_dirs(os.path.dirname(binpkg_tmpfile)) 64 105 tar = tarfile.open(binpkg_tmpfile, "w:bz2") 65 tar_contents(contents, root, tar )106 tar_contents(contents, root, tar, protect=protect) 66 107 tar.close() 67 108 xpak.tbz2(binpkg_tmpfile).recompose_mem(xpdata) … … 81 122 eout.eend(0) 82 123 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) 83 127 if not pkgs_for_arg: 84 128 eout.eerror("Could not find anything " + \ … … 111 155 size_str = str(size) 112 156 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.") 113 161 if missing: 114 162 print … … 119 167 120 168 if __name__ == "__main__": 121 usage = " Usage:quickpkg [options] <list of package atoms>"169 usage = "quickpkg [options] <list of package atoms>" 122 170 from optparse import OptionParser 123 171 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')") 124 190 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:]) 125 195 if not args: 126 196 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) 127 201 # 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) 129 203 from portage.output import get_term_size, EOutput 130 204 eout = EOutput() -
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/regenworld
-
Property svn:executable
set to
*
r3488 r3511 93 93 worldlist.append(myfavkey) 94 94 95 portage.write_atomic(os.path.join("/", portage.WORLD_FILE), "\n".join(worldlist)) 95 portage.write_atomic(os.path.join("/", portage.WORLD_FILE), 96 "\n".join(sorted(worldlist)) + "\n") -
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/repoman
-
Property svn:executable
set to
*
r3488 r3511 175 175 "LICENSE.syntax":"Syntax error in LICENSE (usually an extra/missing space/parenthesis)", 176 176 "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)", 177 178 "SRC_URI.syntax":"Syntax error in SRC_URI (usually an extra/missing space/parenthesis)", 178 179 "ebuild.syntax":"Error generating cache entry for ebuild; typically caused by ebuild syntax error", … … 184 185 "LICENSE.invalid":"This ebuild is listing a license that doesnt exist in portages license/ dir.", 185 186 "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.", 186 188 "ebuild.nostable":"There are no ebuilds that are marked as stable for your ARCH", 187 189 "ebuild.allmasked":"All ebuilds are masked for this package (Package level only)", … … 218 220 "KEYWORDS.stupid", 219 221 "KEYWORDS.missing", 222 "RESTRICT.invalid", 220 223 "ebuild.minorsyn", 221 224 "ebuild.badheader", … … 241 244 qawarnings.append(x) 242 245 246 valid_restrict = frozenset(["binchecks", "bindist", "fetch", "mirror", 247 "primaryuri", "strip", "test", "userpriv"]) 243 248 244 249 verbose=0 … … 354 359 x=1 355 360 while x < len(sys.argv): 356 if sys.argv[x] in shortmodes .keys():361 if sys.argv[x] in shortmodes: 357 362 sys.argv[x]=shortmodes[sys.argv[x]] 358 elif sys.argv[x] in repoman_shortoptions .keys():363 elif sys.argv[x] in repoman_shortoptions: 359 364 sys.argv[x] = repoman_shortoptions[sys.argv[x]] 360 365 if sys.argv[x] in modes: … … 1466 1471 stats["KEYWORDS.invalid"] += 1 1467 1472 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) 1468 1490 1469 1491 #syntax checks … … 1598 1620 if xs[0]==".": 1599 1621 xs=xs[1:] 1600 if xs[0] not in mygroups .keys():1622 if xs[0] not in mygroups: 1601 1623 mygroups[xs[0]]=[seperator.join(xs[1:])] 1602 1624 else: … … 1616 1638 elif not dofail: 1617 1639 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) 1618 1644 if quiet < 1: 1619 1645 print … … 1816 1842 try: 1817 1843 unameout=getstatusoutput("uname -srp")[1] 1818 commitmessage+="\n(Portage "+str(portage.VERSION)+" -prefix/"1844 commitmessage+="\n(Portage "+str(portage.VERSION)+"/" 1819 1845 if isCvs: 1820 1846 commitmessage+="CVS" -
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/sed
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/bin/xpak
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/cnf/etc-update.conf
r3488 r3511 23 23 24 24 # For emacs-users 25 # diff_command="eval emacs -nw --eval=\ (ediff\ \"%file1\"\ \"%file2\"\)"25 # diff_command="eval emacs -nw --eval=\'\(ediff\ \"%file1\"\ \"%file2\"\)\'" 26 26 #using_editor=1 27 27 -
trunk/essentials/sys-apps/prefix-portage/cnf/make.conf
r3488 r3511 71 71 # you try to use portage. *** DO NOT INCLUDE A TRAILING "/" *** 72 72 # 73 # EPREFIX is the filesystem location in which ALL packages will be74 # installed to.75 #EPREFIX=/opt/gentoo76 73 # 77 74 # PORTAGE_TMPDIR is the location portage will use for compilations and 78 75 # temporary storage of data. This can get VERY large depending upon 79 76 # the application being installed. 80 #PORTAGE_TMPDIR= ${EPREFIX}/var/tmp77 #PORTAGE_TMPDIR=@DOMAIN_PREFIX@/var/tmp 81 78 # 82 79 # PORTDIR is the location of the portage tree. This is the repository 83 80 # for all profile information as well as all ebuilds. If you change 84 81 # 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 86 89 # 87 90 # DISTDIR is where all of the source code tarballs will be placed for … … 89 92 # it. The entire repository of tarballs for Gentoo is 9G. This is 90 93 # 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 93 98 # 94 99 # PKGDIR is the location of binary packages that you can have created 95 100 # 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 98 105 # 99 106 # 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. 106 112 #PORT_LOGDIR="" 107 113 # … … 109 115 # concern that they will be deleted by rsync updates. Default is not 110 116 # defined. 111 #PORTDIR_OVERLAY= /usr/local/portage117 #PORTDIR_OVERLAY=@DOMAIN_PREFIX@/usr/local/portage 112 118 113 119 # Fetching files … … 123 129 # 124 130 # 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}" 127 133 # 128 134 # 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}" 131 137 # 132 138 # 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}" 135 141 # 136 142 # 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}" 139 145 # 140 146 # Portage uses GENTOO_MIRRORS to specify mirrors to use for source retrieval. … … 189 195 # 190 196 #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" 191 201 # 192 202 # PORTAGE_RSYNC_RETRIES sets the number of times portage will attempt to retrieve -
trunk/essentials/sys-apps/prefix-portage/cnf/make.globals
r3488 r3511 34 34 35 35 # Default user options 36 FEATURES="sandbox distlocks metadata-transfer "36 FEATURES="sandbox distlocks metadata-transfer unmerge-orphans" 37 37 38 38 # Default chunksize for binhost comms … … 69 69 # Default ownership of installed files. 70 70 PORTAGE_INST_UID="@rootuid@" 71 PORTAGE_INST_USER="@rootuser@" 72 PORTAGE_INST_GID="@wheelgid@" 71 PORTAGE_INST_GID="@rootgid@" 73 72 74 73 # Default PATH for ebuild env … … 84 83 PORTAGE_ELOG_MAILURI="@rootuser@" 85 84 PORTAGE_ELOG_MAILSUBJECT="[portage] ebuild log for \${PACKAGE} on \${HOST}" 86 PORTAGE_ELOG_MAILFROM=" portage"85 PORTAGE_ELOG_MAILFROM="@portageuser@" 87 86 88 87 # ***************************** -
trunk/essentials/sys-apps/prefix-portage/commit
r3488 r3511 1 Merged from trunk 6765:68021 Merged from trunk 7090:7126 2 2 3 3 +------------------------------------------------------------------------+ 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. | 6 6 |---------+--------------------------------------------------------------| 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. | 10 9 |---------+--------------------------------------------------------------| 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. | 13 12 |---------+--------------------------------------------------------------| 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__(). | 15 36 | zmedico | | 16 37 |---------+--------------------------------------------------------------| 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. | 19 40 |---------+--------------------------------------------------------------| 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. | 22 43 |---------+--------------------------------------------------------------| 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. | 27 47 |---------+--------------------------------------------------------------| 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. | 31 50 |---------+--------------------------------------------------------------| 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. | 35 53 |---------+--------------------------------------------------------------| 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. | 37 58 | zmedico | | 38 59 |---------+--------------------------------------------------------------| 39 | 6788 | Make repoman work with both + and - flags in IUSE.|60 | 7122 | Clean up the selected_nodes logic in depgraph.altlist(). | 40 61 | zmedico | | 41 62 |---------+--------------------------------------------------------------| 42 | 6790 | For bug #181551, support slot deps in package.keywords.|63 | 7124 | Clone asap_nodes so that iteration is safe for node removal. | 43 64 | zmedico | | 44 65 |---------+--------------------------------------------------------------| 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. | 73 70 +------------------------------------------------------------------------+ -
trunk/essentials/sys-apps/prefix-portage/config.guess
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/config.sub
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/configure
-
Property svn:executable
set to
*
r3488 r3511 718 718 XARGS 719 719 CPP 720 ALLOCA721 720 portageuser 722 721 portagegroup 723 wheelgid724 722 rootuser 725 723 rootuid 724 rootgid 726 725 DOMAIN_PREFIX 727 726 DEFAULT_PATH … … 732 731 BUILD_TBZ2TOOL_TRUE 733 732 BUILD_TBZ2TOOL_FALSE 734 BUILD_MISSINGOS_TRUE735 BUILD_MISSINGOS_FALSE736 733 LIBOBJS 737 734 LTLIBOBJS' … … 1330 1327 --enable-tbz2tool build tbz2tool, tool for creating binpkgs (default 1331 1328 yes) 1332 --enable-missingos build compatibility missingos code for python 2.21333 (default auto)1334 1329 --enable-just-compiled-sources 1335 1330 install just the bytecode, not the sources (default … … 1339 1334 --with-PACKAGE[=ARG] use PACKAGE [ARG=yes] 1340 1335 --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 1342 1340 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) 1349 1343 --with-offset-prefix specify the installation prefix for all packages , 1350 1344 defaults to / … … 3813 3807 3814 3808 3815 if test "$PYTHON" = "no" ; then3816 { { echo "$as_me:$LINENO: error: no python found in your path" >&53817 echo "$as_me: error: no python found in your path" >&2;}3818 { (exit 1); exit 1; }; }3819 fi3820 3821 3809 { echo "$as_me:$LINENO: checking whether $XCU_ID is good enough" >&5 3822 3810 echo $ECHO_N "checking whether $XCU_ID is good enough... $ECHO_C" >&6; } … … 4453 4441 4454 4442 4455 4456 { echo "$as_me:$LINENO: checking for main in -lc" >&54457 echo $ECHO_N "checking for main in -lc... $ECHO_C" >&6; }4458 if test "${ac_cv_lib_c_main+set}" = set; then4459 echo $ECHO_N "(cached) $ECHO_C" >&64460 else4461 ac_check_lib_save_LIBS=$LIBS4462 LIBS="-lc $LIBS"4463 cat >conftest.$ac_ext <<_ACEOF4464 /* confdefs.h. */4465 _ACEOF4466 cat confdefs.h >>conftest.$ac_ext4467 cat >>conftest.$ac_ext <<_ACEOF4468 /* end confdefs.h. */4469 4470 4471 int4472 main ()4473 {4474 return main ();4475 ;4476 return 0;4477 }4478 _ACEOF4479 rm -f conftest.$ac_objext conftest$ac_exeext4480 if { (ac_try="$ac_link"4481 case "(($ac_try" in4482 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;4483 *) ac_try_echo=$ac_try;;4484 esac4485 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&54486 (eval "$ac_link") 2>conftest.er14487 ac_status=$?4488 grep -v '^ *+' conftest.er1 >conftest.err4489 rm -f conftest.er14490 cat conftest.err >&54491 echo "$as_me:$LINENO: \$? = $ac_status" >&54492 (exit $ac_status); } && {4493 test -z "$ac_c_werror_flag" ||4494 test ! -s conftest.err4495 } && test -s conftest$ac_exeext &&4496 $as_test_x conftest$ac_exeext; then4497 ac_cv_lib_c_main=yes4498 else4499 echo "$as_me: failed program was:" >&54500 sed 's/^/| /' conftest.$ac_ext >&54501 4502 ac_cv_lib_c_main=no4503 fi4504 4505 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \4506 conftest$ac_exeext conftest.$ac_ext4507 LIBS=$ac_check_lib_save_LIBS4508 fi4509 { echo "$as_me:$LINENO: result: $ac_cv_lib_c_main" >&54510 echo "${ECHO_T}$ac_cv_lib_c_main" >&6; }4511 if test $ac_cv_lib_c_main = yes; then4512 cat >>confdefs.h <<_ACEOF4513 #define HAVE_LIBC 14514 _ACEOF4515 4516 LIBS="-lc $LIBS"4517 4518 fi4519 4520 4521 { echo "$as_me:$LINENO: checking for main in -ldl" >&54522 echo $ECHO_N "checking for main in -ldl... $ECHO_C" >&6; }4523 if test "${ac_cv_lib_dl_main+set}" = set; then4524 echo $ECHO_N "(cached) $ECHO_C" >&64525 else4526 ac_check_lib_save_LIBS=$LIBS4527 LIBS="-ldl $LIBS"4528 cat >conftest.$ac_ext <<_ACEOF4529 /* confdefs.h. */4530 _ACEOF4531 cat confdefs.h >>conftest.$ac_ext4532 cat >>conftest.$ac_ext <<_ACEOF4533 /* end confdefs.h. */4534 4535 4536 int4537 main ()4538 {4539 return main ();4540 ;4541 return 0;4542 }4543 _ACEOF4544 rm -f conftest.$ac_objext conftest$ac_exeext4545 if { (ac_try="$ac_link"4546 case "(($ac_try" in4547 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;4548 *) ac_try_echo=$ac_try;;4549 esac4550 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&54551 (eval "$ac_link") 2>conftest.er14552 ac_status=$?4553 grep -v '^ *+' conftest.er1 >conftest.err4554 rm -f conftest.er14555 cat conftest.err >&54556 echo "$as_me:$LINENO: \$? = $ac_status" >&54557 (exit $ac_status); } && {4558 test -z "$ac_c_werror_flag" ||4559 test ! -s conftest.err4560 } && test -s conftest$ac_exeext &&4561 $as_test_x conftest$ac_exeext; then4562 ac_cv_lib_dl_main=yes4563 else4564 echo "$as_me: failed program was:" >&54565 sed 's/^/| /' conftest.$ac_ext >&54566 4567 ac_cv_lib_dl_main=no4568 fi4569 4570 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \4571 conftest$ac_exeext conftest.$ac_ext4572 LIBS=$ac_check_lib_save_LIBS4573 fi4574 { echo "$as_me:$LINENO: result: $ac_cv_lib_dl_main" >&54575 echo "${ECHO_T}$ac_cv_lib_dl_main" >&6; }4576 if test $ac_cv_lib_dl_main = yes; then4577 cat >>confdefs.h <<_ACEOF4578 #define HAVE_LIBDL 14579 _ACEOF4580 4581 LIBS="-ldl $LIBS"4582 4583 fi4584 4585 4586 { echo "$as_me:$LINENO: checking for main in -lgcc" >&54587 echo $ECHO_N "checking for main in -lgcc... $ECHO_C" >&6; }4588 if test "${ac_cv_lib_gcc_main+set}" = set; then4589 echo $ECHO_N "(cached) $ECHO_C" >&64590 else4591 ac_check_lib_save_LIBS=$LIBS4592 LIBS="-lgcc $LIBS"4593 cat >conftest.$ac_ext <<_ACEOF4594 /* confdefs.h. */4595 _ACEOF4596 cat confdefs.h >>conftest.$ac_ext4597 cat >>conftest.$ac_ext <<_ACEOF4598 /* end confdefs.h. */4599 4600 4601 int4602 main ()4603 {4604 return main ();4605 ;4606 return 0;4607 }4608 _ACEOF4609 rm -f conftest.$ac_objext conftest$ac_exeext4610 if { (ac_try="$ac_link"4611 case "(($ac_try" in4612 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;4613 *) ac_try_echo=$ac_try;;4614 esac4615 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&54616 (eval "$ac_link") 2>conftest.er14617 ac_status=$?4618 grep -v '^ *+' conftest.er1 >conftest.err4619 rm -f conftest.er14620 cat conftest.err >&54621 echo "$as_me:$LINENO: \$? = $ac_status" >&54622 (exit $ac_status); } && {4623 test -z "$ac_c_werror_flag" ||4624 test ! -s conftest.err4625 } && test -s conftest$ac_exeext &&4626 $as_test_x conftest$ac_exeext; then4627 ac_cv_lib_gcc_main=yes4628 else4629 echo "$as_me: failed program was:" >&54630 sed 's/^/| /' conftest.$ac_ext >&54631 4632 ac_cv_lib_gcc_main=no4633 fi4634 4635 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \4636 conftest$ac_exeext conftest.$ac_ext4637 LIBS=$ac_check_lib_save_LIBS4638 fi4639 { echo "$as_me:$LINENO: result: $ac_cv_lib_gcc_main" >&54640 echo "${ECHO_T}$ac_cv_lib_gcc_main" >&6; }4641 if test $ac_cv_lib_gcc_main = yes; then4642 cat >>confdefs.h <<_ACEOF4643 #define HAVE_LIBGCC 14644 _ACEOF4645 4646 LIBS="-lgcc $LIBS"4647 4648 fi4649 4650 4651 { echo "$as_me:$LINENO: checking for main in -lpthread" >&54652 echo $ECHO_N "checking for main in -lpthread... $ECHO_C" >&6; }4653 if test "${ac_cv_lib_pthread_main+set}" = set; then4654 echo $ECHO_N "(cached) $ECHO_C" >&64655 else4656 ac_check_lib_save_LIBS=$LIBS4657 LIBS="-lpthread $LIBS"4658 cat >conftest.$ac_ext <<_ACEOF4659 /* confdefs.h. */4660 _ACEOF4661 cat confdefs.h >>conftest.$ac_ext4662 cat >>conftest.$ac_ext <<_ACEOF4663 /* end confdefs.h. */4664 4665 4666 int4667 main ()4668 {4669 return main ();4670 ;4671 return 0;4672 }4673 _ACEOF4674 rm -f conftest.$ac_objext conftest$ac_exeext4675 if { (ac_try="$ac_link"4676 case "(($ac_try" in4677 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;4678 *) ac_try_echo=$ac_try;;4679 esac4680 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&54681 (eval "$ac_link") 2>conftest.er14682 ac_status=$?4683 grep -v '^ *+' conftest.er1 >conftest.err4684 rm -f conftest.er14685 cat conftest.err >&54686 echo "$as_me:$LINENO: \$? = $ac_status" >&54687 (exit $ac_status); } && {4688 test -z "$ac_c_werror_flag" ||4689 test ! -s conftest.err4690 } && test -s conftest$ac_exeext &&4691 $as_test_x conftest$ac_exeext; then4692 ac_cv_lib_pthread_main=yes4693 else4694 echo "$as_me: failed program was:" >&54695 sed 's/^/| /' conftest.$ac_ext >&54696 4697 ac_cv_lib_pthread_main=no4698 fi4699 4700 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \4701 conftest$ac_exeext conftest.$ac_ext4702 LIBS=$ac_check_lib_save_LIBS4703 fi4704 { echo "$as_me:$LINENO: result: $ac_cv_lib_pthread_main" >&54705 echo "${ECHO_T}$ac_cv_lib_pthread_main" >&6; }4706 if test $ac_cv_lib_pthread_main = yes; then4707 cat >>confdefs.h <<_ACEOF4708 #define HAVE_LIBPTHREAD 14709 _ACEOF4710 4711 LIBS="-lpthread $LIBS"4712 4713 fi4714 4715 4716 4717 4718 4719 4720 4721 ac_header_dirent=no4722 for ac_hdr in dirent.h sys/ndir.h sys/dir.h ndir.h; do4723 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" >&54725 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"; }; then4727 echo $ECHO_N "(cached) $ECHO_C" >&64728 else4729 cat >conftest.$ac_ext <<_ACEOF4730 /* confdefs.h. */4731 _ACEOF4732 cat confdefs.h >>conftest.$ac_ext4733 cat >>conftest.$ac_ext <<_ACEOF4734 /* end confdefs.h. */4735 #include <sys/types.h>4736 #include <$ac_hdr>4737 4738 int4739 main ()4740 {4741 if ((DIR *) 0)4742 return 0;4743 ;4744 return 0;4745 }4746 _ACEOF4747 rm -f conftest.$ac_objext4748 if { (ac_try="$ac_compile"4749 case "(($ac_try" in4750 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;4751 *) ac_try_echo=$ac_try;;4752 esac4753 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&54754 (eval "$ac_compile") 2>conftest.er14755 ac_status=$?4756 grep -v '^ *+' conftest.er1 >conftest.err4757 rm -f conftest.er14758 cat conftest.err >&54759 echo "$as_me:$LINENO: \$? = $ac_status" >&54760 (exit $ac_status); } && {4761 test -z "$ac_c_werror_flag" ||4762 test ! -s conftest.err4763 } && test -s conftest.$ac_objext; then4764 eval "$as_ac_Header=yes"4765 else4766 echo "$as_me: failed program was:" >&54767 sed 's/^/| /' conftest.$ac_ext >&54768 4769 eval "$as_ac_Header=no"4770 fi4771 4772 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext4773 fi4774 ac_res=`eval echo '${'$as_ac_Header'}'`4775 { echo "$as_me:$LINENO: result: $ac_res" >&54776 echo "${ECHO_T}$ac_res" >&6; }4777 if test `eval echo '${'$as_ac_Header'}'` = yes; then4778 cat >>confdefs.h <<_ACEOF4779 #define `echo "HAVE_$ac_hdr" | $as_tr_cpp` 14780 _ACEOF4781 4782 ac_header_dirent=$ac_hdr; break4783 fi4784 4785 done4786 # Two versions of opendir et al. are in -ldir and -lx on SCO Xenix.4787 if test $ac_header_dirent = dirent.h; then4788 { echo "$as_me:$LINENO: checking for library containing opendir" >&54789 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }4790 if test "${ac_cv_search_opendir+set}" = set; then4791 echo $ECHO_N "(cached) $ECHO_C" >&64792 else4793 ac_func_search_save_LIBS=$LIBS4794 cat >conftest.$ac_ext <<_ACEOF4795 /* confdefs.h. */4796 _ACEOF4797 cat confdefs.h >>conftest.$ac_ext4798 cat >>conftest.$ac_ext <<_ACEOF4799 /* 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 GCC4803 builtin and then its argument prototype would still apply. */4804 #ifdef __cplusplus4805 extern "C"4806 #endif4807 char opendir ();4808 int4809 main ()4810 {4811 return opendir ();4812 ;4813 return 0;4814 }4815 _ACEOF4816 for ac_lib in '' dir; do4817 if test -z "$ac_lib"; then4818 ac_res="none required"4819 else4820 ac_res=-l$ac_lib4821 LIBS="-l$ac_lib $ac_func_search_save_LIBS"4822 fi4823 rm -f conftest.$ac_objext conftest$ac_exeext4824 if { (ac_try="$ac_link"4825 case "(($ac_try" in4826 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;4827 *) ac_try_echo=$ac_try;;4828 esac4829 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&54830 (eval "$ac_link") 2>conftest.er14831 ac_status=$?4832 grep -v '^ *+' conftest.er1 >conftest.err4833 rm -f conftest.er14834 cat conftest.err >&54835 echo "$as_me:$LINENO: \$? = $ac_status" >&54836 (exit $ac_status); } && {4837 test -z "$ac_c_werror_flag" ||4838 test ! -s conftest.err4839 } && test -s conftest$ac_exeext &&4840 $as_test_x conftest$ac_exeext; then4841 ac_cv_search_opendir=$ac_res4842 else4843 echo "$as_me: failed program was:" >&54844 sed 's/^/| /' conftest.$ac_ext >&54845 4846 4847 fi4848 4849 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \4850 conftest$ac_exeext4851 if test "${ac_cv_search_opendir+set}" = set; then4852 break4853 fi4854 done4855 if test "${ac_cv_search_opendir+set}" = set; then4856 :4857 else4858 ac_cv_search_opendir=no4859 fi4860 rm conftest.$ac_ext4861 LIBS=$ac_func_search_save_LIBS4862 fi4863 { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&54864 echo "${ECHO_T}$ac_cv_search_opendir" >&6; }4865 ac_res=$ac_cv_search_opendir4866 if test "$ac_res" != no; then4867 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"4868 4869 fi4870 4871 else4872 { echo "$as_me:$LINENO: checking for library containing opendir" >&54873 echo $ECHO_N "checking for library containing opendir... $ECHO_C" >&6; }4874 if test "${ac_cv_search_opendir+set}" = set; then4875 echo $ECHO_N "(cached) $ECHO_C" >&64876 else4877 ac_func_search_save_LIBS=$LIBS4878 cat >conftest.$ac_ext <<_ACEOF4879 /* confdefs.h. */4880 _ACEOF4881 cat confdefs.h >>conftest.$ac_ext4882 cat >>conftest.$ac_ext <<_ACEOF4883 /* 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 GCC4887 builtin and then its argument prototype would still apply. */4888 #ifdef __cplusplus4889 extern "C"4890 #endif4891 char opendir ();4892 int4893 main ()4894 {4895 return opendir ();4896 ;4897 return 0;4898 }4899 _ACEOF4900 for ac_lib in '' x; do4901 if test -z "$ac_lib"; then4902 ac_res="none required"4903 else4904 ac_res=-l$ac_lib4905 LIBS="-l$ac_lib $ac_func_search_save_LIBS"4906 fi4907 rm -f conftest.$ac_objext conftest$ac_exeext4908 if { (ac_try="$ac_link"4909 case "(($ac_try" in4910 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;4911 *) ac_try_echo=$ac_try;;4912 esac4913 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&54914 (eval "$ac_link") 2>conftest.er14915 ac_status=$?4916 grep -v '^ *+' conftest.er1 >conftest.err4917 rm -f conftest.er14918 cat conftest.err >&54919 echo "$as_me:$LINENO: \$? = $ac_status" >&54920 (exit $ac_status); } && {4921 test -z "$ac_c_werror_flag" ||4922 test ! -s conftest.err4923 } && test -s conftest$ac_exeext &&4924 $as_test_x conftest$ac_exeext; then4925 ac_cv_search_opendir=$ac_res4926 else4927 echo "$as_me: failed program was:" >&54928 sed 's/^/| /' conftest.$ac_ext >&54929 4930 4931 fi4932 4933 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \4934 conftest$ac_exeext4935 if test "${ac_cv_search_opendir+set}" = set; then4936 break4937 fi4938 done4939 if test "${ac_cv_search_opendir+set}" = set; then4940 :4941 else4942 ac_cv_search_opendir=no4943 fi4944 rm conftest.$ac_ext4945 LIBS=$ac_func_search_save_LIBS4946 fi4947 { echo "$as_me:$LINENO: result: $ac_cv_search_opendir" >&54948 echo "${ECHO_T}$ac_cv_search_opendir" >&6; }4949 ac_res=$ac_cv_search_opendir4950 if test "$ac_res" != no; then4951 test "$ac_res" = "none required" || LIBS="$ac_res $LIBS"4952 4953 fi4954 4955 fi4956 4957 4443 ac_ext=c 4958 4444 ac_cpp='$CPP $CPPFLAGS' … … 5360 4846 fi 5361 4847 5362 { echo "$as_me:$LINENO: checking for sys/wait.h that is POSIX.1 compatible" >&55363 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; then5365 echo $ECHO_N "(cached) $ECHO_C" >&65366 else5367 cat >conftest.$ac_ext <<_ACEOF5368 /* confdefs.h. */5369 _ACEOF5370 cat confdefs.h >>conftest.$ac_ext5371 cat >>conftest.$ac_ext <<_ACEOF5372 /* end confdefs.h. */5373 #include <sys/types.h>5374 #include <sys/wait.h>5375 #ifndef WEXITSTATUS5376 # define WEXITSTATUS(stat_val) ((unsigned int) (stat_val) >> 8)5377 #endif5378 #ifndef WIFEXITED5379 # define WIFEXITED(stat_val) (((stat_val) & 255) == 0)5380 #endif5381 5382 int5383 main ()5384 {5385 int s;5386 wait (&s);5387 s = WIFEXITED (s) ? WEXITSTATUS (s) : 1;5388 ;5389 return 0;5390 }5391 _ACEOF5392 rm -f conftest.$ac_objext5393 if { (ac_try="$ac_compile"5394 case "(($ac_try" in5395 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;5396 *) ac_try_echo=$ac_try;;5397 esac5398 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&55399 (eval "$ac_compile") 2>conftest.er15400 ac_status=$?5401 grep -v '^ *+' conftest.er1 >conftest.err5402 rm -f conftest.er15403 cat conftest.err >&55404 echo "$as_me:$LINENO: \$? = $ac_status" >&55405 (exit $ac_status); } && {5406 test -z "$ac_c_werror_flag" ||5407 test ! -s conftest.err5408 } && test -s conftest.$ac_objext; then5409 ac_cv_header_sys_wait_h=yes5410 else5411 echo "$as_me: failed program was:" >&55412 sed 's/^/| /' conftest.$ac_ext >&55413 5414 ac_cv_header_sys_wait_h=no5415 fi5416 5417 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext5418 fi5419 { echo "$as_me:$LINENO: result: $ac_cv_header_sys_wait_h" >&55420 echo "${ECHO_T}$ac_cv_header_sys_wait_h" >&6; }5421 if test $ac_cv_header_sys_wait_h = yes; then5422 5423 cat >>confdefs.h <<\_ACEOF5424 #define HAVE_SYS_WAIT_H 15425 _ACEOF5426 5427 fi5428 5429 4848 # On IRIX 5.3, sys/types and inttypes.h are conflicting. 5430 4849 … … 5503 4922 5504 4923 5505 5506 for ac_header in fcntl.h limits.h strings.h sys/file.h sys/time.h unistd.h getopt.h stdio.h 4924 for ac_header in string.h errno.h unistd.h stdio.h stdlib.h sys/stat.h sys/types.h 5507 4925 do 5508 4926 as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` … … 5649 5067 5650 5068 5651 { echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&55652 echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6; }5653 if test "${ac_cv_c_const+set}" = set; then5654 echo $ECHO_N "(cached) $ECHO_C" >&65655 else5656 cat >conftest.$ac_ext <<_ACEOF5657 /* confdefs.h. */5658 _ACEOF5659 cat confdefs.h >>conftest.$ac_ext5660 cat >>conftest.$ac_ext <<_ACEOF5661 /* end confdefs.h. */5662 5663 int5664 main ()5665 {5666 /* FIXME: Include the comments suggested by Paul. */5667 #ifndef __cplusplus5668 /* 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 in5679 an arm of an if-expression whose if-part is not a constant5680 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 saying5705 "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 #endif5715 5716 ;5717 return 0;5718 }5719 _ACEOF5720 rm -f conftest.$ac_objext5721 if { (ac_try="$ac_compile"5722 case "(($ac_try" in5723 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;5724 *) ac_try_echo=$ac_try;;5725 esac5726 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&55727 (eval "$ac_compile") 2>conftest.er15728 ac_status=$?5729 grep -v '^ *+' conftest.er1 >conftest.err5730 rm -f conftest.er15731 cat conftest.err >&55732 echo "$as_me:$LINENO: \$? = $ac_status" >&55733 (exit $ac_status); } && {5734 test -z "$ac_c_werror_flag" ||5735 test ! -s conftest.err5736 } && test -s conftest.$ac_objext; then5737 ac_cv_c_const=yes5738 else5739 echo "$as_me: failed program was:" >&55740 sed 's/^/| /' conftest.$ac_ext >&55741 5742 ac_cv_c_const=no5743 fi5744 5745 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext5746 fi5747 { echo "$as_me:$LINENO: result: $ac_cv_c_const" >&55748 echo "${ECHO_T}$ac_cv_c_const" >&6; }5749 if test $ac_cv_c_const = no; then5750 5751 cat >>confdefs.h <<\_ACEOF5752 #define const5753 _ACEOF5754 5755 fi5756 5757 { echo "$as_me:$LINENO: checking for uid_t in sys/types.h" >&55758 echo $ECHO_N "checking for uid_t in sys/types.h... $ECHO_C" >&6; }5759 if test "${ac_cv_type_uid_t+set}" = set; then5760 echo $ECHO_N "(cached) $ECHO_C" >&65761 else5762 cat >conftest.$ac_ext <<_ACEOF5763 /* confdefs.h. */5764 _ACEOF5765 cat confdefs.h >>conftest.$ac_ext5766 cat >>conftest.$ac_ext <<_ACEOF5767 /* end confdefs.h. */5768 #include <sys/types.h>5769 5770 _ACEOF5771 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |5772 $EGREP "uid_t" >/dev/null 2>&1; then5773 ac_cv_type_uid_t=yes5774 else5775 ac_cv_type_uid_t=no5776 fi5777 rm -f conftest*5778 5779 fi5780 { echo "$as_me:$LINENO: result: $ac_cv_type_uid_t" >&55781 echo "${ECHO_T}$ac_cv_type_uid_t" >&6; }5782 if test $ac_cv_type_uid_t = no; then5783 5784 cat >>confdefs.h <<\_ACEOF5785 #define uid_t int5786 _ACEOF5787 5788 5789 cat >>confdefs.h <<\_ACEOF5790 #define gid_t int5791 _ACEOF5792 5793 fi5794 5795 { echo "$as_me:$LINENO: checking for mode_t" >&55796 echo $ECHO_N "checking for mode_t... $ECHO_C" >&6; }5797 if test "${ac_cv_type_mode_t+set}" = set; then5798 echo $ECHO_N "(cached) $ECHO_C" >&65799 else5800 cat >conftest.$ac_ext <<_ACEOF5801 /* confdefs.h. */5802 _ACEOF5803 cat confdefs.h >>conftest.$ac_ext5804 cat >>conftest.$ac_ext <<_ACEOF5805 /* end confdefs.h. */5806 $ac_includes_default5807 typedef mode_t ac__type_new_;5808 int5809 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 _ACEOF5819 rm -f conftest.$ac_objext5820 if { (ac_try="$ac_compile"5821 case "(($ac_try" in5822 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;5823 *) ac_try_echo=$ac_try;;5824 esac5825 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&55826 (eval "$ac_compile") 2>conftest.er15827 ac_status=$?5828 grep -v '^ *+' conftest.er1 >conftest.err5829 rm -f conftest.er15830 cat conftest.err >&55831 echo "$as_me:$LINENO: \$? = $ac_status" >&55832 (exit $ac_status); } && {5833 test -z "$ac_c_werror_flag" ||5834 test ! -s conftest.err5835 } && test -s conftest.$ac_objext; then5836 ac_cv_type_mode_t=yes5837 else5838 echo "$as_me: failed program was:" >&55839 sed 's/^/| /' conftest.$ac_ext >&55840 5841 ac_cv_type_mode_t=no5842 fi5843 5844 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext5845 fi5846 { echo "$as_me:$LINENO: result: $ac_cv_type_mode_t" >&55847 echo "${ECHO_T}$ac_cv_type_mode_t" >&6; }5848 if test $ac_cv_type_mode_t = yes; then5849 :5850 else5851 5852 cat >>confdefs.h <<_ACEOF5853 #define mode_t int5854 _ACEOF5855 5856 fi5857 5858 { echo "$as_me:$LINENO: checking for size_t" >&55859 echo $ECHO_N "checking for size_t... $ECHO_C" >&6; }5860 if test "${ac_cv_type_size_t+set}" = set; then5861 echo $ECHO_N "(cached) $ECHO_C" >&65862 else5863 cat >conftest.$ac_ext <<_ACEOF5864 /* confdefs.h. */5865 _ACEOF5866 cat confdefs.h >>conftest.$ac_ext5867 cat >>conftest.$ac_ext <<_ACEOF5868 /* end confdefs.h. */5869 $ac_includes_default5870 typedef size_t ac__type_new_;5871 int5872 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 _ACEOF5882 rm -f conftest.$ac_objext5883 if { (ac_try="$ac_compile"5884 case "(($ac_try" in5885 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;5886 *) ac_try_echo=$ac_try;;5887 esac5888 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&55889 (eval "$ac_compile") 2>conftest.er15890 ac_status=$?5891 grep -v '^ *+' conftest.er1 >conftest.err5892 rm -f conftest.er15893 cat conftest.err >&55894 echo "$as_me:$LINENO: \$? = $ac_status" >&55895 (exit $ac_status); } && {5896 test -z "$ac_c_werror_flag" ||5897 test ! -s conftest.err5898 } && test -s conftest.$ac_objext; then5899 ac_cv_type_size_t=yes5900 else5901 echo "$as_me: failed program was:" >&55902 sed 's/^/| /' conftest.$ac_ext >&55903 5904 ac_cv_type_size_t=no5905 fi5906 5907 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext5908 fi5909 { echo "$as_me:$LINENO: result: $ac_cv_type_size_t" >&55910 echo "${ECHO_T}$ac_cv_type_size_t" >&6; }5911 if test $ac_cv_type_size_t = yes; then5912 :5913 else5914 5915 cat >>confdefs.h <<_ACEOF5916 #define size_t unsigned int5917 _ACEOF5918 5919 fi5920 5921 5922 # The Ultrix 4.2 mips builtin alloca declared by alloca.h only works5923 # for constant arguments. Useless!5924 { echo "$as_me:$LINENO: checking for working alloca.h" >&55925 echo $ECHO_N "checking for working alloca.h... $ECHO_C" >&6; }5926 if test "${ac_cv_working_alloca_h+set}" = set; then5927 echo $ECHO_N "(cached) $ECHO_C" >&65928 else5929 cat >conftest.$ac_ext <<_ACEOF5930 /* confdefs.h. */5931 _ACEOF5932 cat confdefs.h >>conftest.$ac_ext5933 cat >>conftest.$ac_ext <<_ACEOF5934 /* end confdefs.h. */5935 #include <alloca.h>5936 int5937 main ()5938 {5939 char *p = (char *) alloca (2 * sizeof (int));5940 if (p) return 0;5941 ;5942 return 0;5943 }5944 _ACEOF5945 rm -f conftest.$ac_objext conftest$ac_exeext5946 if { (ac_try="$ac_link"5947 case "(($ac_try" in5948 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;5949 *) ac_try_echo=$ac_try;;5950 esac5951 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&55952 (eval "$ac_link") 2>conftest.er15953 ac_status=$?5954 grep -v '^ *+' conftest.er1 >conftest.err5955 rm -f conftest.er15956 cat conftest.err >&55957 echo "$as_me:$LINENO: \$? = $ac_status" >&55958 (exit $ac_status); } && {5959 test -z "$ac_c_werror_flag" ||5960 test ! -s conftest.err5961 } && test -s conftest$ac_exeext &&5962 $as_test_x conftest$ac_exeext; then5963 ac_cv_working_alloca_h=yes5964 else5965 echo "$as_me: failed program was:" >&55966 sed 's/^/| /' conftest.$ac_ext >&55967 5968 ac_cv_working_alloca_h=no5969 fi5970 5971 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \5972 conftest$ac_exeext conftest.$ac_ext5973 fi5974 { echo "$as_me:$LINENO: result: $ac_cv_working_alloca_h" >&55975 echo "${ECHO_T}$ac_cv_working_alloca_h" >&6; }5976 if test $ac_cv_working_alloca_h = yes; then5977 5978 cat >>confdefs.h <<\_ACEOF5979 #define HAVE_ALLOCA_H 15980 _ACEOF5981 5982 fi5983 5984 { echo "$as_me:$LINENO: checking for alloca" >&55985 echo $ECHO_N "checking for alloca... $ECHO_C" >&6; }5986 if test "${ac_cv_func_alloca_works+set}" = set; then5987 echo $ECHO_N "(cached) $ECHO_C" >&65988 else5989 cat >conftest.$ac_ext <<_ACEOF5990 /* confdefs.h. */5991 _ACEOF5992 cat confdefs.h >>conftest.$ac_ext5993 cat >>conftest.$ac_ext <<_ACEOF5994 /* end confdefs.h. */5995 #ifdef __GNUC__5996 # define alloca __builtin_alloca5997 #else5998 # ifdef _MSC_VER5999 # include <malloc.h>6000 # define alloca _alloca6001 # else6002 # ifdef HAVE_ALLOCA_H6003 # include <alloca.h>6004 # else6005 # ifdef _AIX6006 #pragma alloca6007 # else6008 # ifndef alloca /* predefined by HP cc +Olibcalls */6009 char *alloca ();6010 # endif6011 # endif6012 # endif6013 # endif6014 #endif6015 6016 int6017 main ()6018 {6019 char *p = (char *) alloca (1);6020 if (p) return 0;6021 ;6022 return 0;6023 }6024 _ACEOF6025 rm -f conftest.$ac_objext conftest$ac_exeext6026 if { (ac_try="$ac_link"6027 case "(($ac_try" in6028 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;6029 *) ac_try_echo=$ac_try;;6030 esac6031 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&56032 (eval "$ac_link") 2>conftest.er16033 ac_status=$?6034 grep -v '^ *+' conftest.er1 >conftest.err6035 rm -f conftest.er16036 cat conftest.err >&56037 echo "$as_me:$LINENO: \$? = $ac_status" >&56038 (exit $ac_status); } && {6039 test -z "$ac_c_werror_flag" ||6040 test ! -s conftest.err6041 } && test -s conftest$ac_exeext &&6042 $as_test_x conftest$ac_exeext; then6043 ac_cv_func_alloca_works=yes6044 else6045 echo "$as_me: failed program was:" >&56046 sed 's/^/| /' conftest.$ac_ext >&56047 6048 ac_cv_func_alloca_works=no6049 fi6050 6051 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \6052 conftest$ac_exeext conftest.$ac_ext6053 fi6054 { echo "$as_me:$LINENO: result: $ac_cv_func_alloca_works" >&56055 echo "${ECHO_T}$ac_cv_func_alloca_works" >&6; }6056 6057 if test $ac_cv_func_alloca_works = yes; then6058 6059 cat >>confdefs.h <<\_ACEOF6060 #define HAVE_ALLOCA 16061 _ACEOF6062 6063 else6064 # The SVR3 libPW and SVR4 libucb both contain incompatible functions6065 # that cause trouble. Some versions do not even contain alloca or6066 # 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_objext6070 6071 cat >>confdefs.h <<\_ACEOF6072 #define C_ALLOCA 16073 _ACEOF6074 6075 6076 { echo "$as_me:$LINENO: checking whether \`alloca.c' needs Cray hooks" >&56077 echo $ECHO_N "checking whether \`alloca.c' needs Cray hooks... $ECHO_C" >&6; }6078 if test "${ac_cv_os_cray+set}" = set; then6079 echo $ECHO_N "(cached) $ECHO_C" >&66080 else6081 cat >conftest.$ac_ext <<_ACEOF6082 /* confdefs.h. */6083 _ACEOF6084 cat confdefs.h >>conftest.$ac_ext6085 cat >>conftest.$ac_ext <<_ACEOF6086 /* end confdefs.h. */6087 #if defined CRAY && ! defined CRAY26088 webecray6089 #else6090 wenotbecray6091 #endif6092 6093 _ACEOF6094 if (eval "$ac_cpp conftest.$ac_ext") 2>&5 |6095 $EGREP "webecray" >/dev/null 2>&1; then6096 ac_cv_os_cray=yes6097 else6098 ac_cv_os_cray=no6099 fi6100 rm -f conftest*6101 6102 fi6103 { echo "$as_me:$LINENO: result: $ac_cv_os_cray" >&56104 echo "${ECHO_T}$ac_cv_os_cray" >&6; }6105 if test $ac_cv_os_cray = yes; then6106 for ac_func in _getb67 GETB67 getb67; do6107 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`6108 { echo "$as_me:$LINENO: checking for $ac_func" >&56109 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }6110 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then6111 echo $ECHO_N "(cached) $ECHO_C" >&66112 else6113 cat >conftest.$ac_ext <<_ACEOF6114 /* confdefs.h. */6115 _ACEOF6116 cat confdefs.h >>conftest.$ac_ext6117 cat >>conftest.$ac_ext <<_ACEOF6118 /* 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_func6122 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, since6126 <limits.h> exists even on freestanding compilers. */6127 6128 #ifdef __STDC__6129 # include <limits.h>6130 #else6131 # include <assert.h>6132 #endif6133 6134 #undef $ac_func6135 6136 /* Override any GCC internal prototype to avoid an error.6137 Use char because int might match the return type of a GCC6138 builtin and then its argument prototype would still apply. */6139 #ifdef __cplusplus6140 extern "C"6141 #endif6142 char $ac_func ();6143 /* The GNU C library defines this for functions which it implements6144 to always fail with ENOSYS. Some functions are actually named6145 something starting with __ and the normal name is an alias. */6146 #if defined __stub_$ac_func || defined __stub___$ac_func6147 choke me6148 #endif6149 6150 int6151 main ()6152 {6153 return $ac_func ();6154 ;6155 return 0;6156 }6157 _ACEOF6158 rm -f conftest.$ac_objext conftest$ac_exeext6159 if { (ac_try="$ac_link"6160 case "(($ac_try" in6161 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;6162 *) ac_try_echo=$ac_try;;6163 esac6164 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&56165 (eval "$ac_link") 2>conftest.er16166 ac_status=$?6167 grep -v '^ *+' conftest.er1 >conftest.err6168 rm -f conftest.er16169 cat conftest.err >&56170 echo "$as_me:$LINENO: \$? = $ac_status" >&56171 (exit $ac_status); } && {6172 test -z "$ac_c_werror_flag" ||6173 test ! -s conftest.err6174 } && test -s conftest$ac_exeext &&6175 $as_test_x conftest$ac_exeext; then6176 eval "$as_ac_var=yes"6177 else6178 echo "$as_me: failed program was:" >&56179 sed 's/^/| /' conftest.$ac_ext >&56180 6181 eval "$as_ac_var=no"6182 fi6183 6184 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \6185 conftest$ac_exeext conftest.$ac_ext6186 fi6187 ac_res=`eval echo '${'$as_ac_var'}'`6188 { echo "$as_me:$LINENO: result: $ac_res" >&56189 echo "${ECHO_T}$ac_res" >&6; }6190 if test `eval echo '${'$as_ac_var'}'` = yes; then6191 6192 cat >>confdefs.h <<_ACEOF6193 #define CRAY_STACKSEG_END $ac_func6194 _ACEOF6195 6196 break6197 fi6198 6199 done6200 fi6201 6202 { echo "$as_me:$LINENO: checking stack direction for C alloca" >&56203 echo $ECHO_N "checking stack direction for C alloca... $ECHO_C" >&6; }6204 if test "${ac_cv_c_stack_direction+set}" = set; then6205 echo $ECHO_N "(cached) $ECHO_C" >&66206 else6207 if test "$cross_compiling" = yes; then6208 ac_cv_c_stack_direction=06209 else6210 cat >conftest.$ac_ext <<_ACEOF6211 /* confdefs.h. */6212 _ACEOF6213 cat confdefs.h >>conftest.$ac_ext6214 cat >>conftest.$ac_ext <<_ACEOF6215 /* end confdefs.h. */6216 $ac_includes_default6217 int6218 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 else6228 return (&dummy > addr) ? 1 : -1;6229 }6230 6231 int6232 main ()6233 {6234 return find_stack_direction () < 0;6235 }6236 _ACEOF6237 rm -f conftest$ac_exeext6238 if { (ac_try="$ac_link"6239 case "(($ac_try" in6240 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;6241 *) ac_try_echo=$ac_try;;6242 esac6243 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&56244 (eval "$ac_link") 2>&56245 ac_status=$?6246 echo "$as_me:$LINENO: \$? = $ac_status" >&56247 (exit $ac_status); } && { ac_try='./conftest$ac_exeext'6248 { (case "(($ac_try" in6249 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;6250 *) ac_try_echo=$ac_try;;6251 esac6252 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&56253 (eval "$ac_try") 2>&56254 ac_status=$?6255 echo "$as_me:$LINENO: \$? = $ac_status" >&56256 (exit $ac_status); }; }; then6257 ac_cv_c_stack_direction=16258 else6259 echo "$as_me: program exited with status $ac_status" >&56260 echo "$as_me: failed program was:" >&56261 sed 's/^/| /' conftest.$ac_ext >&56262 6263 ( exit $ac_status )6264 ac_cv_c_stack_direction=-16265 fi6266 rm -f core *.core core.conftest.* gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext6267 fi6268 6269 6270 fi6271 { echo "$as_me:$LINENO: result: $ac_cv_c_stack_direction" >&56272 echo "${ECHO_T}$ac_cv_c_stack_direction" >&6; }6273 6274 cat >>confdefs.h <<_ACEOF6275 #define STACK_DIRECTION $ac_cv_c_stack_direction6276 _ACEOF6277 6278 6279 fi6280 6281 { echo "$as_me:$LINENO: checking return type of signal handlers" >&56282 echo $ECHO_N "checking return type of signal handlers... $ECHO_C" >&6; }6283 if test "${ac_cv_type_signal+set}" = set; then6284 echo $ECHO_N "(cached) $ECHO_C" >&66285 else6286 cat >conftest.$ac_ext <<_ACEOF6287 /* confdefs.h. */6288 _ACEOF6289 cat confdefs.h >>conftest.$ac_ext6290 cat >>conftest.$ac_ext <<_ACEOF6291 /* end confdefs.h. */6292 #include <sys/types.h>6293 #include <signal.h>6294 6295 int6296 main ()6297 {6298 return *(signal (0, 0)) (0) == 1;6299 ;6300 return 0;6301 }6302 _ACEOF6303 rm -f conftest.$ac_objext6304 if { (ac_try="$ac_compile"6305 case "(($ac_try" in6306 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;6307 *) ac_try_echo=$ac_try;;6308 esac6309 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&56310 (eval "$ac_compile") 2>conftest.er16311 ac_status=$?6312 grep -v '^ *+' conftest.er1 >conftest.err6313 rm -f conftest.er16314 cat conftest.err >&56315 echo "$as_me:$LINENO: \$? = $ac_status" >&56316 (exit $ac_status); } && {6317 test -z "$ac_c_werror_flag" ||6318 test ! -s conftest.err6319 } && test -s conftest.$ac_objext; then6320 ac_cv_type_signal=int6321 else6322 echo "$as_me: failed program was:" >&56323 sed 's/^/| /' conftest.$ac_ext >&56324 6325 ac_cv_type_signal=void6326 fi6327 6328 rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext6329 fi6330 { echo "$as_me:$LINENO: result: $ac_cv_type_signal" >&56331 echo "${ECHO_T}$ac_cv_type_signal" >&6; }6332 6333 cat >>confdefs.h <<_ACEOF6334 #define RETSIGTYPE $ac_cv_type_signal6335 _ACEOF6336 6337 6338 6339 6340 6341 6342 6343 6344 6345 6346 for ac_func in getcwd mkdir regcomp rmdir strdup strerror strspn strstr6347 do6348 as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh`6349 { echo "$as_me:$LINENO: checking for $ac_func" >&56350 echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6; }6351 if { as_var=$as_ac_var; eval "test \"\${$as_var+set}\" = set"; }; then6352 echo $ECHO_N "(cached) $ECHO_C" >&66353 else6354 cat >conftest.$ac_ext <<_ACEOF6355 /* confdefs.h. */6356 _ACEOF6357 cat confdefs.h >>conftest.$ac_ext6358 cat >>conftest.$ac_ext <<_ACEOF6359 /* 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_func6363 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, since6367 <limits.h> exists even on freestanding compilers. */6368 6369 #ifdef __STDC__6370 # include <limits.h>6371 #else6372 # include <assert.h>6373 #endif6374 6375 #undef $ac_func6376 6377 /* Override any GCC internal prototype to avoid an error.6378 Use char because int might match the return type of a GCC6379 builtin and then its argument prototype would still apply. */6380 #ifdef __cplusplus6381 extern "C"6382 #endif6383 char $ac_func ();6384 /* The GNU C library defines this for functions which it implements6385 to always fail with ENOSYS. Some functions are actually named6386 something starting with __ and the normal name is an alias. */6387 #if defined __stub_$ac_func || defined __stub___$ac_func6388 choke me6389 #endif6390 6391 int6392 main ()6393 {6394 return $ac_func ();6395 ;6396 return 0;6397 }6398 _ACEOF6399 rm -f conftest.$ac_objext conftest$ac_exeext6400 if { (ac_try="$ac_link"6401 case "(($ac_try" in6402 *\"* | *\`* | *\\*) ac_try_echo=\$ac_try;;6403 *) ac_try_echo=$ac_try;;6404 esac6405 eval "echo \"\$as_me:$LINENO: $ac_try_echo\"") >&56406 (eval "$ac_link") 2>conftest.er16407 ac_status=$?6408 grep -v '^ *+' conftest.er1 >conftest.err6409 rm -f conftest.er16410 cat conftest.err >&56411 echo "$as_me:$LINENO: \$? = $ac_status" >&56412 (exit $ac_status); } && {6413 test -z "$ac_c_werror_flag" ||6414 test ! -s conftest.err6415 } && test -s conftest$ac_exeext &&6416 $as_test_x conftest$ac_exeext; then6417 eval "$as_ac_var=yes"6418 else6419 echo "$as_me: failed program was:" >&56420 sed 's/^/| /' conftest.$ac_ext >&56421 6422 eval "$as_ac_var=no"6423 fi6424 6425 rm -f core conftest.err conftest.$ac_objext conftest_ipa8_conftest.oo \6426 conftest$ac_exeext conftest.$ac_ext6427 fi6428 ac_res=`eval echo '${'$as_ac_var'}'`6429 { echo "$as_me:$LINENO: result: $ac_res" >&56430 echo "${ECHO_T}$ac_res" >&6; }6431 if test `eval echo '${'$as_ac_var'}'` = yes; then6432 cat >>confdefs.h <<_ACEOF6433 #define `echo "HAVE_$ac_func" | $as_tr_cpp` 16434 _ACEOF6435 6436 fi6437 done6438 6439 6440 5069 # Check whether --enable-tbz2tool was given. 6441 5070 if test "${enable_tbz2tool+set}" = set; then … … 6452 5081 6453 5082 6454 # Check whether --enable-missingos was given.6455 if test "${enable_missingos+set}" = set; then6456 enableval=$enable_missingos; case "${enableval}" in6457 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" >&56461 echo "$as_me: error: bad value ${enableval} for --enable-missingos" >&2;}6462 { (exit 1); exit 1; }; };;6463 esac6464 else6465 enable_missingos=auto6466 fi6467 6468 6469 5083 # Check whether --enable-just-compiled-sources was given. 6470 5084 if test "${enable_just_compiled_sources+set}" = set; then … … 6482 5096 6483 5097 6484 # Check whether --with- user was given.6485 if test "${with_ user+set}" = set; then6486 withval=$with_ user; case "${withval}" in6487 ""|yes) { { echo "$as_me:$LINENO: error: bad value ${withval} for --with- user" >&56488 echo "$as_me: error: bad value ${withval} for --with- user" >&2;}5098 # Check whether --with-portage-user was given. 5099 if 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 5102 echo "$as_me: error: bad value ${withval} for --with-portage-user" >&2;} 6489 5103 { (exit 1); exit 1; }; };; 6490 5104 *) portageuser="${withval}";; … … 6496 5110 6497 5111 6498 # Check whether --with- group was given.6499 if test "${with_ group+set}" = set; then6500 withval=$with_ group; case "${withval}" in6501 ""|yes) { { echo "$as_me:$LINENO: error: bad value ${withval} for --with- group" >&56502 echo "$as_me: error: bad value ${withval} for --with- group" >&2;}5112 # Check whether --with-portage-group was given. 5113 if 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 5116 echo "$as_me: error: bad value ${withval} for --with-portage-group" >&2;} 6503 5117 { (exit 1); exit 1; }; };; 6504 5118 *) portagegroup="${withval}";; … … 6506 5120 else 6507 5121 portagegroup="portage" 6508 fi6509 6510 6511 6512 # Check whether --with-wheelgid was given.6513 if test "${with_wheelgid+set}" = set; then6514 withval=$with_wheelgid; case "${withval}" in6515 ""|yes) { { echo "$as_me:$LINENO: error: bad value ${withval} for --with-wheelgid" >&56516 echo "$as_me: error: bad value ${withval} for --with-wheelgid" >&2;}6517 { (exit 1); exit 1; }; };;6518 *) wheelgid="${withval}";;6519 esac6520 else6521 wheelgid="0"6522 5122 fi 6523 5123 … … 6530 5130 echo "$as_me: error: bad value ${withval} for --with-rootuser" >&2;} 6531 5131 { (exit 1); exit 1; }; };; 6532 *) rootuser=${withval} 6533 rootuid=`id -u ${withval}`;; 6534 esac 6535 else 6536 rootuser=root 5132 *) rootuser=${withval};; 5133 esac 5134 else 5135 rootuser=${portageuser} 6537 5136 fi 6538 5137 … … 6550 5149 { (exit 1); exit 1; }; } 6551 5150 fi 5151 { echo "$as_me:$LINENO: checking for group id of ${rootuser}" >&5 5152 echo $ECHO_N "checking for group id of ${rootuser}... $ECHO_C" >&6; } 5153 rootgid=`${XCU_ID} -g ${rootuser}` 5154 if [ `echo ${rootgid} | ${EGREP} '^[[:digit:]]+$'` ] 5155 then 5156 { echo "$as_me:$LINENO: result: ${rootgid}" >&5 5157 echo "${ECHO_T}${rootgid}" >&6; } 5158 else 5159 { { echo "$as_me:$LINENO: error: error finding the group id of ${rootuser}" >&5 5160 echo "$as_me: error: error finding the group id of ${rootuser}" >&2;} 5161 { (exit 1); exit 1; }; } 5162 fi 6552 5163 6553 5164 … … 6570 5181 6571 5182 6572 6573 if test x$enable_missingos = xauto6574 then6575 pyver=`python -c 'import sys;print sys.version[0:3]';`6576 case ${pyver} in6577 2.4) ;;6578 2.3) ;;6579 2.2) enable_missingos=true;;6580 *) { echo "$as_me:$LINENO: WARNING: unable to determine python version, ${pyver}" >&56581 echo "$as_me: WARNING: unable to determine python version, ${pyver}" >&2;};;6582 esac6583 fi6584 5183 6585 5184 { echo "$as_me:$LINENO: checking for ARCH to be used" >&5 … … 6609 5208 ac_config_files="$ac_config_files man/Makefile" 6610 5209 6611 ac_config_files="$ac_config_files src/python-missingos/Makefile"6612 6613 5210 ac_config_files="$ac_config_files bin/Makefile" 6614 5211 … … 6644 5241 fi 6645 5242 6646 if test x$enable_missingos = xtrue; then6647 BUILD_MISSINGOS_TRUE=6648 BUILD_MISSINGOS_FALSE='#'6649 else6650 BUILD_MISSINGOS_TRUE='#'6651 BUILD_MISSINGOS_FALSE=6652 fi6653 6654 #AM_CONDITIONAL(BUILD_FILTER_ENV, test x$enable_filter_env = xtrue)6655 5243 6656 5244 { echo "$as_me:$LINENO: checking for a list of variables known by configure" >&5 … … 6826 5414 { (exit 1); exit 1; }; } 6827 5415 fi 6828 if test -z "${BUILD_MISSINGOS_TRUE}" && test -z "${BUILD_MISSINGOS_FALSE}"; then6829 { { echo "$as_me:$LINENO: error: conditional \"BUILD_MISSINGOS\" was never defined.6830 Usually this means the macro was only invoked conditionally." >&56831 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 fi6835 5416 6836 5417 : ${CONFIG_STATUS=./config.status} … … 7291 5872 "src/Makefile") CONFIG_FILES="$CONFIG_FILES src/Makefile" ;; 7292 5873 "man/Makefile") CONFIG_FILES="$CONFIG_FILES man/Makefile" ;; 7293 "src/python-missingos/Makefile") CONFIG_FILES="$CONFIG_FILES src/python-missingos/Makefile" ;;7294 5874 "bin/Makefile") CONFIG_FILES="$CONFIG_FILES bin/Makefile" ;; 7295 5875 "pym/Makefile") CONFIG_FILES="$CONFIG_FILES pym/Makefile" ;; … … 7499 6079 XARGS!$XARGS$ac_delim 7500 6080 CPP!$CPP$ac_delim 7501 ALLOCA!$ALLOCA$ac_delim7502 6081 portageuser!$portageuser$ac_delim 7503 6082 portagegroup!$portagegroup$ac_delim 7504 wheelgid!$wheelgid$ac_delim7505 6083 rootuser!$rootuser$ac_delim 7506 6084 rootuid!$rootuid$ac_delim 6085 rootgid!$rootgid$ac_delim 7507 6086 DOMAIN_PREFIX!$DOMAIN_PREFIX$ac_delim 7508 6087 DEFAULT_PATH!$DEFAULT_PATH$ac_delim … … 7513 6092 BUILD_TBZ2TOOL_TRUE!$BUILD_TBZ2TOOL_TRUE$ac_delim 7514 6093 BUILD_TBZ2TOOL_FALSE!$BUILD_TBZ2TOOL_FALSE$ac_delim 7515 BUILD_MISSINGOS_TRUE!$BUILD_MISSINGOS_TRUE$ac_delim7516 BUILD_MISSINGOS_FALSE!$BUILD_MISSINGOS_FALSE$ac_delim7517 6094 LIBOBJS!$LIBOBJS$ac_delim 7518 6095 LTLIBOBJS!$LTLIBOBJS$ac_delim 7519 6096 _ACEOF 7520 6097 7521 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 2 3; then6098 if test `sed -n "s/.*$ac_delim\$/X/p" conf$$subs.sed | grep -c X` = 20; then 7522 6099 break 7523 6100 elif $ac_last_try; then -
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/configure.in
r3488 r3511 47 47 GENTOO_PATH_GNUPROG(GREP, [grep]) 48 48 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 59 49 dnl Checks for header files. 60 AC_HEADER_DIRENT61 50 AC_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) 51 AC_CHECK_HEADERS([string.h errno.h unistd.h stdio.h stdlib.h sys/stat.h sys/types.h]) 75 52 76 53 AC_ARG_ENABLE(tbz2tool, … … 83 60 [enable_tbz2tool=true]) 84 61 85 AC_ARG_ENABLE(missingos,86 AC_HELP_STRING([--enable-missingos],[build compatibility missingos code for python 2.2 (default auto)]),87 [case "${enableval}" in88 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 95 62 AC_ARG_ENABLE(just-compiled-sources, 96 63 AC_HELP_STRING([--enable-just-compiled-sources],[install just the bytecode, not the sources (default no)]), … … 102 69 [enable_py_sources=true]) 103 70 104 AC_ARG_WITH( user,105 AC_HELP_STRING([--with- user=me],[use user 'me' for portage to work as(default portage)]),71 AC_ARG_WITH(portage-user, 72 AC_HELP_STRING([--with-portage-user=myuser],[use user 'myuser' as portage owner (default portage)]), 106 73 [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);; 108 75 *) portageuser="${withval}";; 109 76 esac], 110 77 [portageuser="portage"]) 111 78 112 AC_ARG_WITH( group,113 AC_HELP_STRING([--with- group=mygroup],[use group 'mygroup' for portage to work as(default portage)]),79 AC_ARG_WITH(portage-group, 80 AC_HELP_STRING([--with-portage-group=mygroup],[use group 'mygroup' as portage users group (default portage)]), 114 81 [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);; 116 83 *) portagegroup="${withval}";; 117 84 esac], 118 85 [portagegroup="portage"]) 119 86 120 AC_ARG_WITH(wheelgid,121 AC_HELP_STRING([--with-wheelgid=wheelgid],[let portage use 'wheelgid' as wheel group (default 0)]),122 [case "${withval}" in123 ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-wheelgid);;124 *) wheelgid="${withval}";;125 esac],126 [wheelgid="0"])127 128 87 AC_ARG_WITH(rootuser, 129 AC_HELP_STRING([--with-rootuser=m e],[declares 'me' as the portage owner (default root)]),88 AC_HELP_STRING([--with-rootuser=myuser],[uses 'myuser' as owner of installed files (default is portage-user)]), 130 89 [case "${withval}" in 131 90 ""|yes) AC_MSG_ERROR(bad value ${withval} for --with-rootuser);; 132 *) rootuser=${withval} 133 rootuid=`id -u ${withval}`;; 91 *) rootuser=${withval};; 134 92 esac], 135 [rootuser= root])93 [rootuser=${portageuser}]) 136 94 137 95 AC_MSG_CHECKING([for user id of ${rootuser}]) … … 143 101 else 144 102 AC_MSG_ERROR([error finding the user id of ${rootuser}]) 103 fi 104 AC_MSG_CHECKING([for group id of ${rootuser}]) 105 rootgid=`${XCU_ID} -g ${rootuser}` 106 if [[ `echo ${rootgid} | ${EGREP} '^[[:digit:]]+$'` ]] 107 then 108 AC_MSG_RESULT([${rootgid}]) 109 else 110 AC_MSG_ERROR([error finding the group id of ${rootuser}]) 145 111 fi 146 112 … … 156 122 [DEFAULT_PATH="${DEFAULT_PATH}"]) 157 123 158 159 if test x$enable_missingos = xauto160 then161 pyver=[`python -c 'import sys;print sys.version[0:3]';`]162 case ${pyver} in163 2.4) ;;164 2.3) ;;165 2.2) enable_missingos=true;;166 *) AC_MSG_WARN([unable to determine python version, ${pyver}]);;167 esac168 fi169 124 170 125 AC_MSG_CHECKING([for ARCH to be used]) … … 187 142 AC_CONFIG_FILES([ src/Makefile ]) 188 143 AC_CONFIG_FILES([ man/Makefile ]) 189 AC_CONFIG_FILES([ src/python-missingos/Makefile ])190 144 AC_CONFIG_FILES([ bin/Makefile ]) 191 145 AC_CONFIG_FILES([ pym/Makefile ]) … … 194 148 AC_SUBST(portageuser) 195 149 AC_SUBST(portagegroup) 196 AC_SUBST(wheelgid)197 150 AC_SUBST(rootuser) 198 151 AC_SUBST(rootuid) 152 AC_SUBST(rootgid) 199 153 AC_SUBST(DOMAIN_PREFIX) 200 154 AC_SUBST(DEFAULT_PATH) … … 203 157 AM_CONDITIONAL(INSTALL_PYTHON_SOURCES, test x$enable_py_sources = xtrue) 204 158 AM_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)207 159 208 160 AC_MSG_CHECKING([for a list of variables known by configure]) -
trunk/essentials/sys-apps/prefix-portage/depcomp
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/install-sh
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/kNIX-bootstrap-os2.x86-subst-install.vars
r3498 r3511 103 103 portageuser="portage" 104 104 portagegroup="portage" 105 wheelgid="0"106 105 rootuser="root" 107 106 rootuid="0" 107 rootgid="0" 108 108 DOMAIN_PREFIX="/@unixroot" 109 109 DEFAULT_PATH="/@unixroot/usr/bin;/@unixroot/bin;/@unixroot/usr/local/bin;/@unixroot/usr/bin;" -
trunk/essentials/sys-apps/prefix-portage/ltmain.sh
r3488 r3511 44 44 PROGRAM=ltmain.sh 45 45 PACKAGE=libtool 46 VERSION=1.5.2 3b47 TIMESTAMP=" (1.1220.2.4 37 2007/02/17 09:08:45)"46 VERSION=1.5.24 47 TIMESTAMP=" (1.1220.2.456 2007/06/24 02:25:32)" 48 48 49 49 # Be Bourne compatible (taken from Autoconf:_AS_BOURNE_COMPATIBLE). … … 1706 1706 -no-install) 1707 1707 case $host in 1708 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* )1708 *-*-cygwin* | *-*-mingw* | *-*-pw32* | *-*-os2* | *-*-darwin*) 1709 1709 # 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. 1711 1711 $echo "$modename: warning: \`-no-install' is ignored for $host" 1>&2 1712 1712 $echo "$modename: warning: assuming \`-no-fast-install' instead" 1>&2 … … 3254 3254 ;; 3255 3255 irix|nonstopux) 3256 current=`expr $number_major + $number_minor - 1`3256 current=`expr $number_major + $number_minor` 3257 3257 age="$number_minor" 3258 3258 revision="$number_minor" 3259 lt_irix_increment=no 3259 3260 ;; 3260 3261 esac … … 3315 3316 # Darwin ld doesn't like 0 for these options... 3316 3317 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" 3318 3320 ;; 3319 3321 … … 3329 3331 3330 3332 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 3333 3338 case $version_type in 3334 3339 nonstopux) verstring_prefix=nonstopux ;; … … 6545 6550 eval "if test \"\${save_$lt_var+set}\" = set; then 6546 6551 $lt_var=\$save_$lt_var; export $lt_var 6547 else6548 $lt_unset $lt_var6549 6552 fi" 6550 6553 done -
trunk/essentials/sys-apps/prefix-portage/man/Makefile.in
r3488 r3511 51 51 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 52 52 ACLOCAL = @ACLOCAL@ 53 ALLOCA = @ALLOCA@54 53 AMTAR = @AMTAR@ 55 54 ARCH = @ARCH@ … … 154 153 program_transform_name = @program_transform_name@ 155 154 psdir = @psdir@ 155 rootgid = @rootgid@ 156 156 rootuid = @rootuid@ 157 157 rootuser = @rootuser@ … … 167 167 top_builddir = @top_builddir@ 168 168 top_srcdir = @top_srcdir@ 169 wheelgid = @wheelgid@170 169 man_MANS = dispatch-conf.1 \ 171 170 ebuild.1 \ -
trunk/essentials/sys-apps/prefix-portage/man/ebuild.1
r3488 r3511 1 .TH "EBUILD" "1" " Dec 2005" "Portage 2.1" "Portage"1 .TH "EBUILD" "1" "Jun 2007" "Portage 2.1.3" "Portage" 2 2 .SH "NAME" 3 3 ebuild \- a low level interface to the Portage system … … 179 179 .SH "FILES" 180 180 .TP 181 \fB/etc/make.conf\fR181 .B /etc/make.conf 182 182 Contains variables for the build\-process and overwrites those 183 183 in make.globals. 184 .TP 185 .B /etc/portage/color.map 186 Contains variables customizing colors. 184 187 .SH "SEE ALSO" 185 188 .BR emerge (1), 186 189 .BR ebuild (5), 187 .BR make.conf (5) 190 .BR make.conf (5), 191 .BR color.map (5) 188 192 .TP 189 193 The \fI/usr/sbin/ebuild.sh\fR script. -
trunk/essentials/sys-apps/prefix-portage/man/ebuild.5
r3488 r3511 1 .TH "EBUILD" "5" "J an 2007" "Portage 2.1.2" "Portage"1 .TH "EBUILD" "5" "Jun 2007" "Portage 2.1.3" "Portage" 2 2 .SH "NAME" 3 3 ebuild \- the internal format, variables, and functions in an ebuild script … … 321 321 \fBRESTRICT\fR = \fI[strip,mirror,fetch,userpriv]\fR 322 322 This should be a space delimited list of portage features to restrict. 323 You may use conditional syntax to vary restrictions as seen above in DEPEND. 323 324 .PD 0 324 325 .RS … … 331 332 see the \fBQA CONTROL VARIABLES\fR section for more specific exemptions. 332 333 .TP 333 .I confcache334 Prevent econf from using confcache.334 .I bindist 335 Distribution of binary packages is restricted. 335 336 .TP 336 337 .I fetch … … 869 870 Nicholas Jones <carpaski@gentoo.org> 870 871 Mike Frysinger <vapier@gentoo.org> 871 Arfrever Frehtes Taifersar Arahesis < FFTA@WP.PL>872 Arfrever Frehtes Taifersar Arahesis <Arfrever.FTA@gmail.com> 872 873 .fi 873 874 .SH "FILES" … … 877 878 The helper apps in \fI@PORTAGE_BASE@/bin\fR. 878 879 .TP 879 \fB/etc/make.conf\fR 880 .B /etc/make.conf 880 881 Contains variables for the build\-process and overwrites those in make.defaults. 881 882 .TP 882 \fB/etc/make.globals\fR 883 .B /etc/make.globals 883 884 Contains the default variables for the build\-process, you should edit 884 885 \fI/etc/make.conf\fR instead. 886 .TP 887 .B /etc/portage/color.map 888 Contains variables customizing colors. 885 889 .SH "SEE ALSO" 886 890 .BR ebuild (1), 887 .BR make.conf (5) 891 .BR make.conf (5), 892 .BR color.map (5) -
trunk/essentials/sys-apps/prefix-portage/man/emerge.1
r3488 r3511 1 .TH "EMERGE" "1" " Dec 2006" "Portage 2.1" "Portage"1 .TH "EMERGE" "1" "Jun 2007" "Portage 2.1.3" "Portage" 2 2 .SH "NAME" 3 3 emerge \- Command\-line interface to the Portage system … … 356 356 output from portage's displays. 357 357 .TP 358 .BR "\-\-reinstall changed\-use" 359 Tells emerge to include installed packages where USE flags have 360 changed since installation. Unlike \fB\-\-newuse\fR, this option does 361 not trigger reinstallation when flags that the user has not 362 enabled are added or removed. 363 .TP 358 364 .BR "\-\-skipfirst" 359 365 This option is only valid when used with \fB\-\-resume\fR. It removes the … … 573 579 listed below\fR. 574 580 .TP 581 .B /etc/portage/color.map 582 Contains variables customizing colors. 583 .TP 575 584 .B /etc/dispatch\-conf.conf 576 585 Contains settings to handle automatic updates/backups of configuration … … 605 614 .BR ebuild (5), 606 615 .BR make.conf (5), 616 .BR color.map (5), 607 617 .BR portage (5) 608 618 .LP -
trunk/essentials/sys-apps/prefix-portage/man/make.conf.5
r3488 r3511 1 .TH "MAKE.CONF" "5" "J an 2007" "Portage 2.1.2" "Portage"1 .TH "MAKE.CONF" "5" "Jun 2007" "Portage 2.1.3" "Portage" 2 2 .SH "NAME" 3 3 make.conf \- custom settings for Portage … … 97 97 .TP 98 98 \fBDISTDIR\fR = \fI[path]\fR 99 Defines the location of your local source file repository. 99 Defines the location of your local source file repository. Note 100 that locations under /usr/portage are not necessarily safe for data storage. 101 See the \fBPORTDIR\fR documentation for more information. 100 102 .br 101 103 Defaults to /usr/portage/distfiles. … … 271 273 \fBUSE\fR flag. 272 274 .TP 275 .B unmerge-orphans 276 If a file is not claimed by another package in the same slot and it is not 277 protected by \fICONFIG_PROTECT\fR, unmerge it even if the modification time or 278 checksum differs from the file that was originally installed. 279 .TP 273 280 .B userfetch 274 281 When portage is run as root, drop privileges to portage:portage during the … … 286 293 This variable contains the command used for fetching package sources from 287 294 the internet. It must contain the full path to the executable as well as the 288 place\-holders \\${DISTDIR} and \\${URI}. 295 place\-holders \\${DISTDIR}, \\${FILE} and \\${URI}. The command should be 296 written to place the fetched file at \\${DISTDIR}/\\${FILE}. 297 Also see \fBRESUMECOMMAND\fR. 289 298 .TP 290 299 \fBGENTOO_MIRRORS\fR = \fI[URLs]\fR … … 319 328 .TP 320 329 \fBPKGDIR\fR = \fI[path]\fR 321 Defines the location where created .tbz2 binary packages will be stored. 330 Defines the location where created .tbz2 binary packages will be stored. Note 331 that locations under /usr/portage are not necessarily safe for data storage. 332 See the \fBPORTDIR\fR documentation for more information. 322 333 .br 323 334 Defaults to /usr/portage/packages. … … 325 336 .B PORT_LOGDIR 326 337 This variable defines the directory in which per\-ebuild logs are kept. 327 Logs are created only when this is set and writable. 338 Logs are created only when this is set. They are stored as 339 ${CATEGORY}:${PF}:YYYYMMDD\-HHMMSS.log in the directory specified. If the 340 direcory does not exist, it will be created automatically and group permissions 341 will be applied to it. If the directory already exists, portage will not 342 modify it's permissions. 328 343 .TP 329 344 \fBPORTAGE_BINHOST\fR = \fI"ftp://login:pass@grp.mirror.site/pub/grp/i686/athlon\-xp/"\fR … … 410 425 .TP 411 426 \fBPORTDIR\fR = \fI[path]\fR 412 Defines the location of your Portage tree. 427 Defines the location of the Portage tree. This is the repository for all 428 profile information as well as all ebuilds. If you change this, you must update 429 your /etc/make.profile symlink accordingly. 413 430 .br 414 431 Defaults to /usr/portage. … … 416 433 \fB***Warning***\fR 417 434 .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. 435 Data stored inside \fBPORTDIR\fR is in peril of being overwritten or deleted by 436 the 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 439 inside \fBPORTDIR\fR are not necessarily safe for data storage. 424 440 .TP 425 441 \fBPORTDIR_OVERLAY\fR = \fI"[path] [different\-path] [etc...]"\fR … … 445 461 This variable contains the command used for resuming package sources that 446 462 have been partially downloaded. It should be defined using the same format 447 as \fBFETCHCOMMAND\fR. 463 as \fBFETCHCOMMAND\fR, and must include any additional option(s) that may 464 be necessary in order to continue a partially downloaded file located at 465 \\${DISTDIR}/\\${FILE}. 448 466 .TP 449 467 \fBROOT\fR = \fI[path]\fR … … 517 535 .SH "FILES" 518 536 .TP 519 \fB/etc/make.conf\fR 537 .B /etc/make.conf 520 538 Contains variables for the build\-process and overwrites those in make.defaults. 521 539 .TP 522 \fB/etc/make.globals\fR 540 .B /etc/make.globals 523 541 Contains the default variables for the build\-process, you should edit \fI/etc/make.conf\fR instead. 524 542 .TP 525 \fB/usr/portage/profiles/use.desc\fR 543 .B /etc/portage/color.map 544 Contains variables customizing colors. 545 .TP 546 .B /usr/portage/profiles/use.desc 526 547 Contains a list of all global USE flags. 527 548 .TP 528 \fB/usr/portage/profiles/use.local.desc\fR 549 .B /usr/portage/profiles/use.local.desc 529 550 Contains a list of all local USE variables. 530 551 .SH "SEE ALSO" -
trunk/essentials/sys-apps/prefix-portage/man/portage.5
r3488 r3511 1 .TH "PORTAGE" "5" " Dec 2005" "Portage 2.1" "Portage"1 .TH "PORTAGE" "5" "Jun 2007" "Portage 2.1.3" "Portage" 2 2 .SH NAME 3 3 portage \- the heart of Gentoo … … 42 42 .nf 43 43 bashrc 44 color.map 44 45 modules 45 46 package.keywords … … 366 367 any other bash script. 367 368 .TP 369 .BR color.map 370 Contains variables customizing colors. See \fBcolor.map\fR(5). 371 .TP 368 372 .BR modules 369 373 This file can be used to override the metadata cache implementation. In … … 729 733 .BR ebuild (1), 730 734 .BR ebuild (5), 731 .BR make.conf (5) 735 .BR make.conf (5), 736 .BR color.map (5) -
trunk/essentials/sys-apps/prefix-portage/missing
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/pym/emerge/__init__.py
r3502 r3511 32 32 del os.environ["PORTAGE_LEGACY_GLOBALS"] 33 33 from portage import digraph, portdbapi 34 from portage.const import NEWS_LIB_PATH, CACHE_PATH 34 from portage.const import NEWS_LIB_PATH, CACHE_PATH, PRIVATE_PATH 35 35 36 36 import emerge.help … … 210 210 if short_msg == None: 211 211 short_msg = mystr 212 if "HOSTNAME" in os.environ .keys():212 if "HOSTNAME" in os.environ: 213 213 short_msg = os.environ["HOSTNAME"]+": "+short_msg 214 214 xtermTitle(short_msg) … … 349 349 if "--update" in myopts or \ 350 350 "--newuse" in myopts or \ 351 "--reinstall" in myopts or \ 351 352 "--noreplace" in myopts or \ 352 353 myaction in ("system", "world"): … … 368 369 369 370 # search functionality 370 class search :371 class search(object): 371 372 372 373 # … … 447 448 self.matches["desc"].append([full_package,masked]) 448 449 self.mlen=0 449 for mtype in self.matches .keys():450 for mtype in self.matches: 450 451 self.matches[mtype].sort() 451 452 self.mlen += len(self.matches[mtype]) … … 456 457 print "[ Applications found : "+white(str(self.mlen))+" ]" 457 458 print " " 458 for mtype in self.matches .keys():459 for mtype in self.matches: 459 460 for match,masked in self.matches[mtype]: 460 461 if mtype=="pkg": … … 592 593 #this doesn't match the package we're unmerging; keep it. 593 594 newworldlist.append(x) 594 595 596 newworldlist.sort() 597 595 598 portage.util.ensure_dirs(os.path.join(vardb.root, portage.PRIVATE_PATH), 596 599 gid=portage.portage_gid, mode=02770) 597 portage.util.write_atomic(world_filename, "\n".join(newworldlist) )600 portage.util.write_atomic(world_filename, "\n".join(newworldlist)+"\n") 598 601 599 602 def genericdict(mylist): … … 633 636 634 637 MEDIUM The upper boundary for medium dependencies. 638 MEDIUM_SOFT The upper boundary for medium-soft dependencies. 635 639 SOFT The upper boundary for soft dependencies. 636 640 MIN The lower boundary for soft dependencies. 637 641 """ 638 __slots__ = ("__weakref__", "satisfied", "buildtime", "runtime" )642 __slots__ = ("__weakref__", "satisfied", "buildtime", "runtime", "runtime_post") 639 643 MEDIUM = -1 640 SOFT = -2 641 MIN = -4 644 MEDIUM_SOFT = -2 645 SOFT = -3 646 MIN = -6 642 647 def __init__(self, **kwargs): 643 648 for myattr in self.__slots__: … … 652 657 if self.runtime: 653 658 return -1 659 if self.runtime_post: 660 return -2 654 661 if self.buildtime: 655 return - 2662 return -3 656 663 if self.runtime: 657 return -3 658 return -4 664 return -4 665 if self.runtime_post: 666 return -5 667 return -6 659 668 def __lt__(self, other): 660 669 return self.__int__() < other … … 676 685 if myvalue > self.MEDIUM: 677 686 return "hard" 687 if myvalue > self.MEDIUM_SOFT: 688 return "medium" 678 689 if myvalue > self.SOFT: 679 return "medium "690 return "medium-soft" 680 691 return "soft" 681 692 … … 705 716 vdb_lock = portage.locks.lockdir(vdb_path) 706 717 mykeys = ["SLOT", "COUNTER", "PROVIDE", "USE", "IUSE", 707 "DEPEND", "RDEPEND", "PDEPEND" ]718 "DEPEND", "RDEPEND", "PDEPEND", "repository"] 708 719 real_dbapi = real_vartree.dbapi 709 720 slot_counters = {} … … 916 927 f.end_paragraph(1) 917 928 918 class depgraph :929 class depgraph(object): 919 930 920 931 pkg_tree_map = { … … 938 949 self._slot_node_map = {} 939 950 self.mydbapi = {} 940 self._mydbapi_keys = ["SLOT", "DEPEND", "RDEPEND", "PDEPEND"] 951 self._mydbapi_keys = ["SLOT", "DEPEND", "RDEPEND", "PDEPEND", 952 "USE", "IUSE", "PROVIDE", "repository"] 941 953 self.useFlags = {} 942 954 self.trees = {} … … 981 993 self.orderedkeys=[] 982 994 self.outdatedpackages=[] 983 self.args_keys = [] 995 self._args_atoms = {} 996 self._args_nodes = set() 997 self._sets = {} 998 self._sets_nodes = {} 984 999 self.blocker_digraph = digraph() 985 1000 self.blocker_parents = {} … … 1044 1059 f.end_paragraph(1) 1045 1060 f.writer.flush() 1061 1062 def _reinstall_for_flags(self, forced_flags, 1063 orig_use, orig_iuse, cur_use, cur_iuse): 1064 if "--newuse" in self.myopts: 1065 if orig_iuse.symmetric_difference( 1066 cur_iuse).difference(forced_flags): 1067 return True 1068 elif orig_iuse.intersection(orig_use) != \ 1069 cur_iuse.intersection(cur_use): 1070 return True 1071 elif "changed-use" == self.myopts.get("--reinstall"): 1072 if orig_iuse.intersection(orig_use) != \ 1073 cur_iuse.intersection(cur_use): 1074 return True 1075 return False 1046 1076 1047 1077 def create(self, mybigkey, myparent=None, addme=1, myuse=None, … … 1097 1127 1098 1128 mydbapi = self.trees[myroot][self.pkg_tree_map[mytype]].dbapi 1129 metadata = dict(izip(self._mydbapi_keys, 1130 mydbapi.aux_get(mykey, self._mydbapi_keys))) 1131 if mytype == "ebuild": 1132 pkgsettings.setcpv(mykey, mydb=portdb) 1133 metadata["USE"] = pkgsettings["USE"] 1134 myuse = pkgsettings["USE"].split() 1099 1135 1100 1136 if not arg and myroot == self.target_root: 1101 cpv_slot = "%s:%s" % (mykey, mydbapi.aux_get(mykey, ["SLOT"])[0]) 1102 arg = portage.best_match_to_list(cpv_slot, self.args_keys) 1103 1104 if myuse is None: 1105 self.pkgsettings[myroot].setcpv(mykey, mydb=portdb) 1106 myuse = self.pkgsettings[myroot]["USE"].split() 1137 try: 1138 arg = self._find_atom_for_pkg(self._args_atoms, mykey, metadata) 1139 except portage.exception.InvalidDependString, e: 1140 if mytype != "installed": 1141 show_invalid_depstring_notice(tuple(mybigkey+["merge"]), 1142 metadata["PROVIDE"], str(e)) 1143 return 0 1144 del e 1107 1145 1108 1146 merging=1 … … 1118 1156 If the package has new iuse flags or different use flags then if 1119 1157 --newuse is specified, we need to merge the package. """ 1120 if merging==0 and "--newuse" in self.myopts and \ 1158 if merging == 0 and \ 1159 ("--newuse" in self.myopts or 1160 "--reinstall" in self.myopts) and \ 1121 1161 vardbapi.cpv_exists(mykey): 1122 1162 pkgsettings.setcpv(mykey, mydb=mydbapi) … … 1125 1165 forced_flags.update(pkgsettings.usemask) 1126 1166 old_use = vardbapi.aux_get(mykey, ["USE"])[0].split() 1127 iuses = set(filter_iuse_defaults( 1128 mydbapi.aux_get(mykey, ["IUSE"])[0].split())) 1167 iuses = set(filter_iuse_defaults(metadata["IUSE"].split())) 1129 1168 old_iuse = set(filter_iuse_defaults( 1130 1169 vardbapi.aux_get(mykey, ["IUSE"])[0].split())) 1131 if iuses.symmetric_difference(1132 old_iuse).difference(forced_flags):1170 if self._reinstall_for_flags( 1171 forced_flags, old_use, old_iuse, myuse, iuses): 1133 1172 merging = 1 1134 elif old_iuse.intersection(old_use) != \1135 iuses.intersection(myuse):1136 merging=11137 1173 1138 1174 if addme and merging == 1: … … 1143 1179 1144 1180 if addme: 1145 metadata = dict(izip(self._mydbapi_keys,1146 mydbapi.aux_get(mykey, self._mydbapi_keys)))1147 1181 if merging == 0 and vardbapi.cpv_exists(mykey) and \ 1148 1182 mytype != "installed": 1183 mytype = "installed" 1149 1184 mybigkey[0] = "installed" 1150 1185 mydbapi = vardbapi … … 1152 1187 metadata = dict(izip(self._mydbapi_keys, 1153 1188 mydbapi.aux_get(mykey, self._mydbapi_keys))) 1154 myuse = m ydbapi.aux_get(mykey, ["USE"])[0].split()1189 myuse = metadata["USE"].split() 1155 1190 slot_atom = "%s:%s" % (portage.dep_getkey(mykey), metadata["SLOT"]) 1156 1191 existing_node = self._slot_node_map[myroot].get( … … 1210 1245 priority=priority) 1211 1246 1247 if arg: 1248 self._args_nodes.add(jbigkey) 1249 try: 1250 for set_name, pkg_set in self._sets.iteritems(): 1251 atom = self._find_atom_for_pkg(pkg_set, mykey, metadata) 1252 if atom: 1253 self._sets_nodes[set_name].add(jbigkey) 1254 except portage.exception.InvalidDependString, e: 1255 if mytype != "installed": 1256 show_invalid_depstring_notice(jbigkey, 1257 metadata["PROVIDE"], str(e)) 1258 return 0 1259 del e 1260 1212 1261 # Do this even when addme is False (--onlydeps) so that the 1213 1262 # parent/child relationship is always known in case … … 1233 1282 edepend={} 1234 1283 depkeys = ["DEPEND","RDEPEND","PDEPEND"] 1235 depvalues = mydbapi.aux_get(mykey, depkeys) 1236 for i in xrange(len(depkeys)): 1237 edepend[depkeys[i]] = depvalues[i] 1284 for k in depkeys: 1285 edepend[k] = metadata[k] 1238 1286 1239 1287 if mytype == "ebuild": … … 1270 1318 # on a package being present AND must be built after that package. 1271 1319 if not self.select_dep(myroot, edepend["PDEPEND"], myparent=mp, 1272 myuse=myuse, priority=DepPriority( ), rev_deps=True,1320 myuse=myuse, priority=DepPriority(runtime_post=True), 1273 1321 parent_arg=arg): 1274 1322 return 0 … … 1432 1480 """ These are used inside self.create() in order to ensure packages 1433 1481 that happen to match arguments are not incorrectly marked as nomerge.""" 1434 self.args_keys = [x[1] for x in arg_atoms] 1482 for myarg, myatom in arg_atoms: 1483 self._args_atoms.setdefault( 1484 portage.dep_getkey(myatom), []).append(myatom) 1435 1485 for myarg, myatom in arg_atoms: 1436 1486 try: … … 1536 1586 mymerge = mycheck[1] 1537 1587 1538 if not mymerge and arg and \ 1539 portage.best_match_to_list(depstring, self.args_keys): 1588 if not mymerge and arg: 1540 1589 # A provided package has been specified on the command line. The 1541 1590 # package will not be merged and a warning will be displayed. 1542 self._pprovided_args.append(arg) 1591 cp = portage.dep_getkey(depstring) 1592 if cp in self._args_atoms and depstring in self._args_atoms[cp]: 1593 self._pprovided_args.append((arg, depstring)) 1543 1594 1544 1595 if myparent: … … 1600 1651 myeb_pkg = portage.best(myeb_pkg_matches) 1601 1652 1602 if myeb_pkg and "--newuse" in self.myopts: 1653 if myeb_pkg and \ 1654 ("--newuse" in self.myopts or \ 1655 "--reinstall" in self.myopts): 1603 1656 iuses = set(filter_iuse_defaults( 1604 1657 bindb.aux_get(myeb_pkg, ["IUSE"])[0].split())) … … 1619 1672 cur_iuse = set(filter_iuse_defaults( 1620 1673 portdb.aux_get(myeb, ["IUSE"])[0].split())) 1621 if iuses.symmetric_difference( 1622 cur_iuse).difference(forced_flags): 1623 myeb_pkg = None 1624 elif iuses.intersection(old_use) != \ 1625 cur_iuse.intersection(now_use): 1674 if self._reinstall_for_flags( 1675 forced_flags, old_use, iuses, now_use, cur_iuse): 1626 1676 myeb_pkg = None 1627 1677 if myeb_pkg: … … 2033 2083 return retlist 2034 2084 mygraph=self.digraph.copy() 2085 for node in mygraph.order[:]: 2086 if node[-1] == "nomerge": 2087 mygraph.remove(node) 2035 2088 self._merge_order_bias(mygraph) 2036 2089 myblockers = self.blocker_digraph.copy() … … 2047 2100 asap_nodes.append(node) 2048 2101 break 2049 ignore_priority_ range = [None]2050 ignore_priority_ range.extend(2051 xrange(DepPriority.MIN, DepPriority. MEDIUM+ 1))2102 ignore_priority_soft_range = [None] 2103 ignore_priority_soft_range.extend( 2104 xrange(DepPriority.MIN, DepPriority.SOFT + 1)) 2052 2105 tree_mode = "--tree" in self.myopts 2106 # Tracks whether or not the current iteration should prefer asap_nodes 2107 # if available. This is set to False when the previous iteration 2108 # failed to select any nodes. It is reset whenever nodes are 2109 # successfully selected. 2110 prefer_asap = True 2053 2111 while not mygraph.empty(): 2054 ignore_priority = None 2055 nodes = None 2056 if asap_nodes: 2112 selected_nodes = None 2113 if prefer_asap and asap_nodes: 2057 2114 """ASAP nodes are merged before their soft deps.""" 2115 asap_nodes = [node for node in asap_nodes \ 2116 if mygraph.contains(node)] 2058 2117 for node in asap_nodes: 2059 if not mygraph.contains(node):2060 asap_nodes.remove(node)2061 continue2062 2118 if not mygraph.child_nodes(node, 2063 2119 ignore_priority=DepPriority.SOFT): 2064 nodes = [node]2120 selected_nodes = [node] 2065 2121 asap_nodes.remove(node) 2066 2122 break 2067 if not nodes: 2068 for ignore_priority in ignore_priority_range: 2123 if not selected_nodes and \ 2124 not (prefer_asap and asap_nodes): 2125 for ignore_priority in ignore_priority_soft_range: 2069 2126 nodes = get_nodes(ignore_priority=ignore_priority) 2070 2127 if nodes: 2071 2128 break 2072 selected_nodes = None 2073 if nodes: 2074 if ignore_priority <= DepPriority.SOFT: 2129 if nodes: 2075 2130 if ignore_priority is None and not tree_mode: 2076 2131 # Greedily pop all of these nodes since no relationship … … 2091 2146 # settle for a root node 2092 2147 selected_nodes = [nodes[0]] 2093 else: 2148 if not selected_nodes: 2149 nodes = get_nodes(ignore_priority=DepPriority.MEDIUM) 2150 if nodes: 2094 2151 """Recursively gather a group of nodes that RDEPEND on 2095 2152 eachother. This ensures that they are merged as a group 2096 2153 and get their RDEPENDs satisfied as soon as possible.""" 2097 def gather_deps(mergeable_nodes, selected_nodes, node): 2154 def gather_deps(ignore_priority, 2155 mergeable_nodes, selected_nodes, node): 2098 2156 if node in selected_nodes: 2099 2157 return True … … 2102 2160 selected_nodes.add(node) 2103 2161 for child in mygraph.child_nodes(node, 2104 ignore_priority= DepPriority.SOFT):2105 if not gather_deps( 2162 ignore_priority=ignore_priority): 2163 if not gather_deps(ignore_priority, 2106 2164 mergeable_nodes, selected_nodes, child): 2107 2165 return False 2108 2166 return True 2109 2167 mergeable_nodes = set(nodes) 2110 for node in nodes: 2111 selected_nodes = set() 2112 if gather_deps( 2113 mergeable_nodes, selected_nodes, node): 2168 if prefer_asap and asap_nodes: 2169 nodes = asap_nodes 2170 for ignore_priority in xrange(DepPriority.SOFT, 2171 DepPriority.MEDIUM_SOFT + 1): 2172 for node in nodes: 2173 selected_nodes = set() 2174 if gather_deps(ignore_priority, 2175 mergeable_nodes, selected_nodes, node): 2176 break 2177 else: 2178 selected_nodes = None 2179 if selected_nodes: 2114 2180 break 2115 else: 2116 selected_nodes = None 2181 2182 if prefer_asap and asap_nodes and not selected_nodes: 2183 # We failed to find any asap nodes to merge, so ignore 2184 # them for the next iteration. 2185 prefer_asap = False 2186 continue 2187 2188 if selected_nodes and ignore_priority > DepPriority.SOFT: 2189 # Try to merge ignored medium deps as soon as possible. 2190 for node in selected_nodes: 2191 children = set(mygraph.child_nodes(node)) 2192 soft = children.difference( 2193 mygraph.child_nodes(node, 2194 ignore_priority=DepPriority.SOFT)) 2195 medium_soft = children.difference( 2196 mygraph.child_nodes(node, 2197 ignore_priority=DepPriority.MEDIUM_SOFT)) 2198 medium_soft.difference_update(soft) 2199 for child in medium_soft: 2200 if child in selected_nodes: 2201 continue 2202 if child in asap_nodes: 2203 continue 2204 # TODO: Try harder to make these nodes get 2205 # merged absolutely as soon as possible. 2206 asap_nodes.append(child) 2117 2207 2118 2208 if not selected_nodes: … … 2126 2216 circular_blocks = True 2127 2217 blocker_deps = myblockers.leaf_nodes() 2128 if blocker_deps: 2129 selected_nodes = [blocker_deps.pop()] 2218 while blocker_deps: 2219 # Some of these nodes might have already been selected 2220 # by the normal node selection process after the 2221 # circular_blocks flag has been set. Therefore, we 2222 # have to verify that they're still in the graph so 2223 # that they're not selected more than once. 2224 node = blocker_deps.pop() 2225 if mygraph.contains(node): 2226 selected_nodes = [node] 2227 break 2130 2228 2131 2229 if not selected_nodes: … … 2167 2265 sys.exit(1) 2168 2266 2267 # At this point, we've succeeded in selecting one or more nodes, so 2268 # it's now safe to reset the prefer_asap to it's default state. 2269 prefer_asap = True 2270 2169 2271 for node in selected_nodes: 2170 2272 retlist.append(list(node)) … … 2203 2305 return [x for x in mylist \ 2204 2306 if x in matches or not portdb.cpv_exists(x)] 2307 def create_cp_dict(atom_list): 2308 cp_dict = {} 2309 for atom in atom_list: 2310 cp_dict.setdefault(portage.dep_getkey(atom), []).append(atom) 2311 return cp_dict 2205 2312 world_problems = False 2206 2313 if mode=="system": 2207 2314 mylist = getlist(self.settings, "system") 2315 self._sets["system"] = create_cp_dict(mylist) 2316 self._sets_nodes["system"] = set() 2208 2317 else: 2209 2318 #world mode 2210 2319 worldlist = getlist(self.settings, "world") 2320 self._sets["world"] = create_cp_dict(worldlist) 2321 self._sets_nodes["world"] = set() 2211 2322 mylist = getlist(self.settings, "system") 2323 self._sets["system"] = create_cp_dict(mylist) 2324 self._sets_nodes["system"] = set() 2212 2325 worlddict=genericdict(worldlist) 2213 2326 2214 for x in worlddict .keys():2327 for x in worlddict: 2215 2328 if not portage.isvalidatom(x): 2216 2329 world_problems = True 2217 elif not self.trees[self.target_root]["vartree"].dbapi.match(x): 2330 continue 2331 elif not vardb.match(x): 2218 2332 world_problems = True 2219 else: 2220 mylist.append(x) 2333 available = False 2334 if "--usepkgonly" not in self.myopts and \ 2335 portdb.match(x): 2336 available = True 2337 elif "--usepkg" in self.myopts: 2338 mymatches = bindb.match(x) 2339 if "--usepkgonly" not in self.myopts: 2340 mymatches = visible(mymatches) 2341 if mymatches: 2342 available = True 2343 if not available: 2344 continue 2345 mylist.append(x) 2221 2346 2222 2347 newlist = [] … … 2268 2393 newlist.append(myslot_atom) 2269 2394 mylist = newlist 2270 2395 2396 for myatom in mylist: 2397 self._args_atoms.setdefault( 2398 portage.dep_getkey(myatom), []).append(myatom) 2399 2271 2400 missing_atoms = [] 2272 2401 for mydep in mylist: … … 2293 2422 2294 2423 return 1 2424 2425 def _find_atom_for_pkg(self, pkg_set, cpv, metadata): 2426 """Return the best match for a given package from the arguments, or 2427 None if there are no matches. This matches virtual arguments against 2428 the PROVIDE metadata. This can raise an InvalidDependString exception 2429 if an error occurs while parsing PROVIDE.""" 2430 cpv_slot = "%s:%s" % (cpv, metadata["SLOT"]) 2431 cp = portage.dep_getkey(cpv) 2432 atoms = pkg_set.get(cp) 2433 if atoms: 2434 best_match = portage.best_match_to_list(cpv_slot, atoms) 2435 if best_match: 2436 return best_match 2437 provides = portage.flatten(portage.dep.use_reduce( 2438 portage.dep.paren_reduce(metadata["PROVIDE"]), 2439 uselist=metadata["USE"].split())) 2440 for provide in provides: 2441 provided_cp = portage.dep_getkey(provide) 2442 atoms = pkg_set.get(provided_cp) 2443 if atoms: 2444 transformed_atoms = [atom.replace(provided_cp, cp) for atom in atoms] 2445 best_match = portage.best_match_to_list(cpv_slot, transformed_atoms) 2446 if best_match: 2447 return atoms[transformed_atoms.index(best_match)] 2448 return None 2295 2449 2296 2450 def display(self,mylist,verbosity=None): … … 2401 2555 traversed_nodes.add(graph_key) 2402 2556 def add_parents(current_node, ordered): 2403 parent_nodes = mygraph.parent_nodes(current_node) 2557 parent_nodes = None 2558 # Do not traverse to parents if this node is an 2559 # an argument or a direct member of a set that has 2560 # been specified as an argument (system or world). 2561 if current_node not in self._args_nodes: 2562 parent_nodes = mygraph.parent_nodes(current_node) 2404 2563 if parent_nodes: 2405 2564 child_nodes = set(mygraph.child_nodes(current_node)) … … 2462 2621 # in size display (verbose mode) 2463 2622 myfetchlist=[] 2623 2464 2624 for mylist_index in xrange(len(mylist)): 2465 2625 x, depth, ordered = mylist[mylist_index] … … 2497 2657 mydbapi = self.trees[myroot][self.pkg_tree_map[pkg_type]].dbapi 2498 2658 pkg_status = x[3] 2659 pkg_merge = ordered and pkg_status != "nomerge" 2499 2660 binary_package = True 2500 2661 if "ebuild" == pkg_type: … … 2670 2831 # size verbose 2671 2832 mysize=0 2672 if x[0] == "ebuild" and ordered and x[-1] != "nomerge":2833 if pkg_type == "ebuild" and pkg_merge: 2673 2834 try: 2674 2835 myfilesdict = portdb.getfetchsizes(pkg_key, … … 2683 2844 myfilesdict="[empty/missing/bad digest]" 2684 2845 else: 2685 for myfetchfile in myfilesdict .keys():2846 for myfetchfile in myfilesdict: 2686 2847 if myfetchfile not in myfetchlist: 2687 2848 mysize+=myfilesdict[myfetchfile] … … 2695 2856 file_name = portdb.findname(pkg_key) 2696 2857 if file_name: # It might not exist in the tree 2858 newrepo = pkgsettings["PORTDIR"] 2859 newrepoindex = "0" 2860 if self.trees[x[1]]["vartree"].dbapi.cpv_exists(pkg): 2861 oldrepo = self.trees[x[1]]["vartree"].dbapi.aux_get(pkg, ["repository"])[0] 2862 else: 2863 oldrepo = "" 2864 if oldrepo != "": 2865 oldrepo = portdb.getRepositoryPath(oldrepo) 2697 2866 dir_name=os.path.abspath(os.path.dirname(file_name)+"/../..") 2698 if (overlays_real.count(dir_name)>0): 2699 verboseadd+=teal("["+str(overlays_real.index( 2700 os.path.normpath(dir_name))+1)+"]")+" " 2701 display_overlays=True 2867 if (overlays_real.count(dir_name) > 0): 2868 newrepoindex = overlays_real.index(os.path.normpath(dir_name)) 2869 newrepo = overlays_real[newrepoindex] 2870 newrepoindex += 1 2871 2872 # assing lookup indexes 2873 if oldrepo == "": 2874 oldrepoindex = "?" 2875 elif oldrepo == pkgsettings["PORTDIR"]: 2876 oldrepoindex = "0" 2877 else: 2878 oldrepoindex = str(overlays_real.index(os.path.normpath(oldrepo)) + 1) 2879 if oldrepoindex == newrepoindex \ 2880 or not self.trees[x[1]]["vartree"].dbapi.cpv_exists(pkg): 2881 repoadd = newrepoindex 2882 else: 2883 repoadd = "%s=>%s" % (oldrepoindex, newrepoindex) 2884 2885 verboseadd+=teal("[%s]" % repoadd)+" " 2886 display_overlays=True 2702 2887 else: 2703 2888 verboseadd += "[No ebuild?]" … … 2730 2915 myoldbest=blue("["+myoldbest+"]") 2731 2916 2917 pkg_cp = xs[0] 2918 pkg_arg = False 2919 pkg_world = False 2920 pkg_system = False 2921 pkg_node = tuple(x) 2922 if pkg_node in self._args_nodes: 2923 pkg_arg = True 2924 world_nodes = self._sets_nodes.get("world") 2925 if world_nodes and pkg_node in world_nodes: 2926 pkg_world = True 2927 if world_nodes is None: 2928 # Don't colorize system package when in "world" mode. 2929 system_nodes = self._sets_nodes.get("system") 2930 if system_nodes and pkg_node in system_nodes: 2931 pkg_system = True 2932 2933 def pkgprint(pkg): 2934 if pkg_merge: 2935 if pkg_arg: 2936 if pkg_world: 2937 return colorize("PKG_MERGE_WORLD", pkg) 2938 elif pkg_system: 2939 return colorize("PKG_MERGE_SYSTEM", pkg) 2940 else: 2941 return colorize("PKG_MERGE_ARG", pkg) 2942 else: 2943 return colorize("PKG_MERGE", pkg) 2944 else: 2945 if pkg_arg: 2946 if pkg_world: 2947 return colorize("PKG_NOMERGE_WORLD", pkg) 2948 elif pkg_system: 2949 return colorize("PKG_NOMERGE_SYSTEM", pkg) 2950 else: 2951 return colorize("PKG_NOMERGE_ARG", pkg) 2952 else: 2953 return colorize("PKG_NOMERGE", pkg) 2954 2732 2955 if x[1]!="/": 2733 2956 if myoldbest: … … 2735 2958 if "--columns" in self.myopts: 2736 2959 if "--quiet" in self.myopts: 2737 myprint=addl+" "+indent+ darkgreen(xs[0])2960 myprint=addl+" "+indent+pkgprint(pkg_cp) 2738 2961 myprint=myprint+darkblue(" "+xs[1]+xs[2])+" " 2739 2962 myprint=myprint+myoldbest 2740 2963 myprint=myprint+darkgreen("to "+x[1]) 2741 2964 else: 2742 myprint="["+ x[0]+" "+addl+"] "+indent+darkgreen(xs[0])2965 myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_cp) 2743 2966 if (newlp-nc_len(myprint)) > 0: 2744 2967 myprint=myprint+(" "*(newlp-nc_len(myprint))) … … 2749 2972 myprint=myprint+darkgreen("to "+x[1])+" "+verboseadd 2750 2973 else: 2751 if x[-1] == "nomerge" or not ordered:2752 myprint = darkblue("[nomerge ]")2974 if not pkg_merge: 2975 myprint = "[%s ] " % pkgprint("nomerge") 2753 2976 else: 2754 2977 myprint = "[" + pkg_type + " " + addl + "] " 2755 myprint += indent + darkgreen(pkg_key) + " " + \2978 myprint += indent + pkgprint(pkg_key) + " " + \ 2756 2979 myoldbest + darkgreen("to " + myroot) + " " + \ 2757 2980 verboseadd … … 2759 2982 if "--columns" in self.myopts: 2760 2983 if "--quiet" in self.myopts: 2761 myprint=addl+" "+indent+ darkgreen(xs[0])2984 myprint=addl+" "+indent+pkgprint(pkg_cp) 2762 2985 myprint=myprint+" "+green(xs[1]+xs[2])+" " 2763 2986 myprint=myprint+myoldbest 2764 2987 else: 2765 myprint="["+ x[0]+" "+addl+"] "+indent+darkgreen(xs[0])2988 myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_cp) 2766 2989 if (newlp-nc_len(myprint)) > 0: 2767 2990 myprint=myprint+(" "*(newlp-nc_len(myprint))) … … 2771 2994 myprint=myprint+myoldbest+" "+verboseadd 2772 2995 else: 2773 if x[-1] == "nomerge" or not ordered:2774 myprint= darkblue("[nomerge ] "+indent+x[2]+" "+myoldbest+" ")+verboseadd2996 if not pkg_merge: 2997 myprint="["+pkgprint("nomerge")+" ] "+indent+pkgprint(pkg_key)+" "+myoldbest+" "+verboseadd 2775 2998 else: 2776 myprint="["+ x[0]+" "+addl+"] "+indent+darkgreen(x[2])+" "+myoldbest+" "+verboseadd2999 myprint="["+pkgprint(pkg_type)+" "+addl+"] "+indent+pkgprint(pkg_key)+" "+myoldbest+" "+verboseadd 2777 3000 p.append(myprint) 2778 3001 … … 2804 3027 print counters 2805 3028 if overlays and display_overlays: 2806 print "Portage overlays:"3029 print "Portage tree and overlays:" 2807 3030 y=0 3031 print " "+teal("[0]"), self.settings["PORTDIR"] 2808 3032 for x in overlays: 2809 3033 y=y+1 2810 3034 print " "+teal("["+str(y)+"]"),x 3035 print " "+teal("[?]"), "indicates that the source repository could not be determined" 2811 3036 2812 3037 if "--changelog" in self.myopts: … … 2817 3042 2818 3043 if self._pprovided_args: 3044 arg_refs = {} 3045 for arg_atom in self._pprovided_args: 3046 arg, atom = arg_atom 3047 arg_refs[arg_atom] = [] 3048 cp = portage.dep_getkey(atom) 3049 for set_name, pkg_set in self._sets.iteritems(): 3050 if cp in pkg_set and atom in pkg_set[cp]: 3051 arg_refs[arg_atom].append(set_name) 2819 3052 msg = [] 2820 3053 msg.append(bad("\nWARNING: ")) … … 2825 3058 msg.append("A requested package will not be " + \ 2826 3059 "merged because it is listed in\n") 2827 msg.append(" package.provided:\n\n") 2828 for arg in self._pprovided_args: 2829 msg.append(" " + arg + "\n") 3060 msg.append("package.provided:\n\n") 3061 problems_sets = set() 3062 for (arg, atom), refs in arg_refs.iteritems(): 3063 ref_string = "" 3064 if refs: 3065 problems_sets.update(refs) 3066 refs.sort() 3067 ref_string = ", ".join(["'%s'" % name for name in refs]) 3068 ref_string = " pulled in by " + ref_string 3069 msg.append(" %s%s\n" % (colorize("INFORM", arg), ref_string)) 2830 3070 msg.append("\n") 3071 if "world" in problems_sets: 3072 msg.append("This problem can be solved in one of the following ways:\n\n") 3073 msg.append(" A) Use emaint to clean offending packages from world (if not installed).\n") 3074 msg.append(" B) Uninstall offending packages (cleans them from world).\n") 3075 msg.append(" C) Remove offending entries from package.provided.\n\n") 3076 msg.append("The best course of action depends on the reason that an offending\n") 3077 msg.append("package.provided entry exists.\n\n") 2831 3078 sys.stderr.write("".join(msg)) 2832 3079 … … 2961 3208 2962 3209 def merge(self, mylist, favorites, mtimedb): 3210 from portage.elog import elog_process 2963 3211 failed_fetches = [] 2964 3212 fetchonly = "--fetchonly" in self.myopts or \ … … 3048 3296 portage.write_atomic( 3049 3297 os.path.join(self.target_root, portage.WORLD_FILE), 3050 "\n".join(myfavdict.values()))3298 "\n".join(sorted(myfavdict.values())) + "\n") 3051 3299 3052 3300 mtimedb["resume"]["mergelist"]=mymergelist[:] … … 3194 3442 tree="porttree") 3195 3443 del pkgsettings["PORTAGE_BINPKG_TMPFILE"] 3444 if retval != os.EX_OK or \ 3445 "--buildpkgonly" in self.myopts: 3446 elog_process(pkg_key, pkgsettings) 3196 3447 if retval != os.EX_OK: 3197 3448 return retval … … 3325 3576 portage.write_atomic( 3326 3577 os.path.join(myroot, portage.WORLD_FILE), 3327 "\n".join( myfavdict.values()))3578 "\n".join(sorted(myfavdict.values()))+"\n") 3328 3579 3329 3580 if "--pretend" not in self.myopts and \ … … 3598 3849 slotmap[myslot]={} 3599 3850 slotmap[myslot][localtree.dbapi.cpv_counter(mypkg)]=mypkg 3600 for myslot in slotmap .keys():3851 for myslot in slotmap: 3601 3852 counterkeys=slotmap[myslot].keys() 3602 3853 counterkeys.sort() … … 3625 3876 if vdb_lock: 3626 3877 portage.locks.unlockdir(vdb_lock) 3627 for x in pkgmap .keys():3878 for x in pkgmap: 3628 3879 for y in localtree.dep_match(x): 3629 3880 if y not in pkgmap[x]["omitted"] and \ … … 3681 3932 countdown(int(settings["CLEAN_DELAY"]), ">>> Unmerging") 3682 3933 3683 for x in pkgmap .keys():3934 for x in pkgmap: 3684 3935 for y in pkgmap[x]["selected"]: 3685 3936 print ">>> Unmerging "+y+"..." … … 3786 4037 3787 4038 3788 def display_news_notification(settings): 3789 target_root = settings["ROOT"] 4039 def display_news_notification(trees): 4040 for target_root in trees: 4041 if len(trees) > 1 and target_root != "/": 4042 break 4043 settings = trees[target_root]["vartree"].settings 4044 portdb = trees[target_root]["porttree"].dbapi 4045 vardb = trees[target_root]["vartree"].dbapi 3790 4046 NEWS_PATH = os.path.join("metadata", "news") 3791 4047 UNREAD_PATH = os.path.join(target_root, NEWS_LIB_PATH, "news") 3792 porttree = portdbapi(porttree_root=settings["PORTDIR"], mysettings=settings)3793 4048 newsReaderDisplay = False 3794 4049 3795 for repo in porttree.getRepositories(): 3796 unreadItems = checkUpdatedNewsItems(target_root, NEWS_PATH, UNREAD_PATH, repo) 4050 for repo in portdb.getRepositories(): 4051 unreadItems = checkUpdatedNewsItems( 4052 portdb, vardb, NEWS_PATH, UNREAD_PATH, repo) 3797 4053 if unreadItems: 3798 4054 if not newsReaderDisplay: … … 3808 4064 print 3809 4065 3810 def post_emerge( settings, mtimedb, retval):4066 def post_emerge(trees, mtimedb, retval): 3811 4067 """ 3812 4068 Misc. things to run at the end of a merge session. … … 3818 4074 Display preserved libs warnings 3819 4075 Exit Emerge 3820 3821 @param settings: Configuration settings (typically portage.settings)3822 @type settings: portage.config()4076 4077 @param trees: A dictionary mapping each ROOT to it's package databases 4078 @type trees: dict 3823 4079 @param mtimedb: The mtimeDB to store data needed across merge invocations 3824 4080 @type mtimedb: MtimeDB class instance … … 3829 4085 1. Calls sys.exit(retval) 3830 4086 """ 3831 target_root = settings["ROOT"] 4087 for target_root in trees: 4088 if len(trees) > 1 and target_root != "/": 4089 break 4090 vardbapi = trees[target_root]["vartree"].dbapi 4091 settings = vardbapi.settings 3832 4092 info_mtimes = mtimedb["info"] 3833 4093 … … 3847 4107 3848 4108 from portage.util import normalize_path 4109 # Dump the mod_echo output now so that our other notifications are shown 4110 # last. 4111 from portage.elog import mod_echo 4112 mod_echo.finalize() 4113 3849 4114 if "noinfo" not in settings.features: 3850 4115 chk_updated_info_files(target_root + EPREFIX.lstrip(os.path.sep), infodirs, info_mtimes, retval) 3851 4116 chk_updated_cfg_files(target_root + EPREFIX.lstrip(os.path.sep), config_protect) 3852 4117 3853 display_news_notification( settings)4118 display_news_notification(trees) 3854 4119 3855 from portage.dbapi.vartree import PreservedLibsRegistry 3856 plib_registry = PreservedLibsRegistry(os.path.join(target_root, CACHE_PATH, "preserved_libs_registry")) 3857 if plib_registry.hasEntries(): 4120 if vardbapi.plib_registry.hasEntries(): 3858 4121 print colorize("WARN", "!!!") + " existing preserved libs:" 3859 plibdata = plib_registry.getPreservedLibs()3860 for cpv in plibdata .keys():4122 plibdata = vardbapi.plib_registry.getPreservedLibs() 4123 for cpv in plibdata: 3861 4124 print colorize("WARN", ">>>") + " package: %s" % cpv 3862 4125 for f in plibdata[cpv]: … … 3903 4166 print " "+yellow("*")+" Type "+green("emerge --help config")+" to learn how to update config files." 3904 4167 3905 def checkUpdatedNewsItems( root, NEWS_PATH, UNREAD_PATH, repo_id):4168 def checkUpdatedNewsItems(portdb, vardb, NEWS_PATH, UNREAD_PATH, repo_id): 3906 4169 """ 3907 4170 Examines news items in repodir + '/' + NEWS_PATH and attempts to find unread items 3908 4171 Returns the number of unread (yet relevent) items. 3909 4172 3910 @param root: 3911 @type root: 4173 @param portdb: a portage tree database 4174 @type portdb: pordbapi 4175 @param vardb: an installed package database 4176 @type vardb: vardbapi 3912 4177 @param NEWS_PATH: 3913 4178 @type NEWS_PATH: … … 3922 4187 """ 3923 4188 from portage.news import NewsManager 3924 manager = NewsManager( root, NEWS_PATH, UNREAD_PATH)4189 manager = NewsManager(portdb, vardb, NEWS_PATH, UNREAD_PATH) 3925 4190 return manager.getUnreadItems( repo_id, update=True ) 3926 4191 … … 4459 4724 print 4460 4725 4461 display_news_notification( settings)4726 display_news_notification(trees) 4462 4727 4463 4728 def action_metadata(settings, portdb, myopts): … … 5166 5431 mydepgraph.display( 5167 5432 mydepgraph.altlist(reversed=("--tree" in myopts))) 5168 if ("--buildpkgonly" in myopts):5169 ifnot mydepgraph.digraph.hasallzeros(ignore_priority=DepPriority.MEDIUM):5170 print "\n!!! --buildpkgonly requires all dependencies to be merged."5171 print "!!! You have to merge the dependencies before you can build this package.\n"5172 sys.exit(1)5433 if "--buildpkgonly" in myopts and \ 5434 not mydepgraph.digraph.hasallzeros(ignore_priority=DepPriority.MEDIUM): 5435 print "\n!!! --buildpkgonly requires all dependencies to be merged." 5436 print "!!! You have to merge the dependencies before you can build this package.\n" 5437 sys.exit(1) 5173 5438 else: 5174 5439 if ("--buildpkgonly" in myopts): … … 5268 5533 "type":"choice", 5269 5534 "choices":("y", "n") 5535 }, 5536 "--reinstall": { 5537 "help":"specify conditions to trigger package reinstallation", 5538 "type":"choice", 5539 "choices":["changed-use"] 5270 5540 } 5271 5541 } … … 5488 5758 5489 5759 tmpcmdline = [] 5490 if "--ignore-default-opts" not in sys.argv:5760 if "--ignore-default-opts" not in myopts: 5491 5761 tmpcmdline.extend(settings["EMERGE_DEFAULT_OPTS"].split()) 5492 5762 tmpcmdline.extend(sys.argv[1:]) … … 5636 5906 if portage.secpass < 2: 5637 5907 # We've already allowed "--version" and "--help" above. 5638 if "--pretend" not in myopts and \ 5639 myaction not in ("search","info"): 5908 if "--pretend" not in myopts and myaction not in ("search","info"): 5640 5909 need_superuser = not \ 5641 5910 ("--fetchonly" in myopts or \ 5642 5911 "--fetch-all-uri" in myopts or \ 5643 myaction in ("metadata", "regen")) 5912 myaction in ("metadata", "regen") or \ 5913 (myaction == "sync" and os.access(settings["PORTDIR"], os.W_OK))) 5644 5914 if portage.secpass < 1 or \ 5645 5915 need_superuser: … … 5654 5924 myopts["--pretend"] = True 5655 5925 del myopts["--ask"] 5656 print ("%s access would berequired... " + \5926 print ("%s access is required... " + \ 5657 5927 "adding --pretend to options.\n") % access_desc 5658 5928 if portage.secpass < 1 and not need_superuser: 5659 5929 portage_group_warning() 5660 5930 else: 5661 sys.stderr.write(("emerge: %s access would be" + \5931 sys.stderr.write(("emerge: %s access is " + \ 5662 5932 "required.\n\n") % access_desc) 5663 5933 if portage.secpass < 1 and not need_superuser: … … 5741 6011 mtimedb["ldpath"]): 5742 6012 if "--pretend" not in myopts: 5743 post_emerge( settings, mtimedb, 0)6013 post_emerge(trees, mtimedb, os.EX_OK) 5744 6014 5745 6015 elif "depclean"==myaction: … … 5748 6018 myopts, spinner) 5749 6019 if "--pretend" not in myopts: 5750 post_emerge( settings, mtimedb, 0)6020 post_emerge(trees, mtimedb, os.EX_OK) 5751 6021 # "update", "system", or just process files: 5752 6022 else: 5753 6023 validate_ebuild_environment(trees) 5754 6024 if "--pretend" not in myopts: 5755 display_news_notification( settings)6025 display_news_notification(trees) 5756 6026 action_build(settings, trees, mtimedb, 5757 6027 myopts, myaction, myfiles, spinner) 5758 6028 if "--pretend" not in myopts: 5759 post_emerge( settings, mtimedb, 0)6029 post_emerge(trees, mtimedb, os.EX_OK) 5760 6030 else: 5761 display_news_notification( settings)6031 display_news_notification(trees) 5762 6032 5763 6033 if __name__ == "__main__": -
trunk/essentials/sys-apps/prefix-portage/pym/emerge/help.py
r3488 r3511 1 1 # Copyright 1999-2007 Gentoo Foundation 2 2 # 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 $ 4 4 5 5 … … 17 17 print bold("Options:")+" "+green("-")+"["+green("abBcCdDefgGhikKlnNoOpqPsStuvV")+"] ["+green("--oneshot")+"] ["+green("--newuse")+"] ["+green("--noconfmem")+"]" 18 18 print " [ " + green("--color")+" < " + turquoise("y") + " | "+ turquoise("n")+" > ] [ "+green("--columns")+" ]" 19 print " 19 print " [ "+green("--reinstall ")+turquoise("changed-use")+" ] ["+green("--nospinner")+"]" 20 20 print " [ "+green("--deep")+" ] [" + green("--with-bdeps")+" < " + turquoise("y") + " | "+ turquoise("n")+" > ]" 21 21 print bold("Actions:")+" [ "+green("--clean")+" | "+green("--depclean")+" | "+green("--prune")+" | "+green("--regen")+" | "+green("--search")+" | "+green("--unmerge")+" ]" … … 294 294 print " output from portage's displays." 295 295 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 296 302 print " "+green("--skipfirst") 297 303 print " This option is only valid in a resume situation. It removes the" -
trunk/essentials/sys-apps/prefix-portage/pym/portage/__init__.py
r3502 r3511 5 5 6 6 7 VERSION="2.2.00. 6804"7 VERSION="2.2.00.7130-prefix" 8 8 9 9 # =========================================================================== … … 187 187 else: 188 188 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: 190 197 if EmptyOnError: 191 198 return [], [] … … 195 202 if dircache.has_key(mypath): 196 203 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) 198 211 ftype = [] 199 212 for x in list: … … 305 318 #beautiful directed graph object 306 319 307 class digraph :320 class digraph(object): 308 321 def __init__(self): 309 322 """Create an empty digraph""" … … 807 820 808 821 def 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 825 class config(object): 813 826 """ 814 827 This class encompasses the main portage configuration. Data is pulled from … … 1009 1022 (parentPath, parentsFile)) 1010 1023 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 = [] 1012 1032 if local_config: 1013 1033 custom_prof = os.path.join( … … 1641 1661 def load_infodir(self,infodir): 1642 1662 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() 1646 1665 else: 1647 1666 writemsg("No pkg setup for settings instance?\n", … … 2102 2121 virts = self.getvirtuals(myroot) 2103 2122 if virts: 2104 myvkeys = virts.keys() 2105 for x in myvkeys: 2123 for x in virts: 2106 2124 vkeysplit = x.split("/") 2107 2125 if not self.virts_p.has_key(vkeysplit[1]): … … 2191 2209 2192 2210 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 2201 2221 2202 2222 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 2207 2224 2208 2225 def __contains__(self, mykey): 2209 2226 """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 2211 2231 2212 2232 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 2215 2236 else: 2216 2237 self[k] = x 2217 2238 return x 2218 2239 2219 def get(self, k, x=None):2220 if k in self:2221 return self[k]2222 else:2223 return x2224 2225 2240 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) 2227 2251 2228 2252 def __setitem__(self,mykey,myvalue): … … 2237 2261 "return our locally-maintained environment" 2238 2262 mydict={} 2239 for x in self .keys():2263 for x in self: 2240 2264 myvalue = self[x] 2241 2265 if not isinstance(myvalue, basestring): … … 2413 2437 "usersandbox" not in features)) 2414 2438 2415 if free :2439 if free or "SANDBOX_ACTIVE" in os.environ: 2416 2440 keywords["opt_name"] += " bash" 2417 2441 spawn_func = portage.process.spawn_bash … … 2636 2660 return 0 2637 2661 del distlocks_subdir 2638 for myfile in filedict .keys():2662 for myfile in filedict: 2639 2663 """ 2640 2664 fetched status … … 2693 2717 writemsg("!!! Failed to adjust permissions:" + \ 2694 2718 " %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: 2696 2729 # We don't have a digest, but the file exists. We must 2697 2730 # assume that it is fully downloaded. … … 2816 2849 writemsg("!!! Failed to adjust permissions:" + \ 2817 2850 " %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 2818 2862 2819 2863 if mydigests!=None and mydigests.has_key(myfile): … … 2867 2911 eout = portage.output.EOutput() 2868 2912 eout.quiet = mysettings.get("PORTAGE_QUIET", None) == "1" 2869 for x_key in mydigests[myfile] .keys():2913 for x_key in mydigests[myfile]: 2870 2914 eout.ebegin("%s %s ;-)" % (myfile, x_key)) 2871 2915 eout.eend(0) … … 2951 2995 if required_hash_types.difference(myhashes): 2952 2996 missing_hashes.add(myfile) 2997 continue 2998 if myhashes["size"] == 0: 2999 missing_hashes.add(myfile) 2953 3000 if missing_hashes: 2954 3001 missing_files = [] 2955 3002 for myfile in missing_hashes: 2956 3003 try: 2957 os.stat(os.path.join(mysettings["DISTDIR"], myfile))3004 st = os.stat(os.path.join(mysettings["DISTDIR"], myfile)) 2958 3005 except OSError, e: 2959 3006 if e.errno != errno.ENOENT: … … 2961 3008 del e 2962 3009 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) 2963 3014 if missing_files: 2964 3015 mytree = os.path.realpath(os.path.dirname( … … 3123 3174 if alwaysdep or "noauto" not in mysettings.features: 3124 3175 # process dependency first 3125 if "dep" in actionmap[mydo] .keys():3176 if "dep" in actionmap[mydo]: 3126 3177 retval=spawnebuild(actionmap[mydo]["dep"],actionmap,mysettings,debug,alwaysdep=alwaysdep,logfile=logfile) 3127 3178 if retval: … … 3222 3273 mysettings["PF"] = mypv 3223 3274 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("/", "_-_") 3226 3278 3227 3279 mysettings["PROFILE_PATHS"] = "\n".join(mysettings.profiles)+"\n"+CUSTOM_PROFILE_PATH … … 3932 3984 # merge the deps in so we have again a 'full' actionmap 3933 3985 # be glad when this can die. 3934 for x in actionmap .keys():3986 for x in actionmap: 3935 3987 if len(actionmap_deps.get(x, [])): 3936 3988 actionmap[x]["dep"] = ' '.join(actionmap_deps[x]) 3937 3989 3938 if mydo in actionmap .keys():3990 if mydo in actionmap: 3939 3991 retval = spawnebuild(mydo, 3940 3992 actionmap, mysettings, debug, logfile=logfile) … … 3969 4021 return 1 3970 4022 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, to3976 # 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 pass3983 break3984 4023 return retval 3985 4024 … … 4006 4045 4007 4046 expandcache={} 4047 4048 def _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)) 4008 4053 4009 4054 def movefile(src,dest,newmtime=None,sstat=None,mysettings=None): … … 4942 4987 return self.portdb.getfetchlist(pkg_key, mysettings=self.settings, 4943 4988 all=True, mytree=self.mytree)[1] 4989 def __contains__(self): 4990 return pkg_key in self.keys() 4944 4991 def has_key(self, pkg_key): 4945 4992 """Returns true if the given package exists within pkgdir.""" 4946 return pkg_key in self .keys()4993 return pkg_key in self 4947 4994 def keys(self): 4948 4995 """Returns keys for all packages within pkgdir""" -
trunk/essentials/sys-apps/prefix-portage/pym/portage/cache/anydbm.py
r3488 r3511 61 61 del self.__db[cpv] 62 62 63 def iterkeys(self):63 def __iter__(self): 64 64 return iter(self.__db) 65 65 -
trunk/essentials/sys-apps/prefix-portage/pym/portage/cache/flat_hash.py
r3488 r3511 103 103 104 104 105 def iterkeys(self):105 def __iter__(self): 106 106 """generator for walking the dir struct""" 107 107 dirs = [self.location] -
trunk/essentials/sys-apps/prefix-portage/pym/portage/cache/flat_list.py
r3488 r3511 87 87 88 88 89 def iterkeys(self):89 def __iter__(self): 90 90 """generator for walking the dir struct""" 91 91 dirs = [self._base] -
trunk/essentials/sys-apps/prefix-portage/pym/portage/cache/metadata_overlay.py
r3488 r3511 76 76 return True 77 77 78 def iterkeys(self):78 def __iter__(self): 79 79 s = set() 80 for cpv in self.db_rw .iterkeys():81 if self.has_key(cpv): # validates whiteout when necessary80 for cpv in self.db_rw: 81 if cpv in self: # validates whiteout when necessary 82 82 yield cpv 83 83 # set includes whiteouts so they won't be yielded later 84 84 s.add(cpv) 85 for cpv in self.db_ro .iterkeys():85 for cpv in self.db_ro: 86 86 if cpv not in s: 87 87 yield cpv -
trunk/essentials/sys-apps/prefix-portage/pym/portage/cache/sql_template.py
r3488 r3511 210 210 211 211 212 def iterkeys(self):212 def __iter__(self): 213 213 if not self.autocommits: 214 214 try: self.commit() -
trunk/essentials/sys-apps/prefix-portage/pym/portage/cache/sqlite.py
r3488 r3511 224 224 raise cache_errors.CacheCorruption(cpv, "key is not unique") 225 225 226 def iterkeys(self):226 def __iter__(self): 227 227 """generator for walking the dir struct""" 228 228 cursor = self._db_cursor -
trunk/essentials/sys-apps/prefix-portage/pym/portage/cache/template.py
r3488 r3511 96 96 97 97 def iterkeys(self): 98 r aise NotImplementedError98 return iter(self) 99 99 100 100 def iteritems(self): … … 123 123 raise NotImplementedError 124 124 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 125 141 126 142 def get_matches(self, match_dict): … … 146 162 raise InvalidRestriction(key, match, "Key isn't valid") 147 163 148 for cpv in self. keys():164 for cpv in self.iterkeys(): 149 165 cont = True 150 166 vals = self[cpv] -
trunk/essentials/sys-apps/prefix-portage/pym/portage/cache/util.py
r3488 r3511 19 19 noise=verbose_instance 20 20 21 dead_nodes = {} 22 dead_nodes = dict.fromkeys(trg_cache.keys()) 21 dead_nodes = set(trg_cache) 23 22 count=0 24 23 … … 29 28 # print "processing x=",x 30 29 count+=1 31 if dead_nodes.has_key(x): 32 del dead_nodes[x] 30 dead_nodes.discard(x) 33 31 try: entry = src_cache[x] 34 32 except KeyError, e: … … 100 98 noise.exception(ce) 101 99 del ce 102 dead_nodes.clear()103 100 noise.finish() 104 101 -
trunk/essentials/sys-apps/prefix-portage/pym/portage/cache/volatile.py
r3488 r3511 17 17 super(database, self).__init__(*args, **config) 18 18 self._data = {} 19 self. iterkeys = self._data.iterkeys19 self.__iter__ = self._data.__iter__ 20 20 self._delitem = self._data.__delitem__ 21 21 self.__contains__ = self._data.__contains__ -
trunk/essentials/sys-apps/prefix-portage/pym/portage/checksum.py
r3488 r3511 4 4 # $Id: portage_checksum.py 3835 2006-07-11 00:59:10Z zmedico $ 5 5 6 if not hasattr(__builtins__, "set"):7 from sets import Set as set8 9 6 from portage.const import PRIVATE_PATH,PRELINK_BINARY,HASHING_BLOCKSIZE 10 7 import os 11 8 import errno 12 import shutil13 9 import stat 14 10 import portage.exception 15 11 import portage.process 16 import portage.util17 12 import portage.locks 18 13 import commands 19 import sha 20 21 22 # actual hash functions first 14 import md5, sha 23 15 24 16 #dict of all available hash functions 25 17 hashfunc_map = {} 26 27 # We _try_ to load this module. If it fails we do the slightly slower fallback. 18 hashorigin_map = {} 19 20 def _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 49 md5hash = _generate_hash_function("MD5", md5.new, origin="internal") 50 sha1hash = _generate_hash_function("SHA1", sha.new, origin="internal") 51 52 # Use pycrypto when available, prefer it over the internal fallbacks 53 try: 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") 60 except 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. 65 try: 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") 79 except ImportError, e: 80 pass 81 82 83 # Use python-fchksum if available, prefer it over all other MD5 implementations 28 84 try: 29 85 import fchksum … … 31 87 def md5hash(filename): 32 88 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 51 92 except ImportError: 52 93 pass 53 94 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 63 96 def getsize(filename): 64 97 size = os.stat(filename).st_size … … 80 113 def perform_all(x, calc_prelink=0): 81 114 mydict = {} 82 for k in hashfunc_map .keys():115 for k in hashfunc_map: 83 116 mydict[k] = perform_checksum(x, hashfunc_map[k], calc_prelink)[0] 84 117 return mydict … … 86 119 def get_valid_checksum_keys(): 87 120 return hashfunc_map.keys() 121 122 def get_hash_origin(hashtype): 123 if hashtype not in hashfunc_map: 124 raise KeyError(hashtype) 125 return hashorigin_map.get(hashtype, "unknown") 88 126 89 127 def verify_all(filename, mydict, calc_prelink=0, strict=0): … … 132 170 return False, ("Insufficient data for checksum verification", got, expected) 133 171 134 for x in mydict .keys():172 for x in mydict: 135 173 if x == "size": 136 174 continue 137 elif x in hashfunc_map .keys():175 elif x in hashfunc_map: 138 176 myhash = perform_checksum(filename, x, calc_prelink=calc_prelink)[0] 139 177 if mydict[x] != myhash: … … 145 183 break 146 184 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 against153 @type filename: String154 @param hashname: The hash object that will execute the checksum on the file155 @type hashname: Object156 @return: The hash and size of the data157 """158 f = open(filename, 'rb')159 blocksize = HASHING_BLOCKSIZE160 data = f.read(blocksize)161 size = 0L162 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)170 185 171 186 def perform_checksum(filename, hashname="MD5", calc_prelink=0): … … 238 253 for x in hashes: 239 254 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)" 241 256 rVal[x] = perform_checksum(filename, x, calc_prelink)[0] 242 257 return rVal -
trunk/essentials/sys-apps/prefix-portage/pym/portage/const_autotool.py
r3488 r3511 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: $ 5 4 6 5 # all vars that are to wind up in portage_const must have their name listed in __all__ 7 6 8 __all__ = ["EPREFIX", "SYSCONFDIR", "PORTAGE_BASE", "portageuser", "portagegroup", "rootuser", "rootuid", "wheelgid"] 7 __all__ = ["EPREFIX", "SYSCONFDIR", "PORTAGE_BASE", "portageuser", 8 "portagegroup", "rootuser", "rootuid"] 9 9 10 10 from os import path … … 16 16 portageuser="@portageuser@" 17 17 rootuser="@rootuser@" 18 rootuid=int("@rootuid@") 19 wheelgid=int("@wheelgid@") 18 rootuid=@rootuid@ -
trunk/essentials/sys-apps/prefix-portage/pym/portage/cvstree.py
r3488 r3511 65 65 basedir=basedir+"/" 66 66 mylist=[] 67 for myfile in entries["files"] .keys():67 for myfile in entries["files"]: 68 68 if "cvs" in entries["files"][myfile]["status"]: 69 69 if "0" == entries["files"][myfile]["revision"]: 70 70 mylist.append(basedir+myfile) 71 71 if recursive: 72 for mydir in entries["dirs"] .keys():72 for mydir in entries["dirs"]: 73 73 mylist+=findnew(entries["dirs"][mydir],recursive,basedir+mydir) 74 74 return mylist … … 82 82 basedir=basedir+"/" 83 83 mylist=[] 84 for myfile in entries["files"] .keys():84 for myfile in entries["files"]: 85 85 if "cvs" in entries["files"][myfile]["status"]: 86 86 if "current" not in entries["files"][myfile]["status"]: … … 89 89 mylist.append(basedir+myfile) 90 90 if recursive: 91 for mydir in entries["dirs"] .keys():91 for mydir in entries["dirs"]: 92 92 mylist+=findchanged(entries["dirs"][mydir],recursive,basedir+mydir) 93 93 return mylist … … 101 101 basedir=basedir+"/" 102 102 mylist=[] 103 for myfile in entries["files"] .keys():103 for myfile in entries["files"]: 104 104 if "cvs" in entries["files"][myfile]["status"]: 105 105 if "exists" not in entries["files"][myfile]["status"]: … … 107 107 mylist.append(basedir+myfile) 108 108 if recursive: 109 for mydir in entries["dirs"] .keys():109 for mydir in entries["dirs"]: 110 110 mylist+=findmissing(entries["dirs"][mydir],recursive,basedir+mydir) 111 111 return mylist … … 121 121 122 122 #ignore what cvs ignores. 123 for myfile in entries["files"] .keys():123 for myfile in entries["files"]: 124 124 if "cvs" not in entries["files"][myfile]["status"]: 125 125 mylist.append(basedir+myfile) 126 126 if recursive: 127 for mydir in entries["dirs"] .keys():127 for mydir in entries["dirs"]: 128 128 mylist+=findunadded(entries["dirs"][mydir],recursive,basedir+mydir) 129 129 return mylist … … 136 136 basedir=basedir+"/" 137 137 mylist=[] 138 for myfile in entries["files"] .keys():138 for myfile in entries["files"]: 139 139 if "removed" in entries["files"][myfile]["status"]: 140 140 mylist.append(basedir+myfile) 141 141 if recursive: 142 for mydir in entries["dirs"] .keys():142 for mydir in entries["dirs"]: 143 143 mylist+=findremoved(entries["dirs"][mydir],recursive,basedir+mydir) 144 144 return mylist -
trunk/essentials/sys-apps/prefix-portage/pym/portage/data.py
r3488 r3511 2 2 # Copyright 1998-2004 Gentoo Foundation 3 3 # Distributed under the terms of the GNU General Public License v2 4 # $Id: $4 # $Id: $ 5 5 6 6 if not hasattr(__builtins__, "set"): … … 8 8 9 9 import os, sys, pwd, grp 10 from portage.const import wheelgid, rootuid, portageuser, portagegroup11 10 from portage.util import writemsg 11 from portage.const import rootuid, portageuser, portagegroup 12 12 from portage.output import green,red 13 13 from portage.output import create_color_func … … 68 68 69 69 uid=os.getuid() 70 wheelg roup=grp.getgrgid(wheelgid)[0]70 wheelgid=0 71 71 72 if uid== 0 or uid==int(rootuid):72 if uid==rootuid: 73 73 secpass=2 74 74 try: 75 if (not secpass) and (wheelgid in os.getgroups()): 76 secpass=1 75 wheelgid=grp.getgrnam("wheel")[2] 77 76 except 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")82 77 pass 83 78 … … 90 85 except KeyError: 91 86 portage_uid=0 92 portage_gid= wheelgid87 portage_gid=0 93 88 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") 103 93 writemsg("\n") 104 94 portage_group_warning() -
trunk/essentials/sys-apps/prefix-portage/pym/portage/dbapi/bintree.py
r3488 r3511 1 1 # Copyright 1998-2007 Gentoo Foundation 2 2 # 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 $ 4 4 5 5 from portage.dep import isvalidatom, isjustname, dep_getkey, match_from_list … … 11 11 from portage.update import update_dbentries 12 12 13 from portage import listdir, dep_expand13 from portage import dep_expand, listdir, _movefile 14 14 15 15 import portage.xpak, portage.getbinpkg … … 207 207 raise 208 208 del e 209 os.rename(tbz2path, new_path)209 _movefile(tbz2path, new_path, mysettings=self.settings) 210 210 self._remove_symlink(mycpv) 211 211 if new_path.split(os.path.sep)[-2] == "All": … … 300 300 raise 301 301 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) 303 304 self._create_symlink(cpv) 304 305 self._pkg_paths[cpv] = os.path.join("All", myfile) … … 318 319 raise 319 320 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) 321 323 self._pkg_paths[cpv] = mypath 322 324 … … 430 432 self.dbapi._aux_cache[mycpv] = aux_cache 431 433 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 432 440 mytbz2 = portage.xpak.tbz2(full_path) 433 441 # For invalid packages, mycat could be None. … … 501 509 # from xpak. 502 510 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] 505 512 for cpv in stale: 506 513 del metadata[cpv] … … 677 684 wantnewlockfile=1) 678 685 if filename is not None: 679 os.rename(filename, self.getname(cpv))686 _movefile(filename, self.getname(cpv), mysettings=self.settings) 680 687 if self._all_directory and \ 681 688 self.getname(cpv).split(os.path.sep)[-2] == "All": … … 823 830 824 831 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 829 841 830 842 def get_use(self, pkgname): … … 834 846 835 847 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.""" 837 850 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): 841 855 if (tbz2name not in self.invalids): 842 856 return 843 857 else: 858 resume = True 844 859 writemsg("Resuming download of this tbz2, but it is possible that it is corrupt.\n", 845 860 noiselevel=-1) 846 tbz2_path = self.getname(pkgname)861 847 862 mydest = os.path.dirname(self.getname(pkgname)) 848 863 try: … … 850 865 except (OSError, IOError): 851 866 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 855 869 if self._remote_has_index: 856 870 rel_url = self._remotepkgs[pkgname].get("PATH") 857 871 if not rel_url: 858 872 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("/") 861 874 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) 864 884 if success and "strict" in self.settings.features: 865 885 metadata = self._remotepkgs[pkgname] -
trunk/essentials/sys-apps/prefix-portage/pym/portage/dbapi/porttree.py
r3504 r3511 1 1 # Copyright 1998-2007 Gentoo Foundation 2 2 # 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 $ 4 4 5 5 from portage.cache.cache_errors import CacheError … … 20 20 21 21 from portage import eclass_cache, auxdbkeys, auxdbkeylen, doebuild, flatten, \ 22 listdir, dep_expand, eapi_is_supported, key_expand, dep_check , config22 listdir, dep_expand, eapi_is_supported, key_expand, dep_check 23 23 24 24 import os, stat, sys … … 32 32 portdbapi.portdbapi_instances.append(self) 33 33 34 from portage import config 34 35 if mysettings: 35 36 self.mysettings = mysettings … … 91 92 self.treemap[repo_name] = path 92 93 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") 93 96 pass 94 97 … … 145 148 # unhandled exception thrown from constructor 146 149 return 147 for x in self.auxdb .keys():150 for x in self.auxdb: 148 151 self.auxdb[x].sync() 149 152 self.auxdb.clear() … … 193 196 TreeMap = {id: path} 194 197 """ 195 return [k for k in self.treemap .keys()if k]198 return [k for k in self.treemap if k] 196 199 197 200 def findname2(self, mycpv, mytree=None): … … 349 352 for x in mylist: 350 353 if x == "INHERITED": 351 returnme.append(' '.join(mydata.get("_eclasses_", {}).keys()))354 returnme.append(' '.join(mydata.get("_eclasses_", []))) 352 355 else: 353 356 returnme.append(mydata.get(x,"")) … … 650 653 pkgdict = self.mysettings.pkeywordsdict 651 654 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 652 662 for mycpv in mylist: 653 663 try: … … 672 682 for atom in matches: 673 683 pgroups.extend(pkgdict[cp][atom]) 684 pgroups.extend(egroups) 674 685 if matches: 675 686 # normalize pgroups with incrementals logic so it -
trunk/essentials/sys-apps/prefix-portage/pym/portage/dbapi/vartree.py
r3502 r3511 1 1 # Copyright 1998-2007 Gentoo Foundation 2 2 # 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 $ 4 4 5 5 from portage.checksum import perform_md5 … … 12 12 from portage.elog import elog_process 13 13 from portage.exception import InvalidPackageName, InvalidAtom, \ 14 UnsupportedAPIException, FileNotFound14 FileNotFound, PermissionDenied, UnsupportedAPIException 15 15 from portage.locks import lockdir, unlockdir 16 16 from portage.output import bold, red, green … … 21 21 from portage.versions import pkgsplit, catpkgsplit, catsplit, best, pkgcmp 22 22 23 from portage import listdir, dep_expand, config, flatten, key_expand, \ 24 doebuild_environment, doebuild, env_update, dircache, \ 25 abssymlink, movefile, bsd_chflags 23 from portage import listdir, dep_expand, flatten, key_expand, \ 24 doebuild_environment, doebuild, env_update, \ 25 abssymlink, movefile, _movefile, bsd_chflags 26 27 from portage.elog.messages import ewarn 26 28 27 29 import os, sys, stat, errno, commands, copy, time … … 52 54 if e.errno == errno.ENOENT: 53 55 self._data = {} 56 elif e.errno == PermissionDenied.errno: 57 raise PermissionDenied(self._filename) 54 58 else: 55 59 raise e … … 107 111 def hasEntries(self): 108 112 """ Check if this registry contains any records. """ 109 return (len(self._data.keys()) > 0)113 return len(self._data) > 0 110 114 111 115 def getPreservedLibs(self): … … 115 119 """ 116 120 rValue = {} 117 for cps in self._data .keys():121 for cps in self._data: 118 122 rValue[self._data[cps][0]] = self._data[cps][2] 119 123 return rValue … … 155 159 obj_dict[lib].append(mysplit[0]) 156 160 mapfile = open(self._filename, "w") 157 for lib in obj_dict .keys():161 for lib in obj_dict: 158 162 mapfile.write(lib+" "+",".join(obj_dict[lib])+"\n") 159 163 mapfile.close() … … 184 188 self.vartree = vartree 185 189 self._aux_cache_keys = set(["SLOT", "COUNTER", "PROVIDE", "USE", 186 "IUSE", "DEPEND", "RDEPEND", "PDEPEND", "NEEDED" ])190 "IUSE", "DEPEND", "RDEPEND", "PDEPEND", "NEEDED", "repository"]) 187 191 self._aux_cache = None 188 192 self._aux_cache_version = "1" … … 190 194 CACHE_PATH.lstrip(os.path.sep), "vdb_metadata.pickle") 191 195 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 194 203 195 204 def getpath(self, mykey, filename=None): … … 302 311 #dest already exists; keep this puppy where it is. 303 312 continue 304 os.rename(origpath, newpath)313 _movefile(origpath, newpath, mysettings=self.settings) 305 314 306 315 # We need to rename the ebuild now. … … 311 320 os.rename(os.path.join(newpath, old_pf + ".ebuild"), 312 321 os.path.join(newpath, new_pf + ".ebuild")) 313 except OSError, e:322 except EnvironmentError, e: 314 323 if e.errno != errno.ENOENT: 315 324 raise … … 644 653 self.dbapi = copy.deepcopy(clone.dbapi) 645 654 self.populated = 1 655 from portage import config 646 656 self.settings = config(clone=clone.settings) 647 657 else: … … 909 919 """ 910 920 contents_file = os.path.join(self.dbdir, "CONTENTS") 911 if not os.path.exists(contents_file):912 return None913 921 if self.contentscache is not None: 914 922 return self.contentscache 915 923 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 917 932 mylines = myc.readlines() 918 933 myc.close() … … 962 977 pkgfiles[" ".join(mydat[1:])] = [mydat[0]] 963 978 else: 964 return None 979 writemsg("!!! Unrecognized CONTENTS entry on " + \ 980 "line %d: '%s'\n" % (pos, line), noiselevel=-1) 965 981 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) 967 984 self.contentscache = pkgfiles 968 985 return pkgfiles 969 986 970 987 def unmerge(self, pkgfiles=None, trimworld=1, cleanup=1, 971 ldpath_mtimes=None, new_contents=None):988 ldpath_mtimes=None, others_in_slot=None): 972 989 """ 973 990 Calls prerm … … 985 1002 @param ldpath_mtimes: mtimes to pass to env_update (see env_update) 986 1003 @type ldpath_mtimes: Dictionary 987 @param new_contents: contents from a new instance that will replace this one988 @type new_contents: Dictionary1004 @param others_in_slot: all dblink instances in this slot, excluding self 1005 @type others_in_slot: list 989 1006 @rtype: Integer 990 1007 @returns: … … 997 1014 """ 998 1015 999 # When new_contentsis supplied, the security check has already been1016 # When others_in_slot is supplied, the security check has already been 1000 1017 # done for this slot, so it shouldn't be repeated until the next 1001 1018 # replacement or unmerge operation. 1002 if new_contentsis None:1019 if others_in_slot is None: 1003 1020 slot = self.vartree.dbapi.aux_get(self.mycpv, ["SLOT"])[0] 1004 1021 slot_matches = self.vartree.dbapi.match( 1005 1022 "%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) 1007 1030 if retval: 1008 1031 return retval … … 1039 1062 builddir_lock = None 1040 1063 catdir_lock = None 1064 retval = -1 1041 1065 try: 1042 1066 if myebuildpath: … … 1061 1085 return retval 1062 1086 1063 self._unmerge_pkgfiles(pkgfiles, new_contents=new_contents)1087 self._unmerge_pkgfiles(pkgfiles, others_in_slot) 1064 1088 1065 1089 # Remove the registration of preserved libs for this pkg instance … … 1071 1095 mydbapi=self.vartree.dbapi, vartree=self.vartree) 1072 1096 1073 # process logs created during pre/postrm1074 elog_process(self.mycpv, self.settings)1075 1076 1097 # XXX: Decide how to handle failures here. 1077 1098 if retval != os.EX_OK: 1078 1099 writemsg("!!! FAILED postrm: %s\n" % retval, noiselevel=-1) 1079 1100 return retval 1080 doebuild(myebuildpath, "cleanrm", self.myroot, self.settings, 1081 tree="vartree", mydbapi=self.vartree.dbapi, 1082 vartree=self.vartree) 1083 1101 1084 1102 # regenerate reverse NEEDED map 1085 1103 self.vartree.dbapi.libmap.update() … … 1087 1105 finally: 1088 1106 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) 1090 1118 try: 1091 1119 if myebuildpath and not catdir_lock: … … 1106 1134 return os.EX_OK 1107 1135 1108 def _unmerge_pkgfiles(self, pkgfiles, new_contents=None):1136 def _unmerge_pkgfiles(self, pkgfiles, others_in_slot): 1109 1137 """ 1110 1138 … … 1114 1142 @param pkgfiles: typically self.getcontents() 1115 1143 @type pkgfiles: Dictionary { filename: [ 'type', '?', 'md5sum' ] } 1116 @param new_contents: contents from a new instance that will replace this one1117 @type new_contents: Dictionary1144 @param others_in_slot: all dblink instances in this slot, excluding self 1145 @type others_in_slot: list 1118 1146 @rtype: None 1119 1147 """ 1120 global dircache1121 dircache={}1122 1148 1123 1149 if not pkgfiles: … … 1125 1151 pkgfiles = self.getcontents() 1126 1152 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 = [] 1129 1155 slot = self.vartree.dbapi.aux_get(self.mycpv, ["SLOT"])[0] 1130 1156 slot_matches = self.vartree.dbapi.match( 1131 1157 "%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 1148 1169 1149 1170 if pkgfiles: … … 1154 1175 #process symlinks second-to-last, directories last. 1155 1176 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)) 1157 1181 for objkey in mykeys: 1158 1182 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] 1165 1185 statobj = None 1166 1186 try: … … 1174 1194 pass 1175 1195 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) 1182 1210 continue 1183 1211 # next line includes a tweak to protect modules from being unmerged, … … 1187 1215 # should be able to be independently specified. 1188 1216 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) 1190 1235 continue 1191 1236 1192 1237 lmtime = str(lstatobj[stat.ST_MTIME]) 1193 1238 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) 1195 1240 continue 1196 1241 1197 1242 if pkgfiles[objkey][0] == "dir": 1198 1243 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) 1200 1245 continue 1201 1246 mydirs.append(obj) 1202 1247 elif pkgfiles[objkey][0] == "sym": 1203 1248 if not islink: 1204 writemsg_stdout("--- !sym %s %s\n" % ("sym", obj))1249 show_unmerge("---", "!sym", file_type, obj) 1205 1250 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. 1206 1258 try: 1207 1259 os.unlink(obj) 1208 writemsg_stdout("<<< %s %s\n" % ("sym", obj))1260 show_unmerge("<<<", "", file_type, obj) 1209 1261 except (OSError, IOError),e: 1210 writemsg_stdout("!!! %s %s\n" % ("sym", obj))1262 show_unmerge("!!!", "", file_type, obj) 1211 1263 elif pkgfiles[objkey][0] == "obj": 1212 1264 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) 1214 1266 continue 1215 1267 mymd5 = None … … 1218 1270 except FileNotFound, e: 1219 1271 # 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) 1221 1273 continue 1222 1274 … … 1224 1276 # string.lower allows for backwards compatibility. 1225 1277 if mymd5 != pkgfiles[objkey][2].lower(): 1226 writemsg_stdout("--- !md5 %s %s\n" % ("obj", obj))1278 show_unmerge("---", "!md5", file_type, obj) 1227 1279 continue 1228 1280 try: 1229 1281 # Remove permissions to ensure that any hardlinks to 1230 1282 # suid/sgid files are rendered harmless. 1231 os.chmod(obj, 0) 1283 if not islink: 1284 os.chmod(obj, 0) 1232 1285 os.unlink(obj) 1233 1286 except (OSError, IOError), e: 1234 1287 pass 1235 writemsg_stdout("<<< %s %s\n" % ("obj", obj))1288 show_unmerge("<<<", "", file_type, obj) 1236 1289 elif pkgfiles[objkey][0] == "fif": 1237 1290 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) 1239 1292 continue 1240 writemsg_stdout("--- %s %s\n" % ("fif", obj))1293 show_unmerge("---", "", file_type, obj) 1241 1294 elif pkgfiles[objkey][0] == "dev": 1242 writemsg_stdout("--- %s %s\n" % ("dev", obj))1295 show_unmerge("---", "", file_type, obj) 1243 1296 1244 1297 mydirs.sort() … … 1248 1301 try: 1249 1302 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) 1253 1306 1254 1307 #remove self from vartree database so that our own virtual gets zapped if we're the last node … … 1271 1324 destfile = normalize_path( 1272 1325 os.path.join(destroot, filename.lstrip(os.path.sep))) 1273 try:1274 mylstat = os.lstat(destfile)1275 except (OSError, IOError):1276 return True1277 1326 1278 1327 pkgfiles = self.getcontents() 1279 if pkgfiles and filename in pkgfiles:1328 if pkgfiles and destfile in pkgfiles: 1280 1329 return True 1281 1330 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 1282 1338 if self._contents_inodes is None: 1283 1339 self._contents_inodes = set() … … 1299 1355 # get list of libraries from old package instance 1300 1356 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) 1302 1358 1303 1359 # 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) 1305 1361 1306 1362 # check which libs are present in the old, but not the new package instance … … 1360 1416 del preserve_paths 1361 1417 1362 def _collision_protect(self, srcroot, destroot, otherversions, mycontents, mysymlinks):1418 def _collision_protect(self, srcroot, destroot, mypkglist, mycontents, mysymlinks): 1363 1419 collision_ignore = set([normalize_path(myignore) for myignore in \ 1364 1420 self.settings.get("COLLISION_IGNORE", "").split()]) … … 1374 1430 stopmerge = False 1375 1431 i=0 1376 1377 otherpkg=[]1378 mypkglist=[]1379 1380 if self.pkg in otherversions:1381 otherversions.remove(self.pkg) # we already checked this package1382 1383 myslot = self.settings["SLOT"]1384 for v in otherversions:1385 # only allow versions with same slot to overwrite files1386 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 1391 1432 collisions = [] 1392 1433 … … 1405 1446 if i % 1000 == 0: 1406 1447 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 1407 1457 if f[0] != "/": 1408 1458 f="/"+f … … 1467 1517 pass 1468 1518 1469 def _security_check(self, slot_matches):1470 if not slot_matches:1519 def _security_check(self, installed_instances): 1520 if not installed_instances: 1471 1521 return 0 1472 1522 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()) 1477 1525 inode_map = {} 1526 real_paths = set() 1478 1527 for path in file_paths: 1479 1528 try: … … 1484 1533 del e 1485 1534 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 \ 1488 1542 s.st_mode & (stat.S_ISUID | stat.S_ISGID): 1489 1543 k = (s.st_dev, s.st_ino) … … 1558 1612 slot_matches = self.vartree.dbapi.match( 1559 1613 "%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) 1561 1628 if retval: 1562 1629 return retval … … 1564 1631 if slot_matches: 1565 1632 # Used by self.isprotected(). 1566 max_ cpv= None1633 max_dblnk = None 1567 1634 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) 1570 1637 if cur_counter > max_counter: 1571 1638 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 1577 1641 1578 1642 # get current counter value (counter_tick also takes care of incrementing it) … … 1601 1665 mylinklist = filter(os.path.islink, [os.path.join(srcroot, x) for x in listdir(srcroot, recursive=1, filesonly=0, followSymlinks=False)]) 1602 1666 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: 1606 1671 """ The merge process may move files out of the image directory, 1607 1672 which causes invalidation of the .installed flag.""" … … 1637 1702 self.copyfile(inforoot+"/"+x) 1638 1703 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 1639 1719 # write local package counter for recording 1640 1720 lcfile = open(os.path.join(self.dbtmpdir, "COUNTER"),"w") … … 1698 1778 outfile.flush() 1699 1779 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 1704 1784 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) 1708 1790 writemsg_stdout(">>> Original instance of package unmerged safely.\n") 1791 break 1709 1792 1710 1793 # We hold both directory locks. 1711 1794 self.dbdir = self.dbpkgdir 1712 1795 self.delete() 1713 movefile(self.dbtmpdir, self.dbpkgdir, mysettings=self.settings)1796 _movefile(self.dbtmpdir, self.dbpkgdir, mysettings=self.settings) 1714 1797 contents = self.getcontents() 1715 1798 … … 1748 1831 target_root=self.settings["ROOT"], prev_mtimes=prev_mtimes, 1749 1832 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 1754 1834 writemsg_stdout(">>> %s %s\n" % (self.mycpv,"merged.")) 1755 1756 # Process ebuild logfiles1757 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)1761 1835 return os.EX_OK 1762 1836 … … 1901 1975 if bsd_chflags: 1902 1976 # Save then clear flags on dest. 1903 dflags = os.lstat(mydest).st_flags1977 dflags = mydstat.st_flags 1904 1978 if dflags != 0: 1905 1979 bsd_chflags.lchflags(mydest, 0) … … 2030 2104 def merge(self, mergeroot, inforoot, myroot, myebuild=None, cleanup=0, 2031 2105 mydbapi=None, prev_mtimes=None): 2106 retval = -1 2107 self.lockdb() 2032 2108 try: 2033 self.lockdb() 2034 return self.treewalk(mergeroot, myroot, inforoot, myebuild, 2109 retval = self.treewalk(mergeroot, myroot, inforoot, myebuild, 2035 2110 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) 2036 2118 finally: 2037 2119 self.unlockdb() 2120 return retval 2038 2121 2039 2122 def getstring(self,name): … … 2083 2166 return os.path.exists(os.path.join(self.dbdir, "CATEGORY")) 2084 2167 2085 def tar_contents(contents, root, tar, onProgress=None):2086 from portage import normalize_path2168 def tar_contents(contents, root, tar, protect=None, onProgress=None): 2169 from portage.util import normalize_path 2087 2170 root = normalize_path(root).rstrip(os.path.sep) + os.path.sep 2088 2171 id_strings = {} … … 2124 2207 2125 2208 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() 2131 2220 else: 2132 2221 tar.addfile(tarinfo) -
trunk/essentials/sys-apps/prefix-portage/pym/portage/dbapi/virtual.py
r3488 r3511 1 1 # Copyright 1998-2007 Gentoo Foundation 2 2 # Distributed under the terms of the GNU General Public License v2 3 # $Id: virtual.py 6 734 2007-06-05 16:37:29Z grobian $3 # $Id: virtual.py 6944 2007-06-22 08:46:32Z grobian $ 4 4 5 5 … … 41 41 def cp_all(self): 42 42 returnme=[] 43 for x in self.cpdict .keys():43 for x in self.cpdict: 44 44 returnme.extend(self.cpdict[x]) 45 45 return returnme -
trunk/essentials/sys-apps/prefix-portage/pym/portage/eclass_cache.py
r3488 r3511 8 8 from portage.data import portage_gid 9 9 10 class cache :10 class cache(object): 11 11 """ 12 12 Maintains the cache information about eclasses used in ebuild. -
trunk/essentials/sys-apps/prefix-portage/pym/portage/elog/__init__.py
r3488 r3511 2 2 # Copyright 2006-2007 Gentoo Foundation 3 3 # 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 $ 5 5 6 6 from portage.const import EBUILD_PHASES … … 16 16 def _merge_logentries(a, b): 17 17 rValue = {} 18 phases = set(a.keys()+b.keys()) 18 phases = set(a) 19 phases.update(b) 19 20 for p in phases: 20 21 rValue[p] = [] … … 41 42 42 43 _elog_atexit_handlers = [] 43 def elog_process(cpv, mysettings): 44 _preserve_logentries = {} 45 def elog_process(cpv, mysettings, phasefilter=None): 44 46 ebuild_logentries = collect_ebuild_messages(os.path.join(mysettings["T"], "logging")) 45 47 all_logentries = collect_messages() … … 49 51 all_logentries[cpv] = ebuild_logentries 50 52 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 51 64 my_elog_classes = set(mysettings.get("PORTAGE_ELOG_CLASSES", "").split()) 52 65 53 54 for key in all_logentries.keys(): 66 for key in all_logentries: 55 67 default_logentries = filter_loglevels(all_logentries[key], my_elog_classes) 56 68 … … 97 109 if hasattr(m, "finalize") and not m.finalize in _elog_atexit_handlers: 98 110 _elog_atexit_handlers.append(m.finalize) 99 atexit_register(m.finalize , mysettings)111 atexit_register(m.finalize) 100 112 except (ImportError, AttributeError), e: 101 113 writemsg("!!! Error while importing logging modules " + \ -
trunk/essentials/sys-apps/prefix-portage/pym/portage/elog/filtering.py
r3488 r3511 4 4 # $Id: __init__.py 6458 2007-04-30 02:31:30Z genone $ 5 5 6 from portage.const import EBUILD_PHASES 7 6 8 def filter_loglevels(logentries, loglevels): 7 9 # remove unwanted entries from all logentries 8 10 rValue = {} 9 11 loglevels = map(str.upper, loglevels) 10 for phase in logentries .keys():12 for phase in logentries: 11 13 for msgtype, msgcontent in logentries[phase]: 12 14 if msgtype.upper() in loglevels or "*" in loglevels: … … 16 18 return rValue 17 19 20 def 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 31 def filter_mergephases(logentries): 32 myphases = EBUILD_PHASES[:] 33 myphases.remove("prerm") 34 myphases.remove("postrm") 35 return filter_phases(logentries, myphases) 36 37 def filter_unmergephases(logentries): 38 return filter_phases(logentries, ["prerm", "postrm", "other"]) -
trunk/essentials/sys-apps/prefix-portage/pym/portage/elog/messages.py
r3488 r3511 85 85 86 86 import sys 87 for f in _functions .keys():87 for f in _functions: 88 88 setattr(sys.modules[__name__], f, _make_msgfunction(_functions[f][0], _functions[f][1])) 89 89 del f, _functions -
trunk/essentials/sys-apps/prefix-portage/pym/portage/elog/mod_custom.py
r3488 r3511 2 2 # Copyright 2006-2007 Gentoo Foundation 3 3 # Distributed under the terms of the GNU General Public License v2 4 # $Id: mod_custom.py 6 593 2007-05-23 16:27:03Z grobian $4 # $Id: mod_custom.py 6944 2007-06-22 08:46:32Z grobian $ 5 5 6 6 import portage.elog_modules.mod_save, portage.process, portage.exception … … 9 9 elogfilename = portage.elog_modules.mod_save.process(mysettings, key, logentries, fulltext) 10 10 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"): 13 12 raise portage.exception.MissingParameter("!!! Custom logging requested but PORTAGE_ELOG_COMMAND is not defined") 14 13 else: -
trunk/essentials/sys-apps/prefix-portage/pym/portage/elog/mod_echo.py
r3488 r3511 2 2 # Copyright 2007 Gentoo Foundation 3 3 # 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 $ 5 5 6 6 from portage.output import EOutput 7 7 from portage.const import EBUILD_PHASES 8 8 9 _items = {}9 _items = [] 10 10 def process(mysettings, key, logentries, fulltext): 11 _items[key] = logentries 11 global _items 12 _items.append((mysettings, key, logentries)) 12 13 13 def finalize(mysettings): 14 def finalize(): 15 global _items 14 16 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"] 16 21 print 17 printer.einfo("Messages for package %s :" % key)22 printer.einfo("Messages for package %s%s:" % (key, root_msg)) 18 23 print 19 24 for phase in EBUILD_PHASES: 20 if not phase in _items[key]:25 if phase not in logentries: 21 26 continue 22 for msgtype, msgcontent in _items[key][phase]:27 for msgtype, msgcontent in logentries[phase]: 23 28 fmap = {"INFO": printer.einfo, 24 29 "WARN": printer.ewarn, … … 28 33 for line in msgcontent: 29 34 fmap[msgtype](line.strip("\n")) 35 _items = [] 30 36 return -
trunk/essentials/sys-apps/prefix-portage/pym/portage/elog/mod_mail_summary.py
r3488 r3511 2 2 # Copyright 2006-2007 Gentoo Foundation 3 3 # Distributed under the terms of the GNU General Public License v2 4 # $Id: mod_mail_summary.py 6 593 2007-05-23 16:27:03Z grobian $4 # $Id: mod_mail_summary.py 6993 2007-06-24 15:46:46Z grobian $ 5 5 6 6 import portage.mail, socket, os, time … … 9 9 _items = {} 10 10 def process(mysettings, key, logentries, fulltext): 11 global _items 11 12 header = ">>> Messages generated for package %s by process %d on %s:\n\n" % \ 12 13 (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 14 17 15 def finalize(mysettings): 16 if len(_items) == 0: 18 def finalize(): 19 global _items 20 for mysettings, items in _items.itervalues(): 21 _finalize(mysettings, items) 22 _items.clear() 23 24 def _finalize(mysettings, items): 25 if len(items) == 0: 17 26 return 18 elif len( _items) == 1:27 elif len(items) == 1: 19 28 count = "one package" 20 29 else: … … 32 41 mybody = "elog messages for the following packages generated by " + \ 33 42 "process %d on host %s:\n" % (os.getpid(), socket.getfqdn()) 34 for key in _items.keys():43 for key in items: 35 44 mybody += "- %s\n" % key 36 45 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()) 38 48 portage.mail.send_mail(mysettings, mymessage) 39 49 -
trunk/essentials/sys-apps/prefix-portage/pym/portage/env/config.py
r3488 r3511 30 30 31 31 self.data, self.errors = self._loader.load() 32 33 def __iter__(self): 34 return iter(self.data) 32 35 33 36 class PackageKeywordsFile(UserConfigKlass): -
trunk/essentials/sys-apps/prefix-portage/pym/portage/exception.py
r3488 r3511 54 54 55 55 class PermissionDenied(PortageException): 56 from errno import EACCES as errno 56 57 """Permission denied""" 57 58 -
trunk/essentials/sys-apps/prefix-portage/pym/portage/getbinpkg.py
r3488 r3511 80 80 optional connection. If connection is already active, it is passed on. 81 81 baseurl is reduced to address and is returned in tuple (conn,address)""" 82 82 83 parts = baseurl.split("://",1) 83 84 if len(parts) != 2: … … 85 86 protocol,url_parts = parts 86 87 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:]) 88 95 del url_parts 89 address = "/"+address90 96 91 97 userpass_host = host.split("@",1) … … 137 143 conn.set_pasv(passive) 138 144 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) 139 154 else: 140 155 raise NotImplementedError, "%s is not a supported protocol." % protocol … … 303 318 else: 304 319 listing = conn.nlst(address) 320 elif protocol == "sftp": 321 listing = conn.listdir(address) 305 322 else: 306 323 raise TypeError, "Unknown protocol. '%s'" % protocol … … 328 345 elif protocol in ["ftp"]: 329 346 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() 330 354 else: 331 355 raise TypeError, "Unknown protocol. '%s'" % protocol … … 362 386 return file_get_lib(baseurl,dest,conn) 363 387 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: 386 401 sys.stderr.write("Fetcher exited with a failure condition.\n") 387 402 return 0 … … 405 420 elif protocol in ["ftp"]: 406 421 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() 407 441 else: 408 442 raise TypeError, "Unknown protocol. '%s'" % protocol … … 517 551 x = os.path.basename(x) 518 552 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"]: 521 554 sys.stderr.write(yellow("x")) 522 555 metadata[baseurl]["modified"] = 1 -
trunk/essentials/sys-apps/prefix-portage/pym/portage/gpg.py
r3488 r3511 31 31 32 32 33 class FileChecker :33 class FileChecker(object): 34 34 def __init__(self,keydir=None,keyring=None,requireSignedRing=False,minimumTrust=EXISTS): 35 35 self.minimumTrust = TRUSTED # Default we require trust. For rings. -
trunk/essentials/sys-apps/prefix-portage/pym/portage/locks.py
r3488 r3511 286 286 results.append("Found %(count)s locks" % {"count":mycount}) 287 287 288 for x in mylist .keys():288 for x in mylist: 289 289 if mylist[x].has_key(myhost) or remove_all_locks: 290 290 mylockname = hardlock_name(path+"/"+x) … … 292 292 not os.path.exists(path+"/"+x) or \ 293 293 remove_all_locks: 294 for y in mylist[x] .keys():294 for y in mylist[x]: 295 295 for z in mylist[x][y]: 296 296 filename = path+"/"+x+".hardlock-"+y+"-"+z -
trunk/essentials/sys-apps/prefix-portage/pym/portage/manifest.py
r3488 r3511 80 80 class Manifest1Entry(ManifestEntry): 81 81 def __str__(self): 82 myhashkeys = self.hashes.keys() 83 for hashkey in myhashkeys: 82 for hashkey in self.hashes: 84 83 if hashkey != "size": 85 84 break … … 346 345 347 346 def checkIntegrity(self): 348 for t in self.fhashdict .keys():347 for t in self.fhashdict: 349 348 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]: 351 350 raise MissingParameter("Missing %s checksum: %s %s" % (portage.const.MANIFEST2_REQUIRED_HASH, t, f)) 352 351 … … 489 488 pass 490 489 if f in distfilehashes and \ 490 not required_hash_types.difference(distfilehashes[f]) and \ 491 491 ((assumeDistHashesSometimes and mystat is None) or \ 492 492 (assumeDistHashesAlways and mystat is None) or \ 493 493 (assumeDistHashesAlways and mystat is not None and \ 494 494 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)): 497 496 self.fhashdict["DIST"][f] = distfilehashes[f] 498 497 else: -
trunk/essentials/sys-apps/prefix-portage/pym/portage/news.py
r3488 r3511 5 5 6 6 from portage.const import INCREMENTALS, PROFILE_PATH, NEWS_LIB_PATH 7 from portage import config, vartree, vardbapi, portdbapi8 7 from portage.util import ensure_dirs, apply_permissions 9 8 from portage.data import portage_gid … … 27 26 TIMESTAMP_FILE = "news-timestamp" 28 27 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'): 30 29 self.NEWS_PATH = NEWS_PATH 31 30 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 34 34 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 40 47 41 48 # Ensure that the unread path exists and is writable. … … 79 86 except (TypeError, ValueError), e: 80 87 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): 82 90 updates.append(item) 83 91 del path -
trunk/essentials/sys-apps/prefix-portage/pym/portage/output.py
r3488 r3511 114 114 115 115 codes["darkteal"] = codes["turquoise"] 116 codes["darkyellow"] = codes["brown"] 116 # Some terminals have darkyellow instead of brown. 117 codes["0xAAAA00"] = codes["brown"] 118 codes["darkyellow"] = codes["0xAAAA00"] 117 119 codes["fuscia"] = codes["fuchsia"] 118 120 codes["white"] = codes["bold"] … … 130 132 codes["SECURITY_WARN"] = codes["red"] 131 133 codes["MERGE_LIST_PROGRESS"] = codes["yellow"] 134 codes["PKG_MERGE"] = codes["darkgreen"] 135 codes["PKG_MERGE_ARG"] = codes["darkgreen"] 136 codes["PKG_MERGE_SYSTEM"] = codes["green"] 137 codes["PKG_MERGE_WORLD"] = codes["green"] 138 codes["PKG_NOMERGE"] = codes["darkblue"] 139 codes["PKG_NOMERGE_ARG"] = codes["darkblue"] 140 codes["PKG_NOMERGE_SYSTEM"] = codes["blue"] 141 codes["PKG_NOMERGE_WORLD"] = codes["blue"] 132 142 133 143 def parse_color_map(): … … 203 213 if shell: 204 214 spawn([shell, "-c", prompt_command], env=os.environ, 205 fd pipes={0:sys.stdin.fileno(),1:sys.stderr.fileno(),215 fd_pipes={0:sys.stdin.fileno(),1:sys.stderr.fileno(), 206 216 2:sys.stderr.fileno()}) 207 217 else: … … 257 267 `stty size` is parsed. 258 268 """ 269 if not sys.stdout.isatty(): 270 return -1, -1 259 271 try: 260 272 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 263 278 except ImportError: 264 279 pass … … 282 297 spawn(cmd, env=os.environ, fd_pipes={0:fd}) 283 298 284 class EOutput :299 class EOutput(object): 285 300 """ 286 301 Performs fancy terminal formatting for status and informational messages. … … 519 534 maxval = self._maxval 520 535 position = self._position 521 if cols < 3: 536 percentage_str_width = 4 537 square_brackets_width = 2 538 if cols < percentage_str_width: 522 539 return "" 523 bar_space = cols - 6540 bar_space = cols - percentage_str_width - square_brackets_width 524 541 if maxval == 0: 525 542 max_bar_width = bar_space-3 … … 546 563 return image 547 564 else: 548 max_bar_width = bar_space-1549 565 percentage = int(100 * float(curval) / maxval) 550 566 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) 553 571 if cols < min_columns: 554 572 return image -
trunk/essentials/sys-apps/prefix-portage/pym/portage/tests/__init__.py
r3488 r3511 2 2 # Copyright 2006 Gentoo Foundation 3 3 # Distributed under the terms of the GNU General Public License v2 4 # $Id: __init__.py 6 312 2007-03-28 19:20:08Z grobian $4 # $Id: __init__.py 6943 2007-06-22 08:42:54Z grobian $ 5 5 6 6 import os, sys, time, unittest … … 8 8 9 9 def main(): 10 testDirs = ["bin", "util","versions", "dep", "xpak", "env/config"] 10 testDirs = ["bin", "dep", "ebuild", 11 "env/config", "util", "versions", "xpak"] 11 12 suite = unittest.TestSuite() 12 13 basedir = os.path.dirname(__file__) -
trunk/essentials/sys-apps/prefix-portage/pym/portage/tests/bin/setup_env.py
r3488 r3511 8 8 from portage.tests import TestCase 9 9 from portage.process import spawn 10 from portage.const import PORTAGE_BIN_PATH 10 11 11 12 bindir = join(dirname(dirname(abspath(__file__))), "..", "..", "..", "bin") … … 16 17 os.environ["PF"] = "portage-tests-0.09-r1" 17 18 os.environ["PATH"] = bindir + ":" + os.environ["PATH"] 19 os.environ["PORTAGE_BIN_PATH"] = PORTAGE_BIN_PATH 18 20 19 21 def binTestsCleanup(): -
trunk/essentials/sys-apps/prefix-portage/pym/portage/tests/env/config/test_PackageMaskFile.py
r3488 r3511 19 19 f = PackageMaskFile(self.fname) 20 20 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) 22 23 finally: 23 24 self.NukeFile() -
trunk/essentials/sys-apps/prefix-portage/pym/portage/tests/env/config/test_PortageModulesFile.py
r3488 r3511 19 19 self.BuildFile() 20 20 f = PortageModulesFile(self.fname) 21 for k in f .keys():21 for k in f: 22 22 self.assertEqual( f[k], self.items[k] ) 23 23 self.NukeFile() -
trunk/essentials/sys-apps/prefix-portage/pym/portage/tests/runTests
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/pym/portage/tests/util/test_varExpand.py
r3488 r3511 2 2 # Copyright 2006 Gentoo Foundation 3 3 # Distributed under the terms of the GNU General Public License v2 4 # $Id: test_varExpand.py 6 532 2007-05-13 20:52:10Z grobian $4 # $Id: test_varExpand.py 6944 2007-06-22 08:46:32Z grobian $ 5 5 6 6 from portage.tests import TestCase … … 12 12 13 13 varDict = { "a":"5", "b":"7", "c":"-5" } 14 for key in varDict .keys():14 for key in varDict: 15 15 result = varexpand( "$%s" % key, varDict ) 16 16 -
trunk/essentials/sys-apps/prefix-portage/pym/portage/update.py
r3488 r3511 208 208 sys.stdout.flush() 209 209 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") 211 212 212 213 protect_obj = ConfigProtect( -
trunk/essentials/sys-apps/prefix-portage/pym/portage/util.py
r3502 r3511 89 89 Returns a new dictlist.""" 90 90 new_dl = {} 91 for key in myDict .keys():91 for key in myDict: 92 92 new_dl[key] = [] 93 93 new_dl[key] = map(func,myDict[key]) … … 131 131 if mydict is None: 132 132 continue 133 for y in mydict .keys():133 for y in mydict: 134 134 if not y in final_dict: 135 135 final_dict[y] = [] … … 293 293 myfile.write(x+"\n") 294 294 else: 295 for x in mydict .keys():295 for x in mydict: 296 296 myfile.write("%s %s\n" % (x, " ".join(mydict[x]))) 297 297 myfile.close() -
trunk/essentials/sys-apps/prefix-portage/pym/portage/xpak.py
r3488 r3511 225 225 os.chdir(origdir) 226 226 227 class tbz2 :227 class tbz2(object): 228 228 def __init__(self,myfile): 229 229 self.file=myfile -
trunk/essentials/sys-apps/prefix-portage/src/Makefile.am
r3488 r3511 7 7 endif 8 8 9 if BUILD_MISSINGOS10 SUBDIRS += python-missingos11 endif12 13 9 tbz2tool_SOURCES = tbz2tool.c 14 10 -
trunk/essentials/sys-apps/prefix-portage/src/Makefile.in
r3488 r3511 36 36 bin_PROGRAMS = $(am__EXEEXT_1) 37 37 @BUILD_TBZ2TOOL_TRUE@am__append_1 = tbz2tool 38 @BUILD_MISSINGOS_TRUE@am__append_2 = python-missingos39 38 subdir = src 40 39 DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in … … 73 72 ETAGS = etags 74 73 CTAGS = ctags 75 DIST_SUBDIRS = python-missingos74 DIST_SUBDIRS = $(SUBDIRS) 76 75 DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST) 77 76 ACLOCAL = @ACLOCAL@ 78 ALLOCA = @ALLOCA@79 77 AMTAR = @AMTAR@ 80 78 ARCH = @ARCH@ … … 179 177 program_transform_name = @program_transform_name@ 180 178 psdir = @psdir@ 179 rootgid = @rootgid@ 181 180 rootuid = @rootuid@ 182 181 rootuser = @rootuser@ … … 192 191 top_builddir = @top_builddir@ 193 192 top_srcdir = @top_srcdir@ 194 wheelgid = @wheelgid@ 195 SUBDIRS = $(am__append_2) 193 SUBDIRS = 196 194 tbz2tool_SOURCES = tbz2tool.c 197 195 MAINTAINERCLEANFILES = Makefile.in -
trunk/essentials/sys-apps/prefix-portage/src/bsd-flags/setup.py
-
Property svn:executable
set to
*
-
Property svn:executable
set to
-
trunk/essentials/sys-apps/prefix-portage/svnlogmsg.awk
-
Property svn:executable
set to
*
-
Property svn:executable
set to
Note:
See TracChangeset
for help on using the changeset viewer.