mgorny 15/01/07 22:53:29 Modified: systemrescuecd-x86-4.4.1.ebuild ChangeLog Log: Fix pkg_postrm() wrt Portage bug #535870. (Portage version: 2.2.15/cvs/Linux x86_64, signed Manifest commit with key EFB4464E!)
Revision Changes Path 1.2 app-admin/systemrescuecd-x86/systemrescuecd-x86-4.4.1.ebuild file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/systemrescuecd-x86/systemrescuecd-x86-4.4.1.ebuild?rev=1.2&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/systemrescuecd-x86/systemrescuecd-x86-4.4.1.ebuild?rev=1.2&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/systemrescuecd-x86/systemrescuecd-x86-4.4.1.ebuild?r1=1.1&r2=1.2 Index: systemrescuecd-x86-4.4.1.ebuild =================================================================== RCS file: /var/cvsroot/gentoo-x86/app-admin/systemrescuecd-x86/systemrescuecd-x86-4.4.1.ebuild,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- systemrescuecd-x86-4.4.1.ebuild 6 Jan 2015 23:57:06 -0000 1.1 +++ systemrescuecd-x86-4.4.1.ebuild 7 Jan 2015 22:53:29 -0000 1.2 @@ -1,6 +1,6 @@ # Copyright 1999-2015 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/systemrescuecd-x86/systemrescuecd-x86-4.4.1.ebuild,v 1.1 2015/01/06 23:57:06 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/systemrescuecd-x86/systemrescuecd-x86-4.4.1.ebuild,v 1.2 2015/01/07 22:53:29 mgorny Exp $ EAPI=5 @@ -25,23 +25,31 @@ pkg_postinst() { local f=${EROOT%/}/usr/share/${PN%-*}/${PN}-newest.iso - # no newer version? we're the newest! + # no version newer than ours? we're the newest! if ! has_version ">${CATEGORY}/${PF}"; then ln -f -s -v "${P}.iso" "${f}" || die fi } pkg_postrm() { - # TODO: best_version is probably broken in portage, figure it out local f=${EROOT%/}/usr/share/${PN%-*}/${PN}-newest.iso - local newest_version=$(best_version "${CATEGORY}/${PN}") - if [[ ${newest_version} != ${CATEGORY}/${PF} ]]; then - # we're not the newest? update the symlink. - ln -f -s -v "${newest_version%-r*}.iso" "${f}" || die - elif [[ ! ${newest_version} ]]; then - # last version removed? clean up the symlink. - rm -v "${f}" || die - # TODO: remove the empty directory + # if there is no version newer than ours installed + if ! has_version ">${CATEGORY}/${PF}"; then + # and we are truly and completely uninstalled... + if [[ ! ${REPLACED_BY_VERSION} ]]; then + # then find an older version to set the symlink to + local newest_version=$(best_version "<${CATEGORY}/${PF}") + + if [[ ${newest_version} ]]; then + # update the symlink + ln -f -s -v "${newest_version%-r*}.iso" "${f}" || die + else + # last version removed? clean up the symlink + rm -v "${f}" || die + # and the parent directory + rmdir "${f%/*}" || die + fi + fi fi } 1.2 app-admin/systemrescuecd-x86/ChangeLog file : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/systemrescuecd-x86/ChangeLog?rev=1.2&view=markup plain: http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/systemrescuecd-x86/ChangeLog?rev=1.2&content-type=text/plain diff : http://sources.gentoo.org/viewvc.cgi/gentoo-x86/app-admin/systemrescuecd-x86/ChangeLog?r1=1.1&r2=1.2 Index: ChangeLog =================================================================== RCS file: /var/cvsroot/gentoo-x86/app-admin/systemrescuecd-x86/ChangeLog,v retrieving revision 1.1 retrieving revision 1.2 diff -u -r1.1 -r1.2 --- ChangeLog 6 Jan 2015 23:57:06 -0000 1.1 +++ ChangeLog 7 Jan 2015 22:53:29 -0000 1.2 @@ -1,6 +1,9 @@ # ChangeLog for app-admin/systemrescuecd-x86 # Copyright 1999-2015 Gentoo Foundation; Distributed under the GPL v2 -# $Header: /var/cvsroot/gentoo-x86/app-admin/systemrescuecd-x86/ChangeLog,v 1.1 2015/01/06 23:57:06 mgorny Exp $ +# $Header: /var/cvsroot/gentoo-x86/app-admin/systemrescuecd-x86/ChangeLog,v 1.2 2015/01/07 22:53:29 mgorny Exp $ + + 07 Jan 2015; Michał Górny <[email protected]> systemrescuecd-x86-4.4.1.ebuild: + Fix pkg_postrm() wrt Portage bug #535870. *systemrescuecd-x86-4.4.1 (06 Jan 2015)
