From 58bce1e0e98679c139d1892a5952a05ad74c1f05 Mon Sep 17 00:00:00 2001 From: Arfrever Frehtes Taifersar Arahesis Date: Mon, 26 Dec 2011 02:59:28 +0000 Subject: Add support for PYTHON_UPDATER_IGNORE. --- python-updater | 52 +++++++++++++++++++++++----------------------------- 1 file changed, 23 insertions(+), 29 deletions(-) (limited to 'python-updater') diff --git a/python-updater b/python-updater index c8bc79d..f53727e 100755 --- a/python-updater +++ b/python-updater @@ -659,13 +659,14 @@ fi for contents_file in $(find ${PKG_DBDIR}/ -name CONTENTS | sort); do environment_file="${contents_file%CONTENTS}environment.bz2" - # Extract some variables. EAPI, PYTHON_MULTIPLE_ABIS/SUPPORT_PYTHON_ABIS, PYTHON_ABIS and PYTHON_REQUESTED_ACTIVE_VERSION are optional. + # Extract some variables. PVR is required. get_vdb_variable PVR "${environment_file}" || die "Missing metadata in '${environment_file}' file. Manually reinstall corresponding package." get_vdb_variable EAPI "${environment_file}" get_vdb_variable PYTHON_MULTIPLE_ABIS "${environment_file}" get_vdb_variable SUPPORT_PYTHON_ABIS "${environment_file}" get_vdb_variable PYTHON_ABIS "${environment_file}" get_vdb_variable PYTHON_REQUESTED_ACTIVE_VERSION "${environment_file}" + get_vdb_variable PYTHON_UPDATER_IGNORE "${environment_file}" # Manually calculate CATEGORY, PF, PN and SLOT to avoid problems with moved packages. CATEGORY="$(echo "${environment_file#${PKG_DBDIR}/}" | sed -e "s:/.*::")" @@ -678,40 +679,33 @@ for contents_file in $(find ${PKG_DBDIR}/ -name CONTENTS | sort); do fi CATPKG="${CATEGORY}/${PN}" - CATPKGVER="${CATEGORY}/${PF}" - veinfo 2 "Checking ${CATEGORY}/${PF}${SLOT:+:}${SLOT}" - - # Exclude packages that are exceptions, like Portage and Python itself. - exception=0 - for exp in ${PKGS_EXCEPTIONS}; do - if [[ -z "${CATPKG##${exp}}" ]]; then - veinfo 2 "Skipping ${CATPKG}, reason: exception" - exception=1 - break; - fi - done + # Use exact version when --reinstall-identical-versions option is used or SLOT file does not exist. + if [[ "${REINSTALL_IDENTICAL_VERSIONS}" -eq "0" && -n "${SLOT}" ]]; then + CATPKGVER="${CATPKG}:${SLOT}" + else + CATPKGVER="=${CATEGORY}/${PF}" + fi - [[ ${exception} == 1 ]] && continue + veinfo 2 "Checking ${CATEGORY}/${PF}${SLOT:+:}${SLOT}" - # Check if package is in PKGS_MANUAL - if [[ CHECK_MANUAL -ne 0 ]]; then - for pkg in ${PKGS_MANUAL}; do - if [[ -z "${CATPKG##${pkg}}" ]]; then - exception=2 - break; - fi - done + # Exclude packages, which are exceptions, like Portage and Python itself. + if has "${CATPKG}" ${PKGS_EXCEPTIONS}; then + eindent + veinfo 2 "Skipping ${CATPKGVER}, reason: exception" + eoutdent + continue fi - # Replace SLOT by version number when REINSTALL_IDENTICAL_VERSIONS == 1 - # Reinstall identical versions when SLOT doesn't exist, bug #201848 - if [[ REINSTALL_IDENTICAL_VERSIONS -eq 1 || -z "${SLOT}" ]]; then - CATPKGVER="=${CATPKGVER}" - else - CATPKGVER="${CATPKG}:${SLOT}" + # Exclude packages, which set PYTHON_UPDATER_IGNORE variable. + if [[ -n "${PYTHON_UPDATER_IGNORE}" ]]; then + eindent + veinfo 2 "Skipping ${CATPKGVER}, reason: PYTHON_UPDATER_IGNORE" + eoutdent + continue fi - if [[ ${exception} = 2 ]]; then + # Check if package is in PKGS_MANUAL. + if [[ CHECK_MANUAL -ne 0 ]] && has "${CATPKG}" ${PKGS_MANUAL}; then PKGS_TO_REMERGE+=" ${CATPKGVER}" eindent einfo "Adding to list: ${CATPKGVER}" -- cgit v1.2.3-65-gdbad