From c426f124cca30b58f7c4321d0dc126f94ed14444 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Mon, 7 Dec 2009 13:30:24 -0600 Subject: [PATCH] * bin/byobu-export: - drop the color selection, no longer necessary --- byobu-export | 78 ++---------------------------------------------- debian/changelog | 2 ++ 2 files changed, 4 insertions(+), 76 deletions(-) diff --git a/byobu-export b/byobu-export index 573e53f6..088527c9 100755 --- a/byobu-export +++ b/byobu-export @@ -20,8 +20,6 @@ PKG="byobu" SHARE="/usr/share/$PKG" DIR=`mktemp -t -d $PKG.XXXXXXXX` || error "Could not create a temporary directory" -# Grab list of available colors -colors=`find $SHARE/profiles/ -type f | sed "s/^.*\///" | sed "s/^.*-//" | sort -u | egrep -v "common|plain|NONE"` # Make sure we clean up $DIR if we exit for any reason trap "rm -rf "$DIR" 2>/dev/null || true" EXIT HUP INT QUIT TERM @@ -29,16 +27,11 @@ trap "rm -rf "$DIR" 2>/dev/null || true" EXIT HUP INT QUIT TERM usage() { echo echo "Usage:" - echo " $0 [-c COLOR] -f TARGET.tar.gz" + echo " $0 [-f TARGET.tar.gz]" echo echo "If TARGET.tar.gz is unspecified, a randomly generated" echo "filename will be used." echo - echo "COLOR is obtained interactively if unspecified; or one of:" - for c in $colors; do - echo " * $c" - done - echo exit 1 } @@ -48,43 +41,6 @@ error() { exit 1 } -choose() { - i=0 - x= - selected= - for x in $@; do - i=$(expr $i + 1) - [ $i -lt 10 ] && i=" $i" - echo " $i. $x" 1>&2 - done - echo - count=1 - while /bin/true; do - if [ $count -gt 5 ]; then - error "Invalid selection" - fi - count=`expr $count + 1` - if ! test $selected -gt 0 2>/dev/null; then - echo -n "`gettext 'Choose'` [1 -$i]: " - selected=`head -n1` - elif ! test $selected -le $i 2>/dev/null; then - echo -n "`gettext 'Choose'` [1 -$i]: " - selected=`head -n1` - else - break - fi - done - i=0 - for x in $@; do - i=$(expr $i + 1) - if [ "$i" = "$selected" ]; then - SELECTED="$x" - return 0 - fi - done - exit 1 -} - hr() { echo "###############################################################################" } @@ -122,24 +78,18 @@ sources() { cat $SHARE/profiles/common | sed "s:$PKG-:\$HOME/.$PKG/$PKG-:" hr echo + # insert the keybindings cat $SHARE/keybindings/f-keys hr echo hr - cat "$SOURCE" - hr } # Handle command line parameters -color= file= while [ $# -gt 1 ]; do case "$1" in - -c) - color="$2" - shift 2 - ;; -f) file="$2" shift 2 @@ -179,29 +129,6 @@ else fi fi -# Obtain selections -count=1 -while /bin/true; do - if [ $count -gt 5 ]; then - error "Invalid selection" - fi - SOURCE="$SHARE"/profiles/"$color" - if [ -f "$SOURCE" ]; then - break - else - # Try in the misc directory too - SOURCE="$SHARE"/profiles/misc/"$color" - if [ -f "$SOURCE" ]; then - break - fi - fi - echo - echo `gettext "Select a color: "` - choose $colors - color=$SELECTED - count=`expr $count + 1` -done - # Create workspace PROFILE="$DIR/.screenrc" STATUS="$DIR/.$PKG/status" @@ -237,7 +164,6 @@ tar --owner=root --group=root -zcf "$file" -C "$DIR" . || error "Could not creat echo echo "Success!" echo -echo " "`gettext "Profile"` ": [$color]" echo " "`gettext "Archive"` ": [$file]" echo echo `gettext "Extract the archive in your home directory on the target system."` diff --git a/debian/changelog b/debian/changelog index 88705ca6..4a712fef 100644 --- a/debian/changelog +++ b/debian/changelog @@ -50,6 +50,8 @@ byobu (2.40) unreleased; urgency=low * byobu-config, byobu-select-profile: make color selection more readable; support ctrl- escape sequence * bin/custom, byobu-status: support --detail in custom scripts + * bin/byobu-export: + - drop the color selection, no longer necessary -- Dustin Kirkland Tue, 10 Nov 2009 10:18:20 -0600