sys-apps/portage: remove old upgrade code for bug 612246
authorZac Medico <zmedico@gentoo.org>
Sat, 11 Mar 2017 04:40:35 +0000 (20:40 -0800)
committerZac Medico <zmedico@gentoo.org>
Sat, 11 Mar 2017 04:41:24 +0000 (20:41 -0800)
Package-Manager: Portage-2.3.4, Repoman-2.3.2

sys-apps/portage/portage-2.3.3.ebuild
sys-apps/portage/portage-2.3.4.ebuild

index 07a28907270d4b4ca7ca73c95dcb76c5e9b9e105..f9f6966ad7e39224eae342eb37140344068bda29 100644 (file)
@@ -224,22 +224,6 @@ pkg_preinst() {
                chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
        fi
 
-       if has_version "<${CATEGORY}/${PN}-2.1.13" || \
-               {
-                       has_version ">=${CATEGORY}/${PN}-2.2_rc0" && \
-                       has_version "<${CATEGORY}/${PN}-2.2.0_alpha189"
-               } ; then
-               USERPRIV_UPGRADE=true
-               USERSYNC_UPGRADE=true
-               REPOS_CONF_UPGRADE=true
-               REPOS_CONF_SYNC=
-               type -P portageq >/dev/null 2>&1 && \
-                       REPOS_CONF_SYNC=$("$(type -P portageq)" envvar SYNC)
-       else
-               USERPRIV_UPGRADE=false
-               USERSYNC_UPGRADE=false
-               REPOS_CONF_UPGRADE=false
-       fi
        if has_version ">=${CATEGORY}/${PN}-2.3.1" && \
                has_version "<${CATEGORY}/${PN}-2.3.3"; then
                SYNC_DEPTH_UPGRADE=true
@@ -279,93 +263,6 @@ new_config_protect() {
 }
 
 pkg_postinst() {
-
-       if ${REPOS_CONF_UPGRADE} ; then
-               einfo "Generating repos.conf"
-               local repo_name=
-               [[ -f ${PORTDIR}/profiles/repo_name ]] && \
-                       repo_name=$(< "${PORTDIR}/profiles/repo_name")
-               if [[ -z ${REPOS_CONF_SYNC} ]] ; then
-                       REPOS_CONF_SYNC=$(grep "^sync-uri =" "${EROOT:-${ROOT}}usr/share/portage/config/repos.conf")
-                       REPOS_CONF_SYNC=${REPOS_CONF_SYNC##* }
-               fi
-               local sync_type=
-               [[ ${REPOS_CONF_SYNC} == git://* ]] && sync_type=git
-
-               if [[ ${REPOS_CONF_SYNC} == cvs://* ]]; then
-                       sync_type=cvs
-                       REPOS_CONF_SYNC=${REPOS_CONF_SYNC#cvs://}
-               fi
-
-               cat <<-EOF > "${T}/repos.conf"
-               [DEFAULT]
-               main-repo = ${repo_name:-gentoo}
-
-               [${repo_name:-gentoo}]
-               location = ${PORTDIR:-${EPREFIX}/usr/portage}
-               sync-type = ${sync_type:-rsync}
-               sync-uri = ${REPOS_CONF_SYNC}
-               EOF
-
-               [[ ${sync_type} == cvs ]] && echo "sync-cvs-repo = $(<"${PORTDIR}/CVS/Repository")" >> "${T}/repos.conf"
-
-               local dest=${EROOT:-${ROOT}}etc/portage/repos.conf
-               if [[ ! -f ${dest} ]] && mkdir -p "${dest}" 2>/dev/null ; then
-                       dest=${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf
-               fi
-               # Don't install the config update if the desired repos.conf directory
-               # and config file exist, since users may accept it blindly and break
-               # their config (bug #478726).
-               [[ -e ${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf ]] || \
-                       mv "${T}/repos.conf" "$(new_config_protect "${dest}")"
-
-               if [[ ${PORTDIR} == ${EPREFIX}/usr/portage ]] ; then
-                       einfo "Generating make.conf PORTDIR setting for backward compatibility"
-                       for dest in "${EROOT:-${ROOT}}etc/make.conf" "${EROOT:-${ROOT}}etc/portage/make.conf" ; do
-                               [[ -e ${dest} ]] && break
-                       done
-                       [[ -d ${dest} ]] && dest=${dest}/portdir.conf
-                       rm -rf "${T}/make.conf"
-                       [[ -f ${dest} ]] && cat "${dest}" > "${T}/make.conf"
-                       cat <<-EOF >> "${T}/make.conf"
-
-                       # Set PORTDIR for backward compatibility with various tools:
-                       #   gentoo-bashcomp - bug #478444
-                       #   euse - bug #474574
-                       #   euses and ufed - bug #478318
-                       PORTDIR="${EPREFIX}/usr/portage"
-                       EOF
-                       mkdir -p "${dest%/*}"
-                       mv "${T}/make.conf" "$(new_config_protect "${dest}")"
-               fi
-       fi
-
-       local distdir=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}
-
-       if ${USERSYNC_UPGRADE} && \
-               [[ -d ${PORTDIR} && -w ${PORTDIR} ]] ; then
-               local ownership=$(get_ownership "${PORTDIR}")
-               if [[ -n ${ownership} ]] ; then
-                       einfo "Adjusting PORTDIR permissions for usersync"
-                       find "${PORTDIR}" -path "${distdir%/}" -prune -o \
-                               ! \( -user "${ownership%:*}" -a -group "${ownership#*:}" \) \
-                               -exec chown "${ownership}" {} +
-               fi
-       fi
-
-       # Do this last, since it could take a long time if there
-       # are lots of live sources, and the user may be tempted
-       # to kill emerge while it is running.
-       if ${USERPRIV_UPGRADE} && \
-               [[ -d ${distdir} && -w ${distdir} ]] ; then
-               local ownership=$(get_ownership "${distdir}")
-               if [[ ${ownership#*:} == portage ]] ; then
-                       einfo "Adjusting DISTDIR permissions for userpriv"
-                       find "${distdir}" -mindepth 1 -maxdepth 1 -type d -uid 0 \
-                               -exec chown -R portage:portage {} +
-               fi
-       fi
-
        if ${SYNC_DEPTH_UPGRADE}; then
                ewarn "Please note that this release no longer respects sync-depth for"
                ewarn "git repositories.  There have been too many problems and"
index cc0c18ef3de16f5dcc308353cd728b9c91a29d91..8611b2060ec90c2b52c1acc781dc77f3dd3714ee 100644 (file)
@@ -224,22 +224,6 @@ pkg_preinst() {
                chmod g+s,ug+rwx "${ED}"var/log/portage{,/elog}
        fi
 
-       if has_version "<${CATEGORY}/${PN}-2.1.13" || \
-               {
-                       has_version ">=${CATEGORY}/${PN}-2.2_rc0" && \
-                       has_version "<${CATEGORY}/${PN}-2.2.0_alpha189"
-               } ; then
-               USERPRIV_UPGRADE=true
-               USERSYNC_UPGRADE=true
-               REPOS_CONF_UPGRADE=true
-               REPOS_CONF_SYNC=
-               type -P portageq >/dev/null 2>&1 && \
-                       REPOS_CONF_SYNC=$("$(type -P portageq)" envvar SYNC)
-       else
-               USERPRIV_UPGRADE=false
-               USERSYNC_UPGRADE=false
-               REPOS_CONF_UPGRADE=false
-       fi
        if has_version ">=${CATEGORY}/${PN}-2.3.1" && \
                has_version "<${CATEGORY}/${PN}-2.3.3"; then
                SYNC_DEPTH_UPGRADE=true
@@ -279,93 +263,6 @@ new_config_protect() {
 }
 
 pkg_postinst() {
-
-       if ${REPOS_CONF_UPGRADE} ; then
-               einfo "Generating repos.conf"
-               local repo_name=
-               [[ -f ${PORTDIR}/profiles/repo_name ]] && \
-                       repo_name=$(< "${PORTDIR}/profiles/repo_name")
-               if [[ -z ${REPOS_CONF_SYNC} ]] ; then
-                       REPOS_CONF_SYNC=$(grep "^sync-uri =" "${EROOT:-${ROOT}}usr/share/portage/config/repos.conf")
-                       REPOS_CONF_SYNC=${REPOS_CONF_SYNC##* }
-               fi
-               local sync_type=
-               [[ ${REPOS_CONF_SYNC} == git://* ]] && sync_type=git
-
-               if [[ ${REPOS_CONF_SYNC} == cvs://* ]]; then
-                       sync_type=cvs
-                       REPOS_CONF_SYNC=${REPOS_CONF_SYNC#cvs://}
-               fi
-
-               cat <<-EOF > "${T}/repos.conf"
-               [DEFAULT]
-               main-repo = ${repo_name:-gentoo}
-
-               [${repo_name:-gentoo}]
-               location = ${PORTDIR:-${EPREFIX}/usr/portage}
-               sync-type = ${sync_type:-rsync}
-               sync-uri = ${REPOS_CONF_SYNC}
-               EOF
-
-               [[ ${sync_type} == cvs ]] && echo "sync-cvs-repo = $(<"${PORTDIR}/CVS/Repository")" >> "${T}/repos.conf"
-
-               local dest=${EROOT:-${ROOT}}etc/portage/repos.conf
-               if [[ ! -f ${dest} ]] && mkdir -p "${dest}" 2>/dev/null ; then
-                       dest=${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf
-               fi
-               # Don't install the config update if the desired repos.conf directory
-               # and config file exist, since users may accept it blindly and break
-               # their config (bug #478726).
-               [[ -e ${EROOT:-${ROOT}}etc/portage/repos.conf/${repo_name:-gentoo}.conf ]] || \
-                       mv "${T}/repos.conf" "$(new_config_protect "${dest}")"
-
-               if [[ ${PORTDIR} == ${EPREFIX}/usr/portage ]] ; then
-                       einfo "Generating make.conf PORTDIR setting for backward compatibility"
-                       for dest in "${EROOT:-${ROOT}}etc/make.conf" "${EROOT:-${ROOT}}etc/portage/make.conf" ; do
-                               [[ -e ${dest} ]] && break
-                       done
-                       [[ -d ${dest} ]] && dest=${dest}/portdir.conf
-                       rm -rf "${T}/make.conf"
-                       [[ -f ${dest} ]] && cat "${dest}" > "${T}/make.conf"
-                       cat <<-EOF >> "${T}/make.conf"
-
-                       # Set PORTDIR for backward compatibility with various tools:
-                       #   gentoo-bashcomp - bug #478444
-                       #   euse - bug #474574
-                       #   euses and ufed - bug #478318
-                       PORTDIR="${EPREFIX}/usr/portage"
-                       EOF
-                       mkdir -p "${dest%/*}"
-                       mv "${T}/make.conf" "$(new_config_protect "${dest}")"
-               fi
-       fi
-
-       local distdir=${PORTAGE_ACTUAL_DISTDIR-${DISTDIR}}
-
-       if ${USERSYNC_UPGRADE} && \
-               [[ -d ${PORTDIR} && -w ${PORTDIR} ]] ; then
-               local ownership=$(get_ownership "${PORTDIR}")
-               if [[ -n ${ownership} ]] ; then
-                       einfo "Adjusting PORTDIR permissions for usersync"
-                       find "${PORTDIR}" -path "${distdir%/}" -prune -o \
-                               ! \( -user "${ownership%:*}" -a -group "${ownership#*:}" \) \
-                               -exec chown "${ownership}" {} +
-               fi
-       fi
-
-       # Do this last, since it could take a long time if there
-       # are lots of live sources, and the user may be tempted
-       # to kill emerge while it is running.
-       if ${USERPRIV_UPGRADE} && \
-               [[ -d ${distdir} && -w ${distdir} ]] ; then
-               local ownership=$(get_ownership "${distdir}")
-               if [[ ${ownership#*:} == portage ]] ; then
-                       einfo "Adjusting DISTDIR permissions for userpriv"
-                       find "${distdir}" -mindepth 1 -maxdepth 1 -type d -uid 0 \
-                               -exec chown -R portage:portage {} +
-               fi
-       fi
-
        if ${SYNC_DEPTH_UPGRADE}; then
                ewarn "Please note that this release no longer respects sync-depth for"
                ewarn "git repositories.  There have been too many problems and"