Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 92021 Details for
Bug 140822
regex config and pretend in app-admin/localepurge
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
diff file to add pretend and regex configuration
localepurge.patch (text/plain), 6.45 KB, created by
Rick Morra
on 2006-07-17 13:12:34 UTC
(
hide
)
Description:
diff file to add pretend and regex configuration
Filename:
MIME Type:
Creator:
Rick Morra
Created:
2006-07-17 13:12:34 UTC
Size:
6.45 KB
patch
obsolete
>--- localepurge-0.5.1 2006-07-15 12:27:37.000000000 -0400 >+++ localepurge-new 2006-07-17 12:43:14.000000000 -0400 >@@ -8,6 +8,7 @@ > 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" > 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" > VERSION="0.5" > > LOCALETOTAL=0 >@@ -40,7 +41,7 @@ > echo "${HILITE}localepurge${NORMAL} for ${BOLD}Gentoo Linux${NORMAL} ${BRACKET}[${NORMAL} ${GOOD}${VERSION}${NORMAL} ${BRACKET}]${NORMAL}" > echo -e " " "by bass@gentoo.org" > echo >- einfo "Remember that you must edit /etc/locale.nopurge" >+ einfo "Remember that you must edit ${CONFIGFILE}" > echo > einfo "Usage: `basename $0` [options]" > echo >@@ -56,9 +57,12 @@ > einfo "${BRACKET}[${NORMAL} ${GOOD}${VERSION}${NORMAL} ${BRACKET}]${NORMAL}" > } > >-if [ "`grep -x ^SHOWFREEDSPACE /etc/locale.nopurge`" ]; then >- SHOWFREEDSPACE=enabled >-fi >+# Check options in CONFIGFILE >+ >+grep -xq SHOWFREEDSPACE ${CONFIGFILE} && SHOWFREEDSPACE=enabled >+grep -xq VERBOSE ${CONFIGFILE} && VERBOSE=enabled >+grep -xq NOCOLOR ${CONFIGFILE} && >+ unset GOOD WARN BAD NORMAL HILITE BRACKET BOLD > > # We need to loop through for no color first, otherwise options that exit > # will make us ignore nocolor, so we might as well loop for debug first as well >@@ -69,7 +73,7 @@ > set -x > fi > >- if [ "`grep -x ^NOCOLOR /etc/locale.nopurge`" ] || [ "$x" = "-nocolor" ] || [ "$x" = "-nc" ]; then >+ if [ "$x" = "-nocolor" ] || [ "$x" = "-nc" ]; then > unset GOOD WARN BAD NORMAL HILITE BRACKET BOLD > fi > >@@ -80,7 +84,7 @@ > for x in $@ > do > >- if [ "`grep -x ^VERBOSE /etc/locale.nopurge`" ] || [ "$x" = "-verbose" ] || [ "$x" = "-v" ]; then >+ if [ "$x" = "-verbose" ] || [ "$x" = "-v" ]; then > VERBOSE=enabled > fi > >@@ -89,6 +93,10 @@ > exit 0 > fi > >+ if [ "$x" = "-p" ] || [ "$x" = "-pretend" ]; then >+ PRETEND=enabled >+ fi >+ > if [ "$x" = "-help" ] || [ "$x" = "-h" ]; then > ayuda > exit 0 >@@ -98,15 +106,15 @@ > > # Do nothing and report why if no valid configuration file exists: > >-if [ ! -f /etc/locale.nopurge ] >+if [ ! -f ${CONFIGFILE} ] > then >- eerror " No /etc/locale.nopurge file present, exiting ..." >+ eerror " No ${CONFIGFILE} file present, exiting ..." > exit 0 > else >- if [ "`grep -x ^NEEDSCONFIGFIRST /etc/locale.nopurge`" ] >+ if [ "`grep -x ^NEEDSCONFIGFIRST ${CONFIGFILE}`" ] > then > echo "" >- einfo " You have to configure \"/etc/locale.nopurge\" " >+ einfo " You have to configure \"${CONFIGFILE}\" " > echo "" > einfo " to make $0 actually start to function." > echo "" >@@ -116,6 +124,10 @@ > fi > fi > >+# Prune the locale list using CONFIGFILE as a list of regex patterns: >+ >+PURGELIST=`grep -xvf ${CONFIGFILE} "${LOCALELIST}"` >+ > # Getting rid of superfluous locale files in $LOCALEDIR: > > purgelocale () { >@@ -130,20 +142,26 @@ > einfo "localepurge: processing locale files in ${LOCALEDIR} ..." > for LOCALE in `/bin/ls ${LOCALEDIR}` > do >- if [ ! "`grep -x ^${LOCALE} /etc/locale.nopurge`" ] && \ >- [ "`grep -x ^${LOCALE} ${LOCALELIST}`" ]; then >+ if echo "${PURGELIST}" | grep -xq ${LOCALE}; then > if [ -d ${LOCALEDIR}/${LOCALE}/LC_MESSAGES ]; then >- /bin/rm -vf `find ${LOCALEDIR}/${LOCALE} -type f` >+ if [ "${PRETEND}" = "enabled" ]; then >+ echo "${LOCALEDIR}/${LOCALE}" >+ else >+ /bin/rm -vf `find ${LOCALEDIR}/${LOCALE} -type f` >+ fi > fi > fi > done > else > for LOCALE in `/bin/ls ${LOCALEDIR}` > do >- if [ ! "`grep -x ^${LOCALE} /etc/locale.nopurge`" ] && \ >- [ "`grep -x ^${LOCALE} ${LOCALELIST}`" ]; then >+ if echo "${PURGELIST}" | grep -xq ${LOCALE}; then > if [ -d ${LOCALEDIR}/${LOCALE}/LC_MESSAGES ]; then >- /bin/rm -f `find ${LOCALEDIR}/${LOCALE} -type f` >+ if [ "${PRETEND}" = "enabled" ]; then >+ echo "${LOCALEDIR}/${LOCALE}" >+ else >+ /bin/rm -vf `find ${LOCALEDIR}/${LOCALE} -type f` >+ fi > fi > fi > done >@@ -164,7 +182,7 @@ > > purgeman () { > local MANPAGEDIR="$1" >-if [ -d $MANPAGEDIR ] && [ "`grep -x ^MANDELETE /etc/locale.nopurge`" ]; then >+if [ -d $MANPAGEDIR ] && [ "`grep -x ^MANDELETE ${CONFIGFILE}`" ]; then > > if [ "$SHOWFREEDSPACE" = "enabled" ]; then > MANBEFORE=$(df -P $MANPAGEDIR | awk '{if ( NR==2 ) { print $3 }}') >@@ -174,20 +192,26 @@ > einfo "localepurge: processing man pages in ${MANPAGEDIR} ..." > for LOCALE in `/bin/ls ${MANPAGEDIR} | grep -v ^man[1-9]` > do >- if [ ! "`grep -x ^${LOCALE} /etc/locale.nopurge`" ] && \ >- [ "`grep -x ^${LOCALE} ${LOCALELIST}`" ]; then >+ if echo "${PURGELIST}" | grep -xq ${LOCALE}; then > if [ -d ${MANPAGEDIR}/${LOCALE} ]; then >- /bin/rm -vf `find ${MANPAGEDIR}/${LOCALE} -type f` >+ if [ "${PRETEND}" = "enabled" ]; then >+ echo "${MANPAGEDIR}/${LOCALE}" >+ else >+ /bin/rm -f `find ${MANPAGEDIR}/${LOCALE} -type f` >+ fi > fi > fi > done > else > for LOCALE in `/bin/ls ${MANPAGEDIR} | grep -v ^man[1-9]` > do >- if [ ! "`grep -x ^${LOCALE} /etc/locale.nopurge`" ] && \ >- [ "`grep -x ^${LOCALE} ${LOCALELIST}`" ]; then >+ if echo "${PURGELIST}" | grep -xq ${LOCALE}; then > if [ -d ${MANPAGEDIR}/${LOCALE} ]; then >- /bin/rm -f `find ${MANPAGEDIR}/${LOCALE} -type f` >+ if [ "${PRETEND}" = "enabled" ]; then >+ echo "${MANPAGEDIR}/${LOCALE}" >+ else >+ /bin/rm -f `find ${MANPAGEDIR}/${LOCALE} -type f` >+ fi > fi > fi > done >@@ -204,6 +228,9 @@ > fi > } > >+[ "${PRETEND}" = "enabled" ] && >+ ewarn "If not pretending, localepurge would clear the following directories:\n" >+ > for folder in ${LOCALEDIRS}; do > purgelocale "$folder" > done
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 140822
: 92021