Репозиторий Sisyphus
Последнее обновление: 22 октября 2019 | Пакетов: 17517 | Посещений: 15399994
en ru br
Репозитории ALT
S:2.6.8-alt2
5.1: 2.5.27-alt1
4.1: 2.5.23-alt1
4.0: 2.5.18-alt2
3.0: 2.5.13-alt1
www.altlinux.org/Changes

Другие репозитории
Upstream:2.5.25

Группа :: Графические оболочки/FVWM-подобные
Пакет: fvwm

 Главная   Изменения   Спек   Патчи   Sources   Загрузить   Gear   Bugs and FR  Repocop 

Патч: fvwm-2.5.18-alt-fvwmbug-tmp.patch
Скачать


--- fvwm-2.5.18/bin/fvwm-bug.in.alt-fvwmbug-tmp	2006-09-13 17:40:13 +0400
+++ fvwm-2.5.18/bin/fvwm-bug.in	2006-09-13 17:42:35 +0400
@@ -51,9 +51,24 @@ done
 PATH=/bin:/usr/bin:/usr/local/bin:$PATH
 export PATH
 
-: ${EDITOR:=vi}
+# If they don't have a preferred editor set, then use
+if [ -n "$VISUAL" ]; then
+  EDIT="$VISUAL"
+elif [ -n "$EDITOR" ]; then
+  EDIT="$EDITOR"
+elif [ -x /bin/vitmp ]; then
+  EDIT=vitmp
+elif [ -x /usr/bin/vim ]; then
+  EDIT=vim
+elif [ -x /bin/vi ]; then
+  EDIT=vi
+else
+  echo "${0##*/}: No default editor found: attempting to use vi" >&2
+  EDIT=vi
+fi
 
-TEMP=`mktemp -q "${TMPDIR:-/tmp}/fvwm-bug.XXXXXX"`
+TEMP=`mktemp -t fvwm-bug.XXXXXXXXXX` || exit
+TEMPx=`mktemp -t fvwm-bug.XXXXXXXXXX` || { rm -f -- "$TEMP"; exit 1; }
 
 # Figure out how to echo a string without a trailing newline
 N=`echo 'hi there\c'`
@@ -62,15 +77,21 @@ case "$N" in
 	*)	n= c='\c' ;;
 esac
 
-trap 'rm -f $TEMP $TEMP.x; exit 1' 1 2 3 13 15
-trap 'rm -f $TEMP $TEMP.x' 0
+exit_handler()
+{
+	local rc=$?
+	trap '' EXIT
+	rm -f -- "$TEMP" "$TEMPx"
+	exit $rc
+}
+trap exit_handler EXIT HUP INT PIPE TERM QUIT
 
 # Who is mail from?
 : ${USER:=${LOGNAME:-`whoami`}}
 
 # Who is mail to?
 if test x"$address" = x; then
-	LOCAL=@LOCAL_BUGADDR@
+	LOCAL='@LOCAL_BUGADDR@'
 	WORKERS=fvwm-workers@fvwm.org
 
 	if test "$LOCAL"; then
@@ -79,14 +100,14 @@ if test x"$address" = x; then
 		echo $n "Send report to (l)ocal, (w)orkers, (b)oth? " $c
 		read ans
 		case "$ans" in
-		l*|L*) BUGADDR=$LOCAL;;
-		f*|F*|w*|W*) BUGADDR=$WORKERS;;
-		b*|B*) BUGADDR=$LOCAL,$WORKERS;;
-		*) echo "[Defaulting to LOCAL]"; BUGADDR=$LOCAL;;
+		l*|L*) BUGADDR="$LOCAL";;
+		f*|F*|w*|W*) BUGADDR="$WORKERS";;
+		b*|B*) BUGADDR="$LOCAL,$WORKERS";;
+		*) echo "[Defaulting to LOCAL]"; BUGADDR="$LOCAL";;
 		esac
 	fi
 else
-	BUGADDR=$address
+	BUGADDR="$address"
 fi
 
 UN=
@@ -112,7 +133,7 @@ FVWM_DATADIR=@FVWM_DATADIR@
 FVWM_MODULEDIR=@FVWM_MODULEDIR@
 
 
-cat > $TEMP <<EOF
+cat > "$TEMP" <<EOF
 From: ${USER}
 To: ${BUGADDR}
 Subject: [50 character or so descriptive subject here (for reference)]
@@ -138,13 +159,12 @@ Fix:
 	fix for the problem, don't include this section.]
 EOF
 
-chmod u+w $TEMP
-cp $TEMP $TEMP.x
+cp "$TEMP" "$TEMPx"
 
-trap '' 2		# ignore interrupts while in editor
+trap '' INT		# ignore interrupts while in editor
 
-until $EDITOR $TEMP; do
-	echo "$0: editor \`$EDITOR' exited with nonzero status."
+until $EDIT "$TEMP"; do
+	echo "$0: editor \`$EDIT' exited with nonzero status."
 	echo "$0: Perhaps it was interrupted."
 	echo "$0: Type \`y' to give up, and lose your bug report;"
 	echo "$0: type \`n' to re-enter the editor."
@@ -156,9 +176,9 @@ until $EDITOR $TEMP; do
 	esac
 done
 
-trap 'rm -f $TEMP $TEMP.x; exit 1' 2	# restore trap on SIGINT
+trap exit_handler INT	# restore trap on SIGINT
 
-if cmp -s $TEMP $TEMP.x
+if cmp -s "$TEMP" "$TEMPx"
 then
 	echo "File not changed, no bug report submitted."
 	exit
@@ -170,8 +190,8 @@ case "$ans" in
 [Nn]*)	exit 0 ;;
 esac
 
-${RMAIL} $BUGADDR < $TEMP || {
-	cat $TEMP >> $HOME/dead.fvwm-bug
+${RMAIL} "$BUGADDR" < "$TEMP" || {
+	cat "$TEMP" >> "$HOME/dead.fvwm-bug"
 	echo "$0: mail failed: report saved in $HOME/dead.fvwm-bug" >&2
 }
 
 
дизайн и разработка: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
текущий майнтейнер: Michael Shigorin