Browse Source

localepurge-0.5.4-r2 added

Kolan Sh 3 months ago
parent
commit
50ef49a2d0

+ 1
- 0
app-admin/localepurge/Manifest View File

@@ -0,0 +1 @@
1
+DIST localepurge-0.5.4.tbz2 5038 SHA256 7aca13f6b44af74480c611c0dd63b6fe05c6084bfd3f08bfd347e7914af2ffaa SHA512 246acb8ef497a2f607ee8545c4d46fd5a1957189eb0b705bf6bcd1cd35ba5b48c7e090db480519c8e3a7427b5ad5a2c020b40232a8fbd0840f9677a6c7af600e WHIRLPOOL d1da9a6a4d5fca92e7353e6ed0e6b916b8529ad7f003a0af02b2403ceb33bdd71769b3bd1a3c37095167a0e8b3811a5b6774a089f96eedd76edb4ebf46a992d4

+ 20
- 0
app-admin/localepurge/files/localepurge-0.5.4-directorysum.patch View File

@@ -0,0 +1,20 @@
1
+--- a/localepurge
2
++++ b/localepurge
3
+@@ -198,7 +198,7 @@
4
+ 
5
+         if [ "$SHOWFREEDSPACE" = "enabled" ]; then
6
+            if test $SPACETMP -gt 0 ; then
7
+-               LOCALETOTAL=$SPACETMP
8
++               LOCALETOTAL=$(($LOCALETOTAL + $SPACETMP))
9
+                einfo "localepurge: Disk space freed in $LOCALEDIR: ${BOLD}"$SPACETMP"K${NORMAL}"
10
+            fi
11
+            SPACETMP=0
12
+@@ -230,7 +230,7 @@
13
+ 
14
+         if [ "$SHOWFREEDSPACE" = "enabled" ]; then
15
+            if test $SPACETMP -gt 0 ; then
16
+-               MANTOTAL=$SPACETMP
17
++               MANTOTAL=$(($MANTOTAL + $SPACETMP))
18
+                einfo "localepurge: Disk space freed in $MANPAGEDIR: ${BOLD}"$SPACETMP"K${NORMAL}"
19
+            fi
20
+            SPACETMP=0

+ 11
- 0
app-admin/localepurge/files/localepurge-0.5.4-evaltotal.patch View File

@@ -0,0 +1,11 @@
1
+--- a/localepurge
2
++++ b/localepurge
3
+@@ -254,7 +254,7 @@
4
+ 
5
+ # Calculating and reporting total disk space freed:
6
+ if [ "$SHOWFREEDSPACE" = "enabled" ]; then
7
+-    let TOTAL=$LOCALETOTAL+$MANTOTAL
8
++    TOTAL=$(($LOCALETOTAL+$MANTOTAL))
9
+     if test $TOTAL -lt 0; then
10
+         TOTAL=0
11
+     fi

+ 18
- 0
app-admin/localepurge/files/localepurge-0.5.4-parentdir.patch View File

@@ -0,0 +1,18 @@
1
+--- a/localepurge
2
++++ b/localepurge
3
+@@ -165,7 +165,14 @@
4
+     ${ACTION} `find ${REMOVEPATH} -type f -o -type l`
5
+ 
6
+     if [ "$SHOWFREEDSPACE" = "enabled" ]; then
7
+-        SPACEAFTER=$(df -P ${REMOVEPATH} | awk '{if ( NR==2 ) { print $3 }}')
8
++        # if symlink, REMOVEPATH could be removed
9
++        # check from parentdir then
10
++        if [ -d ${REMOVEPATH} ]; then
11
++            SPACEAFTER=$(df -P ${REMOVEPATH} | awk '{if ( NR==2 ) { print $3 }}')
12
++        else
13
++            SPACEAFTER=$(df -P ${REMOVEPATH%/*} | awk '{if ( NR==2 ) { print $3 }}')
14
++        fi
15
++
16
+         SPACESUM=$(($SPACEBEFORE - $SPACEAFTER))
17
+ 
18
+         if test $SPACESUM -gt 0 ; then

+ 58
- 0
app-admin/localepurge/files/localepurge-0.5.4-prefix.patch View File

@@ -0,0 +1,58 @@
1
+--- a/localepurge
2
++++ b/localepurge
3
+@@ -1,14 +1,14 @@
4
+-#!/bin/bash
5
++#!@GENTOO_PORTAGE_EPREFIX@/bin/bash
6
+ 
7
+ # Deleting all locale files on system
8
+ # *not* listed in /etc/locale.nopurge
9
+ 
10
+ set -e
11
+ 
12
+-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"
13
+-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"
14
+-LOCALELIST="/var/cache/localepurge/localelist"
15
+-CONFIGFILE="/etc/locale.nopurge"
16
++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"
17
++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"
18
++LOCALELIST="@GENTOO_PORTAGE_EPREFIX@/var/cache/localepurge/localelist"
19
++CONFIGFILE="@GENTOO_PORTAGE_EPREFIX@/etc/locale.nopurge"
20
+ VERSION="0.5.4"
21
+ 
22
+ LOCALETOTAL=0
23
+@@ -23,7 +23,7 @@
24
+ BRACKET=$'\e[34;01m'
25
+ BOLD=$'\e[1m'
26
+ 
27
+-ACTION="/bin/rm -vf"
28
++ACTION="@GENTOO_PORTAGE_EPREFIX@/bin/rm -vf"
29
+ 
30
+ eerror () {
31
+     echo -e " ${BAD}*${NORMAL} $*" 2> /dev/stderr
32
+@@ -43,7 +43,7 @@
33
+ print() {
34
+     for x in $@; do
35
+         if [ "${x}" = "" ]; then return 0
36
+-        else /bin/echo $x
37
++        else @GENTOO_PORTAGE_EPREFIX@/bin/echo $x
38
+         fi
39
+     done
40
+ }
41
+@@ -184,7 +184,7 @@
42
+             einfo "localepurge: processing locale files in ${LOCALEDIR} ..."
43
+         fi
44
+ 
45
+-        for LOCALE in `/bin/ls ${LOCALEDIR}`; do
46
++        for LOCALE in `@GENTOO_PORTAGE_EPREFIX@/bin/ls ${LOCALEDIR}`; do
47
+             if echo "${PURGELIST}" | grep -xq ${LOCALE}; then
48
+                 if [ -d ${LOCALEDIR}/${LOCALE}/LC_MESSAGES ]; then
49
+                     if [ "${LIST}" = "enabled" ]; then 
50
+@@ -216,7 +216,7 @@
51
+             einfo "localepurge: processing man pages in ${MANPAGEDIR} ..."
52
+         fi
53
+ 
54
+-        for LOCALE in `/bin/ls ${MANPAGEDIR} | grep -v ^man[1-9]`; do
55
++        for LOCALE in `@GENTOO_PORTAGE_EPREFIX@/bin/ls ${MANPAGEDIR} | grep -v ^man[1-9]`; do
56
+             if echo "${PURGELIST}" | grep -xq ${LOCALE}; then
57
+                 if [ -d ${MANPAGEDIR}/${LOCALE} ]; then
58
+                     if [ "${LIST}" = "enabled" ]; then

+ 43
- 0
app-admin/localepurge/localepurge-0.5.4-r2.ebuild View File

@@ -0,0 +1,43 @@
1
+# Copyright 1999-2018 Gentoo Foundation
2
+# Distributed under the terms of the GNU General Public License v2
3
+
4
+EAPI=6
5
+
6
+inherit prefix
7
+
8
+DESCRIPTION="Script to recover diskspace on unneeded locale files & localized man pages"
9
+HOMEPAGE="https://gentoo.org
10
+https://cgit.gentoo.org/proj/localepurge.git"
11
+SRC_URI="https://dev.gentoo.org/~hwoarang/distfiles/${P}.tbz2"
12
+
13
+LICENSE="GPL-2"
14
+SLOT="0"
15
+KEYWORDS="alpha amd64 arm hppa ia64 ~m68k ~mips ppc ppc64 s390 sh sparc x86 ~x86-fbsd ~amd64-linux ~x86-linux ~ppc-macos"
16
+IUSE=""
17
+
18
+DEPEND=""
19
+RDEPEND="app-shells/bash"
20
+
21
+S=${WORKDIR}/${PN}
22
+
23
+PATCHES=(
24
+	"${FILESDIR}"/${PN}-0.5.4-prefix.patch
25
+	"${FILESDIR}"/${PN}-0.5.4-directorysum.patch # 164544
26
+	"${FILESDIR}"/${PN}-0.5.4-parentdir.patch #445910
27
+	"${FILESDIR}"/${PN}-0.5.4-evaltotal.patch #452208
28
+)
29
+
30
+src_prepare() {
31
+	default
32
+	eprefixify ${PN}
33
+}
34
+
35
+src_install() {
36
+	insinto /var/cache/${PN}
37
+	doins defaultlist
38
+	dosym defaultlist /var/cache/${PN}/localelist
39
+	insinto /etc
40
+	doins locale.nopurge
41
+	dobin ${PN}
42
+	doman ${PN}.8
43
+}

Loading…
Cancel
Save