From: Zach Forrest <zach@disinformation.ca>
To: gentoo-dev@gentoo.org
Subject: Re: [gentoo-dev] Re: [gentoo-user] portage revisited
Date: Fri, 15 Mar 2002 10:20:32 -0800 [thread overview]
Message-ID: <3C923B70.5070401@disinformation.ca> (raw)
In-Reply-To: Pine.LNX.4.21.0203150954270.25480-100000@lucifer.evil-core.com
[-- Attachment #1: Type: text/plain, Size: 844 bytes --]
The attached files should make this a little safer. I changed the grep
commands a little, so as only to filter the exact packages that can have
more than one version installed (e.g. "grep -v db" filters out more than
just sys-libs/db). The script first runs the command with the
"--pretend" flag, then asks for confirmation (after displaying the
output of the emerge command), and finally proceeds (if that is your
wish). Hope it helps.
Zach
P.S. If you don't like the progress indicator (busy.sh), just comment
out the appropriate lines.
Bob Phan wrote:
>
> I ran this yesterday. Cludgy, but works. :)
>
> emerge --unmerge --safe `qpkg --dups | grep -v linux | grep -v db | grep
> -v freetype | grep -v bison`
>
> Disclaimer:
> This may not work for you, probably won't, and could potentially screw
> something up. etc. etc.
>
[-- Attachment #2: epurge-old --]
[-- Type: application/x-java-vm, Size: 1449 bytes --]
[-- Attachment #3: busy.sh --]
[-- Type: text/plain, Size: 1159 bytes --]
#!/usr/bin/env bash
# busy - show progress indicators
#
# Zach Forrest <zach@disinformation.ca>
#
# Some ideas taken from a script of the same name by:
# Heiner Steven (heiner.steven@odn.de)
#
# usage:
# busy& busipid=$!
# # do some actions
# kill ${busypid} > /dev/null 2>&1; wait
trap "_cleanup" TERM
# Variables
INDICATORS=("|" "/" "-" "\\")
NUM_INDICATORS=${#INDICATORS[@]}
CUR_INDICATOR=0
BACKONE="\x1b[1D" # ASCII escape sequence to move back one character.
SLEEP_TIME=0.25
# This lets us clean-up and print the done message when the
# process is killed.
_cleanup() {
printf %b "${BACKONE}done."
echo
unset INDICATORS NUM_INDICATORS CUR_INDICATOR BACKONE SLEEP_TIME CLEAN_EXIT
exit
}
# Display first indicator without moving back one character to
# respect the position of the cursor before we enter the loop.
printf %b "${INDICATORS[CUR_INDICATOR]}"
((CUR_INDICATOR=(CUR_INDICATOR+1)%NUM_INDICATORS))
# This does the work of "spinning" the progress indicator.
while true
do
printf %b "${BACKONE}${INDICATORS[CUR_INDICATOR]}"
((CUR_INDICATOR=(CUR_INDICATOR+1)%NUM_INDICATORS))
sleep ${SLEEP_TIME}
done
next prev parent reply other threads:[~2002-03-15 18:20 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <3C910D3B.9010901@earthlink.net>
[not found] ` <NDECLAINNBLNMIOCBPMPGEKLCDAA.adam-aig@attbi.com>
[not found] ` <20020314141051.69757313.rogan@fizbat.com>
2002-03-14 22:27 ` [gentoo-dev] Re: [gentoo-user] portage revisited Joshua Hansen
2002-03-14 23:44 ` Zach Forrest
2002-03-15 3:17 ` Joshua Hansen
2002-03-15 8:44 ` Bjarke Sørensen
2002-03-15 9:56 ` Bob Phan
2002-03-15 18:20 ` Zach Forrest [this message]
2002-03-15 13:52 ` Bob Phan
2002-03-15 19:42 ` Zach Forrest
2002-03-15 19:08 ` Frank Thieme
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=3C923B70.5070401@disinformation.ca \
--to=zach@disinformation.ca \
--cc=gentoo-dev@gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox