From 436ff26c3688198de8e8e48121296eace0b5d119 Mon Sep 17 00:00:00 2001 From: Jason Felice Date: Mon, 11 Nov 2019 17:06:55 -0500 Subject: 9c, 9l: use $TMPDIR if available (#272) NixOS sandboxed builds (at least on Mac) don't have access to /tmp, and this should be better POSIX. --- bin/9c | 2 +- bin/9l | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/9c b/bin/9c index 3ffb716c..88c47887 100755 --- a/bin/9c +++ b/bin/9c @@ -133,7 +133,7 @@ case "$tag" in esac # N.B. Must use temp file to avoid pipe; pipe loses status. -xtmp=/tmp/9c.$$.$USER.out +xtmp=${TMPDIR-/tmp}/9c.$$.$USER.out $cc -DPLAN9PORT -I$PLAN9/include $cflags "$@" 2>$xtmp status=$? quiet $xtmp diff --git a/bin/9l b/bin/9l index 0e939524..032d3801 100755 --- a/bin/9l +++ b/bin/9l @@ -346,7 +346,7 @@ then echo $ld -L$PLAN9/lib "$@" $libsl $extralibs $frameworks fi -xtmp=/tmp/9l.$$.$USER.out +xtmp="${TMPDIR-/tmp}/9l.$$.$USER.out" xxout() { sed 's/.*: In function `[^:]*: *//' $xtmp | egrep . | egrep -v 'is (often|almost always) misused|is dangerous, better use|text-based stub' -- cgit v1.2.3 From cf6b778799edf4ebc2331d12707e66e7d38331ea Mon Sep 17 00:00:00 2001 From: Leonid Bobrov Date: Tue, 7 Jan 2020 21:51:42 +0200 Subject: INSTALL, 9c, 9l: improve handling of *BSD (#302) --- bin/9c | 5 ++--- bin/9l | 13 ------------- 2 files changed, 2 insertions(+), 16 deletions(-) (limited to 'bin') diff --git a/bin/9c b/bin/9c index 88c47887..7e6e3ab8 100755 --- a/bin/9c +++ b/bin/9c @@ -79,9 +79,8 @@ useclang() tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}" case "$tag" in -*FreeBSD*gcc*) usegcc ;; -*FreeBSD*clang*) useclang ;; -*DragonFly*|*BSD*) usegcc ;; +*(DragonFly|BSD)*gcc*) usegcc ;; +*(DragonFly|BSD)*clang*) useclang ;; *Darwin-x86_64*) useclang cflags="$ngflags -g3 -m64" diff --git a/bin/9l b/bin/9l index 032d3801..8af27154 100755 --- a/bin/9l +++ b/bin/9l @@ -11,19 +11,6 @@ nmflags="" extralibs="-lm" tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}" case "$tag" in -*FreeBSD*) - ld=${CC9:-gcc} - userpath=true - extralibs="$extralibs -lutil" - case "`uname -r`" in - 5.2.*) - extralibs="$extralibs -lkse" - ;; - [5-9].*|1[0-9].*) - extralibs="$extralibs -lpthread" - ;; - esac - ;; *DragonFly*|*BSD*) ld=${CC9:-gcc} userpath=true -- cgit v1.2.3 From 194178b5788a09379e01e8ff8bff391b8a8d5c18 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20K=C3=BChl?= Date: Tue, 7 Jan 2020 23:27:39 +0100 Subject: 9c: Fix case patterns for DragonFly and other BSDs POSIX does not support grouping in case item patterns. Installing with a strict POSIX shell fails with: /usr/local/plan9/bin/9c: line 82: syntax error near unexpected token `(' /usr/local/plan9/bin/9c: line 82: `*(DragonFly|BSD)*gcc*) usegcc ;;' This change expands the patterns to work around the limitation. See https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_10 (and search for case_clause) --- bin/9c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'bin') diff --git a/bin/9c b/bin/9c index 7e6e3ab8..f21ea754 100755 --- a/bin/9c +++ b/bin/9c @@ -79,8 +79,8 @@ useclang() tag="${SYSNAME:-`uname`}-${OBJTYPE:-`uname -m`}-${CC9:-cc}" case "$tag" in -*(DragonFly|BSD)*gcc*) usegcc ;; -*(DragonFly|BSD)*clang*) useclang ;; +*DragonFly*gcc*|*BSD*gcc*) usegcc ;; +*DragonFly*clang|*BSD*clang*) useclang ;; *Darwin-x86_64*) useclang cflags="$ngflags -g3 -m64" -- cgit v1.2.3 From fafa622a5bdf71adfbb4334541c3b65f29c89ca9 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sun, 12 Jan 2020 15:05:40 -0500 Subject: all: fix or silence various gcc warnings As usual, gcc finds some real problems but also reports a ton of noise. Fix the problems and quiet the noise. --- bin/9c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'bin') diff --git a/bin/9c b/bin/9c index f21ea754..20919e9a 100755 --- a/bin/9c +++ b/bin/9c @@ -14,6 +14,10 @@ usegcc() -Wno-comment \ -Wno-sign-compare \ -Wno-unknown-pragmas \ + -Wno-misleading-indentation \ + -Wno-stringop-truncation \ + -Wno-stringop-overflow \ + -Wno-format-truncation \ -fno-omit-frame-pointer \ -fsigned-char \ " -- cgit v1.2.3 From fa7fecff33769e27653a51d1d15909d2b538194b Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 13 Jan 2020 11:04:53 -0500 Subject: wintext: add tmux support, use in ", "" Fixes #223. --- bin/quote1 | 11 +---------- bin/quote2 | 2 +- bin/wintext | 8 +++++++- 3 files changed, 9 insertions(+), 12 deletions(-) (limited to 'bin') diff --git a/bin/quote1 b/bin/quote1 index e0f7c8f9..f52480fd 100755 --- a/bin/quote1 +++ b/bin/quote1 @@ -2,19 +2,10 @@ . 9.rc -fn text { - if(~ $winid [0-9]*) - 9p read acme/$winid/body - if not if(~ $text9term unix!*) - dial -e $text9term [1=2] exit notfound diff --git a/bin/wintext b/bin/wintext index 93fe40ea..80a89957 100755 --- a/bin/wintext +++ b/bin/wintext @@ -1,4 +1,4 @@ -#!/bin/sh +#!/bin/bash case "$winid" in [0-9]*) @@ -12,5 +12,11 @@ unix!*) exit 0 esac +case "$TMUX" in +?*) + tmux capture-pane -p + exit 0 +esac + echo 'no running window found' 2>&1 exit 1 -- cgit v1.2.3