localepurge-0.5.4-r2 with nonzero status fix

This commit is contained in:
Kolan Sh 2013-01-14 19:47:08 +04:00
parent 7d8f2e070d
commit a5d0d8e226
6 changed files with 156 additions and 0 deletions

View File

@ -0,0 +1,6 @@
AUX localepurge-0.5.4-directorysum.patch 799 SHA256 5b0ef49c52debca8a66a79087902b3beeafa91116d5e4eca5f87a4db54380593 SHA512 a7ccb8b1a6963e45ebde2ff72c0612eeaae62cd248b8b5c675d0e0d5d0c91d7d5db34edc6e09ceebab83016f62e233a62a71562537d5dc2ead20274f1bfead2b WHIRLPOOL 5939fbb8f623099f3c912e2fa9bfe698b4de217722286d7e9eb1cce729756c9510e7db400a3545fb5206ec1f7d95f98bb17154e41964aff8583d376c00532f13
AUX localepurge-0.5.4-nonzero.patch 366 SHA256 ee62901830d0c370be31279674b174151cfd23cdb7ffbdd7bd67f521b2548aec SHA512 81c10dae3222fee74ab814966745fcf6793aee4601ce3686d19c3ad6a602edb237fe877c94462cdfc5abfd71ce53cfa2fd439c453f38f98335147b1134cc843d WHIRLPOOL 4f76e43a98261a27d548062754104670e9a6980c5378346f9aef7a10d8c4ff5b7011ff6057c97cc7c177bb4b3e77eca533772dc14bccb2d26dac5b6944377444
AUX localepurge-0.5.4-parentdir.patch 730 SHA256 6c3418108a8e34202fe72ad03a673c088bda49667556ca374b98f6549cd0e592 SHA512 f46501a92fb37645c49d7ed50265cb739b7f0ca0f88be0586aae25f4672caf097ce60d6808c545b2dda31e295e596f58fba501f4470b7ea96c8fe11a1de0f0cb WHIRLPOOL 2bd35c43308b63d85b5a651220b813c0d9579621398b68f5fe8ef298658f132b6f3e49e3346d0c23d42e31378f403a525b7a9d76091ee44283b47a56f1c1e37d
AUX localepurge-0.5.4-prefix.patch 2872 SHA256 ebc8a9ed23e968edc182777c7e32a86169550b81dc13b6d78f5ebe919ce1f1ad SHA512 994050265349b6fd91d6759368250a25122d207ec3356dc5d7902a4d897012dadf2fead83d7aa36f98191ed309ce0019d8f21a445c7d56139355a9bd471e1ad6 WHIRLPOOL 0320e8dede7929b4db8cfc340aba8d96f69eee6e38d9c8b99b4ad10d34b5b5b0c973536e12cd79948179482c909fc04b1826ec517b35fc26bccd5251d0de8eda
DIST localepurge-0.5.4.tbz2 5038 SHA256 7aca13f6b44af74480c611c0dd63b6fe05c6084bfd3f08bfd347e7914af2ffaa SHA512 246acb8ef497a2f607ee8545c4d46fd5a1957189eb0b705bf6bcd1cd35ba5b48c7e090db480519c8e3a7427b5ad5a2c020b40232a8fbd0840f9677a6c7af600e WHIRLPOOL d1da9a6a4d5fca92e7353e6ed0e6b916b8529ad7f003a0af02b2403ceb33bdd71769b3bd1a3c37095167a0e8b3811a5b6774a089f96eedd76edb4ebf46a992d4
EBUILD localepurge-0.5.4-r2.ebuild 1182 SHA256 a1aa19a7914a4599e9ed525e04c2a395541cf67dbdbc1de911dbdb201d0cba0a SHA512 b99571ab86654ee1b2e31227d1bd0872a192f37f3e1d3bea971889c465aa9bfebe44f82dfdbef86d6c97ee9ffe5fb9687c41aa13a9f57f3c4616595d3543e796 WHIRLPOOL e362bb8add65997c4346ab22c94a86cb2d8bddfa275f960a61ad0bfd15a7c609fae632ae2c206989c1c8a0f77ababef648fb1fc993f5949dcbd470fbb71296e4

View File

@ -0,0 +1,20 @@
--- localepurge.orig 2012-12-04 23:15:29.422756767 +0100
+++ localepurge 2012-12-04 23:16:13.313756491 +0100
@@ -198,7 +198,7 @@
if [ "$SHOWFREEDSPACE" = "enabled" ]; then
if test $SPACETMP -gt 0 ; then
- LOCALETOTAL=$SPACETMP
+ LOCALETOTAL=$(($LOCALETOTAL + $SPACETMP))
einfo "localepurge: Disk space freed in $LOCALEDIR: ${BOLD}"$SPACETMP"K${NORMAL}"
fi
SPACETMP=0
@@ -230,7 +230,7 @@
if [ "$SHOWFREEDSPACE" = "enabled" ]; then
if test $SPACETMP -gt 0 ; then
- MANTOTAL=$SPACETMP
+ MANTOTAL=$(($MANTOTAL + $SPACETMP))
einfo "localepurge: Disk space freed in $MANPAGEDIR: ${BOLD}"$SPACETMP"K${NORMAL}"
fi
SPACETMP=0

View File

@ -0,0 +1,11 @@
--- localepurge.original 2012-12-02 18:32:35.000000000 +0400
+++ localepurge 2013-01-14 19:31:35.327821252 +0400
@@ -254,7 +254,7 @@
# Calculating and reporting total disk space freed:
if [ "$SHOWFREEDSPACE" = "enabled" ]; then
- let TOTAL=$LOCALETOTAL+$MANTOTAL
+ TOTAL=$(($LOCALETOTAL+$MANTOTAL))
if test $TOTAL -lt 0; then
TOTAL=0
fi

View File

@ -0,0 +1,18 @@
--- localepurge.orig 2012-12-04 23:08:17.754765708 +0100
+++ localepurge 2012-12-04 23:09:02.397765264 +0100
@@ -165,7 +165,14 @@
${ACTION} `find ${REMOVEPATH} -type f -o -type l`
if [ "$SHOWFREEDSPACE" = "enabled" ]; then
- SPACEAFTER=$(df -P ${REMOVEPATH} | awk '{if ( NR==2 ) { print $3 }}')
+ # if symlink, REMOVEPATH could be removed
+ # check from parentdir then
+ if [ -d ${REMOVEPATH} ]; then
+ SPACEAFTER=$(df -P ${REMOVEPATH} | awk '{if ( NR==2 ) { print $3 }}')
+ else
+ SPACEAFTER=$(df -P ${REMOVEPATH%/*} | awk '{if ( NR==2 ) { print $3 }}')
+ fi
+
SPACESUM=$(($SPACEBEFORE - $SPACEAFTER))
if test $SPACESUM -gt 0 ; then

View File

@ -0,0 +1,58 @@
--- localepurge.orig 2012-12-02 19:56:18.000000000 +0100
+++ localepurge 2012-12-02 20:00:38.000000000 +0100
@@ -1,14 +1,14 @@
-#!/bin/bash
+#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
# Deleting all locale files on system
# *not* listed in /etc/locale.nopurge
set -e
-LOCALEDIRS="/usr/share/locale /usr/local/share/locale /usr/kde/?.?/share/locale /opt/sun-jdk-*/jre/lib/locale /opt/sun-jre-bin-*/lib/locale /usr/lib/locale /usr/share/binutils-data/*/*/locale /usr/share/gcc-data/*/*/locale"
-MANPAGEDIRS="/usr/share/man /usr/man /usr/local/share/man /usr/kde/?.?/share/man /usr/kde/?.?/man /opt/sun-jdk-*/man /opt/sun-jre-bin-*/man"
-LOCALELIST="/var/cache/localepurge/localelist"
-CONFIGFILE="/etc/locale.nopurge"
+LOCALEDIRS="@GENTOO_PORTAGE_EPREFIX@/usr/share/locale @GENTOO_PORTAGE_EPREFIX@/usr/local/share/locale @GENTOO_PORTAGE_EPREFIX@/usr/kde/?.?/share/locale @GENTOO_PORTAGE_EPREFIX@/opt/sun-jdk-*/jre/lib/locale @GENTOO_PORTAGE_EPREFIX@/opt/sun-jre-bin-*/lib/locale @GENTOO_PORTAGE_EPREFIX@/usr/lib/locale @GENTOO_PORTAGE_EPREFIX@/usr/share/binutils-data/*/*/locale @GENTOO_PORTAGE_EPREFIX@/usr/share/gcc-data/*/*/locale"
+MANPAGEDIRS="@GENTOO_PORTAGE_EPREFIX@/usr/share/man @GENTOO_PORTAGE_EPREFIX@/usr/man @GENTOO_PORTAGE_EPREFIX@/usr/local/share/man @GENTOO_PORTAGE_EPREFIX@/usr/kde/?.?/share/man @GENTOO_PORTAGE_EPREFIX@/usr/kde/?.?/man @GENTOO_PORTAGE_EPREFIX@/opt/sun-jdk-*/man @GENTOO_PORTAGE_EPREFIX@/opt/sun-jre-bin-*/man"
+LOCALELIST="@GENTOO_PORTAGE_EPREFIX@/var/cache/localepurge/localelist"
+CONFIGFILE="@GENTOO_PORTAGE_EPREFIX@/etc/locale.nopurge"
VERSION="0.5.4"
LOCALETOTAL=0
@@ -23,7 +23,7 @@
BRACKET=$'\e[34;01m'
BOLD=$'\e[1m'
-ACTION="/bin/rm -vf"
+ACTION="@GENTOO_PORTAGE_EPREFIX@/bin/rm -vf"
eerror () {
echo -e " ${BAD}*${NORMAL} $*" 2> /dev/stderr
@@ -43,7 +43,7 @@
print() {
for x in $@; do
if [ "${x}" = "" ]; then return 0
- else /bin/echo $x
+ else @GENTOO_PORTAGE_EPREFIX@/bin/echo $x
fi
done
}
@@ -184,7 +184,7 @@
einfo "localepurge: processing locale files in ${LOCALEDIR} ..."
fi
- for LOCALE in `/bin/ls ${LOCALEDIR}`; do
+ for LOCALE in `@GENTOO_PORTAGE_EPREFIX@/bin/ls ${LOCALEDIR}`; do
if echo "${PURGELIST}" | grep -xq ${LOCALE}; then
if [ -d ${LOCALEDIR}/${LOCALE}/LC_MESSAGES ]; then
if [ "${LIST}" = "enabled" ]; then
@@ -216,7 +216,7 @@
einfo "localepurge: processing man pages in ${MANPAGEDIR} ..."
fi
- for LOCALE in `/bin/ls ${MANPAGEDIR} | grep -v ^man[1-9]`; do
+ for LOCALE in `@GENTOO_PORTAGE_EPREFIX@/bin/ls ${MANPAGEDIR} | grep -v ^man[1-9]`; do
if echo "${PURGELIST}" | grep -xq ${LOCALE}; then
if [ -d ${MANPAGEDIR}/${LOCALE} ]; then
if [ "${LIST}" = "enabled" ]; then

View File

@ -0,0 +1,43 @@
# Copyright 1999-2013 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
# $Header: /var/cvsroot/gentoo-x86/app-admin/localepurge/localepurge-0.5.4-r1.ebuild,v 1.6 2013/01/13 17:53:05 maekke Exp $
EAPI=4
inherit eutils prefix
DESCRIPTION="Script to recover diskspace wasted for unneeded locale files and localized man pages."
HOMEPAGE="http://gentoo.org
http://git.overlays.gentoo.org/gitweb/?p=proj/localepurge.git;a=summary"
SRC_URI="http://dev.gentoo.org/~hwoarang/distfiles/${P}.tbz2"
LICENSE="GPL-2"
SLOT="0"
KEYWORDS="~alpha amd64 arm hppa ~ia64 ~m68k ~mips ppc ppc64 ~s390 ~sh ~sparc x86 ~x86-fbsd ~x86-freebsd ~x86-interix ~amd64-linux ~x86-linux ~ppc-macos"
IUSE=""
DEPEND=""
RDEPEND="app-shells/bash"
S=${WORKDIR}/${PN}
src_prepare() {
epatch "${FILESDIR}"/${P}-prefix.patch
# 164544
epatch "${FILESDIR}"/${P}-directorysum.patch
# 445910
epatch "${FILESDIR}"/${P}-parentdir.patch
# 451062
epatch "${FILESDIR}"/${P}-nonzero.patch
eprefixify ${PN}
}
src_install() {
insinto /var/cache/${PN}
doins defaultlist
dosym defaultlist /var/cache/${PN}/localelist
insinto /etc
doins locale.nopurge
dobin ${PN}
doman ${PN}.8
}