From 98effe30bd249ee0ea966f83baf8bad54e27e9d0 Mon Sep 17 00:00:00 2001 From: Dustin Kirkland Date: Mon, 18 Jan 2010 09:14:36 +1300 Subject: [PATCH] usr/bin/byobu-export: correct paths to their new locations, LP: #507461 --- debian/changelog | 5 ++++- usr/bin/byobu-export | 16 +++++++++++----- 2 files changed, 15 insertions(+), 6 deletions(-) diff --git a/debian/changelog b/debian/changelog index 72180c1f..cbcd5ba1 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,9 +1,12 @@ byobu (2.48) unreleased; urgency=low - [ darwinawdwinner@gmail.com ] + [ launchpad.net/~rct86 ] * usr/bin/byobu-launcher: use screen -wipe, instead of screen -ls, to clean up destroyed sessions, LP: #508609 + [ launchpad.net/~dperson ] + * usr/bin/byobu-export: correct paths to their new locations, LP: #507461 + -- Dustin Kirkland Tue, 12 Jan 2010 12:14:16 -0600 byobu (2.47-0ubuntu1) lucid; urgency=low diff --git a/usr/bin/byobu-export b/usr/bin/byobu-export index 05816e41..51e8225d 100755 --- a/usr/bin/byobu-export +++ b/usr/bin/byobu-export @@ -38,7 +38,7 @@ usage() { error() { echo "ERROR: $1" 1>&2 - [ "$generated" = "1" -a -f "$file" ] && rm -f "$file" + [ -f "$file" ] && rm -f "$file" exit 1 } @@ -75,7 +75,7 @@ fi # Create workspace for i in etc usr/bin usr/lib usr/share/doc; do - mkdir -p "$DIR/.$PKG/$i/$PKG" + mkdir -p "$DIR/.$PKG/$i" done dpkg-query --show --showformat '${Package} ${Version}\n' $PKG > "$DIR/.$PKG/version" 2>/dev/null || true echo "http://launchpad.net/$PKG" >> "$DIR/.$PKG/version" @@ -90,15 +90,21 @@ cp -a /usr/bin/$PKG-* "$DIR/.$PKG/usr/bin" cp /etc/$PKG/statusrc "$DIR/.$PKG/status" echo "source \$HOME/.$PKG/profile" > "$DIR/.screenrc" echo "source \$HOME/.$PKG/usr/share/$PKG/keybindings/common" > "$DIR/.$PKG/keybindings" -cd $DIR/.$PKG; ln -s usr/lib/$PKG bin; cd - -cd $DIR/.$PKG; ln -s usr/share/$PKG/profiles/common profile; cd - +ln -s usr/share/$PKG/profiles/common profile; cd - # Some gardening; update paths to be $HOME-based for i in $(ls /usr/bin/$PKG-* | grep -v "install"); do bin=$(basename "$i") sed -i "s:$bin:\$HOME/.$PKG$i:g" $(find $DIR -type f) done -sed -i "s:/etc/\$PKG:\$HOME/.$PKG/etc/\$PKG:g" $(find $DIR -type f) +for i in /etc/ /usr/lib/ /usr/share/; do + sed -i "s:$i$PKG:\$HOME/.$PKG$i$PKG:g" $(find $DIR -type f) + sed -i "s:$i\$PKG:\$HOME/.$PKG$i\$PKG:g" $(find $DIR -type f) + sed -i "s:\$HOME/\.$PKG$i\$HOME/\.$PKG$i:\$HOME/.$PKG$i:g" $(find $DIR -type f) +done ++sed -i "s:\$HOME/\.$PKG\$HOME/\.$PKG:\$HOME/.$PKG:g" $(find $DIR -type f) ++sed -i "s:\$HOME/\.$PKG/usr/bin/\$HOME/\.$PKG/usr/bin/:\$HOME/.$PKG/usr/bin/:g" $(find $DIR -type f) + rm -f $DIR/.$PKG/usr/bin/$PKG-export # tar up the results