From d825a4995fa8e663688fb106d02d14759cf58906 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?John=20Ankarstr=C3=B6m?= <john@ankarstrom.se>
Date: Tue, 20 Jul 2021 22:18:23 +0200
Subject: Fix psu

---
 psu | 2 +-
 psx | 6 +++---
 2 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/psu b/psu
index 3f192bd..a5ad636 100755
--- a/psu
+++ b/psu
@@ -2,7 +2,7 @@
 
 # psu -- undo patches applied to pkgsrc build
 
-d=$(psx)
+d=$(psx) || true
 echo=echo
 echo "${0##*/}: undoing patches..." 1>&2
 [ x"$1" = x"-x" ] && echo= || echo '(preview, no -x)' 1>&2
diff --git a/psx b/psx
index c0df08f..1066c5f 100755
--- a/psx
+++ b/psx
@@ -13,8 +13,8 @@ d=$(tar -tf "$f" | head -1)
 
 opt=
 if [ -e "$d" ]; then
-	printf "%s: $d already exists; overwrite? " "${0##*/}"
-	read ans
+	printf "%s: $d already exists; overwrite? " "${0##*/}" 1>&2
+	read ans </dev/tty
 	case $ans in
 	y*) opt=-U ;;
 	*) exit 1 ;;
@@ -22,5 +22,5 @@ if [ -e "$d" ]; then
 fi
 
 echo extracting archive... 1>&2
-tar -x $opt -f "$f"
+tar -x $opt -f "$f" 1>&2
 echo "$d"
-- 
cgit v1.2.3