Go to:
Gentoo Home
Documentation
Forums
Lists
Bugs
Planet
Store
Wiki
Get Gentoo!
Gentoo's Bugzilla – Attachment 98794 Details for
Bug 150097
app-admin/localepurge patches
Home
|
New
–
[Ex]
|
Browse
|
Search
|
Privacy Policy
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Second patch - add list action and change operation of pretend action
list.patch (text/plain), 3.50 KB, created by
Charlie Shepherd (RETIRED)
on 2006-10-04 13:05:39 UTC
(
hide
)
Description:
Second patch - add list action and change operation of pretend action
Filename:
MIME Type:
Creator:
Charlie Shepherd (RETIRED)
Created:
2006-10-04 13:05:39 UTC
Size:
3.50 KB
patch
obsolete
>--- localepurge 2006-10-04 20:34:56.028158768 +0100 >+++ localepurge 2006-10-04 20:50:07.364614568 +0100 >@@ -22,6 +22,8 @@ > BRACKET=$'\e[34;01m' > BOLD=$'\e[1m' > >+ACTION="/bin/rm -vf" >+ > eerror () { > echo -e " ${BAD}*${NORMAL} $*" >> /dev/stderr > } >@@ -37,6 +39,14 @@ > echo -e " ${GOOD}*${NORMAL} $*" > } > >+print() { >+ for x in $@; do >+ if [ "${x}" = "" ]; then return 0 >+ else; /bin/echo $x >+ fi >+ done >+} >+ > ayuda () { > echo "${HILITE}localepurge${NORMAL} for ${BOLD}Gentoo Linux${NORMAL} ${BRACKET}[${NORMAL} ${GOOD}${VERSION}${NORMAL} ${BRACKET}]${NORMAL}" > echo -e " " "by bass@gentoo.org" >@@ -47,6 +57,7 @@ > echo > etab "${BOLD}-debug (-d) ${NORMAL} : debug mode." > etab "${BOLD}-help (-h) ${NORMAL} : show this help." >+ etab "${BOLD}-list (-l) ${NORMAL} : list directories to be cleared" > etab "${BOLD}-nocolor (-nc) ${NORMAL} : no color mode." > etab "${BOLD}-pretend (-p) ${NORMAL} : pretend mode." > etab "${BOLD}-verbose (-v) ${NORMAL} : verbose mode." >@@ -82,15 +93,19 @@ > > # Loop through the rest of the options > >-for x in $@ >-do >+for x in $@; do > > if [ "$x" = "-help" ] || [ "$x" = "-h" ]; then > ayuda > exit 0 > >+ elif [ "$x" = "-list" ] || [ "$x" = "-l" ]; then >+ LIST=enabled >+ > elif [ "$x" = "-pretend" ] || [ "$x" = "-p" ]; then > PRETEND=enabled >+ ACTION=print >+ SHOWFREEDSPACE=disabled > > elif [ "$x" = "-verbose" ] || [ "$x" = "-v" ]; then > VERBOSE=enabled >@@ -105,6 +120,13 @@ > exit 1 > fi > >+ if [ "${LIST}" = "enabled" ] && [ "${PRETEND}" = "enabled" ]; then >+ eerror "Cannot have list and pretend mode enabled at the same time" >+ eerror "Please enable one at a time" >+ echo >> /dev/stderr >+ eerror "For more information, see `basename $0` -help" >+ fi >+ > done > > # Do nothing and report why if no valid configuration file exists: >@@ -146,10 +168,10 @@ > for LOCALE in `/bin/ls ${LOCALEDIR}`; do > if echo "${PURGELIST}" | grep -xq ${LOCALE}; then > if [ -d ${LOCALEDIR}/${LOCALE}/LC_MESSAGES ]; then >- if [ "${PRETEND}" = "enabled" ]; then >+ if [ "${LIST}" = "enabled" ]; then > echo "${LOCALEDIR}/${LOCALE}" > else >- /bin/rm -vf `find ${LOCALEDIR}/${LOCALE} -type f` >+ ${ACTION} `find ${LOCALEDIR}/${LOCALE} -type f` > fi > fi > fi >@@ -183,10 +205,10 @@ > for LOCALE in `/bin/ls ${MANPAGEDIR} | grep -v ^man[1-9]`; do > if echo "${PURGELIST}" | grep -xq ${LOCALE}; then > if [ -d ${MANPAGEDIR}/${LOCALE} ]; then >- if [ "${PRETEND}" = "enabled" ]; then >+ if [ "${LIST}" = "enabled" ]; then > echo "${MANPAGEDIR}/${LOCALE}" > else >- /bin/rm -f `find ${MANPAGEDIR}/${LOCALE} -type f` >+ ${ACTION} `find ${MANPAGEDIR}/${LOCALE} -type f` > fi > fi > fi >@@ -203,8 +225,11 @@ > fi > } > >+[ "${LIST}" = "enabled" ] && [ "${VERBOSE}" = "enabled" ] && >+ ewarn "If not in list mode, localepurge would clear the following directories:\n" >+ > [ "${PRETEND}" = "enabled" ] && [ "${VERBOSE}" = "enabled" ] && >- ewarn "If not pretending, localepurge would clear the following directories:\n" >+ ewarn "If not pretending, localepurge would delete the following files:\n" > > for folder in ${LOCALEDIRS}; do > purgelocale "$folder"
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 150097
:
98793
|
98794
|
99042