9front - general discussion about 9front
 help / color / mirror / Atom feed
* [9front] [PATCH] patch(1): remove dead link
@ 2022-02-02 16:42 craekz
  2022-02-02 17:46 ` ori
  0 siblings, 1 reply; 4+ messages in thread
From: craekz @ 2022-02-02 16:42 UTC (permalink / raw)
  To: 9front

It seems like this link is dead and shouldn't be mentioned anymore.

---
diff --git a/sys/man/1/patch b/sys/man/1/patch
index 3fb4a490c..badb9298c 100644
--- a/sys/man/1/patch
+++ b/sys/man/1/patch
@@ -154,5 +154,3 @@ file.
 .B /rc/bin/patch
 .SH SEE ALSO
 .IR diff (1)
-.br
-.B http://plan9.bell-labs.com/wiki/plan9/How_to_contribute

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9front] [PATCH] patch(1): remove dead link
  2022-02-02 16:42 [9front] [PATCH] patch(1): remove dead link craekz
@ 2022-02-02 17:46 ` ori
  2022-02-04 18:11   ` craekz
  2022-02-15 21:34   ` craekz
  0 siblings, 2 replies; 4+ messages in thread
From: ori @ 2022-02-02 17:46 UTC (permalink / raw)
  To: 9front

Quoth craekz <craekz7@gmail.com>:
> It seems like this link is dead and shouldn't be mentioned anymore.
> 
> ---
> diff --git a/sys/man/1/patch b/sys/man/1/patch
> index 3fb4a490c..badb9298c 100644
> --- a/sys/man/1/patch
> +++ b/sys/man/1/patch
> @@ -154,5 +154,3 @@ file.
>  .B /rc/bin/patch
>  .SH SEE ALSO
>  .IR diff (1)
> -.br
> -.B http://plan9.bell-labs.com/wiki/plan9/How_to_contribute
> 

How about we drop the whole thing instead, since
that's not how you submit patches to 9front?

(I think that it's still possible to use this
to submit patches to 9legacy, but... I don't
think there's anyone listening)

it also makes room for (eventually) a native,
simplified version of ape/patch, which can
live in /bin/patch.


diff 251c3cfd610abd169676852d301a2aa1267c0e57 uncommitted
--- a//rc/bin/patch/applied
+++ /tmp/diff100000781318
@@ -1,8 +1,0 @@
-#!/bin/rc
-
-if(~ $#* 0){
-	echo 'usage: patch/applied patch-name...' >[1=2]
-	exit usage
-}
-
-patch/move applied $*
--- a//rc/bin/patch/apply
+++ /tmp/diff100000781321
@@ -1,79 +1,0 @@
-#!/bin/rc
-
-rfork e
-
-if(! ~ $#* 1){
-	echo 'usage: patch/apply patch-name' >[1=2]
-	exit usage
-}
-
-if(! test -d /n/sources/patch){
-	rfork n
-	9fs sources
-}
-
-if(! test -d /n/sources/patch/$1){
-	echo 'no such patch' /n/sources/patch/$1 >[1=2]
-	exit nopatch
-}
-
-builtin cd /n/sources/patch/$1 || exit nopatch
-if(! patch/okay .){
-	echo 'bad patch: '$status >[1=2]
-	exit badpatch
-}
-
-if(! echo >.tmp || ! rm .tmp){
-	echo no write permission >[1=2]
-	exit 'no write permission'
-}
-
-echo -n merge... >[1=2]
-fn xxx {
-	if(! test -f $1)
-		cp $2 $2.new
-	if not
-		ape/diff3 -m $1 $2.orig $2 >$2.new
-	if(grep -s '^<<<<' $2.new){
-		echo conflicts merging $1';' see `{pwd}^/$2.new >[1=2]
-		
-		touch failed
-	}
-}
-rm -f failed
-cat files | sed 's/^/xxx /' | rc
-if(test -f failed){
-	echo exiting without changes >[1=2]
-	exit failed
-}
-
-echo -n backup... >[1=2]
-fn xxx {
-	# echo cp $1 $2.backup
-	cp $1 $2.backup
-}
-cat files | sed 's/^/xxx /' |rc
-
-echo -n copy... >[1=2]
-fn xxx {
-	# echo cp $2.new $1
-	cp $2.new $1 || touch failed
-}
-cat files | sed 's/^/xxx /' | rc
-
-fn xxx {
-	# echo cp $2.backup $1
-	cp $2.backup $1
-}
-
-if(test -f failed){
-	echo copying failed, restoring backups >[1=2]
-	cat files | sed 's/^/xxx /' | rc
-	exit failed
-}
-
-echo >[1=2]
-
-echo to update sources: >[1=2]
-cat files | awk '{print "	update " $1 }' >[1=2]
-
--- a//rc/bin/patch/create
+++ /tmp/diff100000781324
@@ -1,85 +1,0 @@
-#!/bin/rc
-rfork e
-
-fn xchmod { 
-	chmod $* >[2]/dev/null
-}
-
-if(~ $#* 0 1 2){
-	echo 'usage: patch/create name email file... [< description]' >[1=2]
-	exit usage
-}
-
-if(! echo $1 | grep -s '^[a-z_0-9.\-]+$'){
-	echo 'bad name: [a-z0-9._\-]+ only' >[1=2]
-	exit usage
-}
-if(! echo $2 | grep -s '^(-|[A-Za-z0-9.\-+]+@[A-Za-z0-9.\-+]+)$'){
-	echo 'bad email: [a-z0-9.-+] only; use ''-'' to not leave an email address.' >[1=2]
-	exit usage
-}
-
-if(! test -d /n/sources/patch){
-	rfork n
-	9fs sources
-}
-
-patch=$1
-email=$2
-shift
-shift
-d=/n/sources/patch/$patch
-if(! mkdir $d){
-	echo mkdir $d failed >[1=2]
-	exit mkdir
-}
-if(! ~ $email -){
-	echo $email >$d/email
-}
-
-xchmod o-w $d
->$d/readme
->$d/files
->$d/notes
-for(i in $*){
-	i=`{cleanname -d `{pwd} $i}
-	if(! test -f $i){
-		echo error: cannot find $i >[1=2]
-		rm -rf $d
-		exit oops
-	}
-	short=`{basename $i}
-	uniq=$short
-	n=0
-	while(test -f $d/$uniq){
-		uniq=$short.$n
-		n=`{echo 1+$n | hoc}
-	}
-	cp $i $d/$uniq
-	if(test -f /n/sources/plan9/$i){
-		if(cmp -s /n/sources/plan9/$i $i)
-			echo warning: new file $i does not differ from sources >[1=2]
-		cp /n/sources/plan9/$i $d/$uniq.orig
-	}
-	if not
-		echo warning: new file $i not on sources >[1=2]
-	echo $i $uniq >>$d/files
-}
-@{builtin cd $d && xchmod ug+rw * && xchmod a+r *}
-
-if(~ `{cat /proc/$pid/fd | awk 'NR==2{print $NF}'} */dev/cons && test -w /dev/consctl){
-	>/dev/consctl {
-		echo holdon
-		cat >$d/readme
-	}
-}
-if not
-	cat >$d/readme
-
-if(! test -s $d/readme){
-	echo 'no description given; aborting' >[1=2]
-	rm -rf $d
-	exit oops
-}
-
-echo $d
--- a//rc/bin/patch/diff
+++ /tmp/diff100000781327
@@ -1,45 +1,0 @@
-#!/bin/rc
-# patch/diff [-w] patch-name
-rfork e
-fn usage {
-	echo 'usage: patch/diff [-bmnwz] patch-name' >[1=2]
-	exit usage
-}
-
-dopts=(-c)
-while (! ~ $#* 0 && ~ $1 -*) {
-	switch ($1) {
-	case -[bmnw]
-		dopts=($dopts $1)
-	case -z
-		dopts=()
-	case *
-		usage
-	}
-	shift
-}
-if(! ~ $#* 1)
-	usage
-
-if(! test -d /n/sources/patch){
-	rfork n
-	9fs sources
-}
-
-if(! test -d /n/sources/patch/$1){
-	echo 'no such patch' /n/sources/patch/$1 >[1=2]
-	exit nopatch
-}
-
-builtin cd /n/sources/patch/$1 || exit nopatch
-if(! patch/okay .){
-	echo 'bad patch: '$status >[1=2]
-	exit badpatch
-}
-
-d=/n/sources/patch/$1
-fn xxx {
-	echo $1
-	diff $dopts $2.orig $d/$2 | sed 's/^/	/'
-}
-cat files | sed 's/^/xxx /' | rc
--- a//rc/bin/patch/list
+++ /tmp/diff100000781330
@@ -1,54 +1,0 @@
-#!/bin/rc
-
-rfork e
-if(! test -d /n/sources/patch){
-	rfork n
-	9fs sources
-}
-
-pref=''
-builtin cd /n/sources/patch || {
-	echo 'can''t cd /n/sources/patch' >[2=1]
-	exit no-sources
-}
-
-if(~ $1 applied saved sorry maybe){
-	pref=$1^'/'
-	shift
-}
-if(~ $#* 0)
-	*=(`{
-		if(~ $pref *?*)
-			builtin cd $pref
-		ls -t | grep -v '^(applied|saved|sorry|maybe)$'
-	})
-
-trunc=(sed 5q)
-if(~ $#* 1)
-	trunc=cat
-
-{
-for(i in $*){
-	i=$pref^$i
-	if(test -f $i/origls)
-		cat $i/origls | awk '{$NF="'$i'"; print}'
-	if not
-		ls -ld $i
-	if(patch/okay $i){
-		if(test -r $i/email)
-			echo from `{cat $i/email}
-		cat $i/files | awk '{print "	" $1}'
-		cat $i/readme | sed 's/^/	/' | $trunc
-		if(test -f $i/notes){
-			echo
-			cat $i/notes
-		}
-	}
-	if not
-		echo '	'bad patch: $status >[2=1]
-	echo
-}
-} >/tmp/patchtmp.$pid
-
-cat /tmp/patchtmp.$pid
-rm -f /tmp/patchtmp.$pid
--- a//rc/bin/patch/move
+++ /tmp/diff100000781333
@@ -1,31 +1,0 @@
-#!/bin/rc
-# patch/move target patch-tree... - move patch tree(s) to target dir
-rfork e
-pats=/n/sources/patch
-if(~ $#* 0 1){
-	echo 'usage: patch/move dst patch-name...' >[1=2]
-	exit usage
-}
-
-if(! test -d $pats){
-	rfork n
-	9fs sources
-}
-cd $pats
-
-dst=$1
-shift
-for(src){
-	patbase = `{basename $src}
-	patdest = $dst/$patbase
-	if (~ $dst $src $patbase)
-		echo $0: skipping $src >[1=2]
-	if not if(! test -d $src)
-		echo $0: no such patch $pats/$src >[1=2]
-	if not if(test -d $patdest)
-		echo $0: already have $pats/$patdest >[1=2]
-	if not
-		ls -ldp $src >$src/origls &&
-			mkdir $patdest && dircp $src $patdest && rm -rf $src &&
-			test -s $patdest/email && patch/notify $patdest
-}
--- a//rc/bin/patch/note
+++ /tmp/diff100000781336
@@ -1,35 +1,0 @@
-#!/bin/rc
-
-rfork e
-if(! ~ $#* 1){
-	echo 'usage: patch/note patch-name' >[1=2]
-	exit usage
-}
-
-if(! test -d /n/sources/patch){
-	rfork n
-	9fs sources
-}
-
-if(! test -d /n/sources/patch/$1){
-	echo 'no such patch' /n/sources/patch/$1 >[1=2]
-	exit nopatch
-}
-
-builtin cd /n/sources/patch/$1 || exit nopatch
-if(! patch/okay .){
-	echo 'bad patch: '$status >[1=2]
-	exit badpatch
-}
-
-if(~ `{cat /proc/$pid/fd | awk 'NR==2{print $NF}'} */dev/cons && ~ `{ls -l /dev/consctl | awk '{print $1}'} *w*){
-	>/dev/consctl {
-		echo holdon
-		{echo `{date} `{cat /dev/user}
-		cat |sed 's/^/    /'; echo } >>notes
-	}
-}
-if not
-	{echo `{date} `{cat /dev/user}
-	cat |sed 's/^/    /'; echo } >>notes
-
--- a//rc/bin/patch/notify
+++ /tmp/diff100000781339
@@ -1,9 +1,0 @@
-#!/bin/rc
-# patch/notify
-rfork e
-for(i)
-	# don't flood sys when merely shuffling patches around
-	if (~ $i applied/* saved/* sorry/*) {
-		patch/list $i | mail -s 'patch/list '^$i sys \
-			`{cat /n/sources/patch/$i/email}
-	}
--- a//rc/bin/patch/okay
+++ /tmp/diff100000781342
@@ -1,14 +1,0 @@
-#!/bin/rc
-
-rfork e
-if(! ~ $#* 1){
-	echo usage: patch/okay dir >[1=2]
-	exit usage
-}
-
-i=$1
-if(! test -s $i/files || ! test -s $i/readme)
-	exit 'missing files'
-if(grep -v '^/[_a-zA-Z0-9.\-+/:]+ [_a-zA-Z0-9.\-+:]+$' $i/files)
-	exit 'bad file list' 
-exit 0
--- a//rc/bin/patch/remove
+++ /tmp/diff100000781345
@@ -1,19 +1,0 @@
-#!/bin/rc
-
-rfork e
-if(~ $#* 0){
-	echo 'usage: patch/remove patch-name...' >[1=2]
-	exit usage
-}
-
-if(! test -d /n/sources/patch){
-	rfork n
-	9fs sources
-}
-
-for(i){
-	if(! test -d /n/sources/patch/$i)
-		echo 'no such patch' /n/sources/patch/$i >[1=2]
-	if not
-		rm -rf /n/sources/patch/$i
-}
--- a//rc/bin/patch/save
+++ /tmp/diff100000781348
@@ -1,8 +1,0 @@
-#!/bin/rc
-
-if(~ $#* 0){
-	echo 'usage: patch/save patch-name...' >[1=2]
-	exit usage
-}
-
-patch/move saved $*
--- a//rc/bin/patch/sorry
+++ /tmp/diff100000781351
@@ -1,8 +1,0 @@
-#!/bin/rc
-
-if(~ $#* 0){
-	echo 'usage: patch/sorry patch-name...' >[1=2]
-	exit usage
-}
-
-patch/move sorry $*
--- a//rc/bin/patch/undo
+++ /tmp/diff100000781354
@@ -1,35 +1,0 @@
-#!/bin/rc
-
-rfork e
-if(! ~ $#* 1){
-	echo 'usage: patch/undo patch-name' >[1=2]
-	exit usage
-}
-
-if(! test -d /n/sources/patch){
-	rfork n
-	9fs sources
-}
-
-if(! test -d /n/sources/patch/$1){
-	echo 'no such patch' /n/sources/patch/$1 >[1=2]
-	exit nopatch
-}
-
-d=$1
-builtin cd /n/sources/patch/$1 || exit nopatch
-if(! patch/okay .){
-	echo 'bad patch: '$status >[1=2]
-	exit badpatch
-}
-
-fn xxx {
-	if(cmp $2.new $1){
-		echo cp /n/sources/patch/$d/$2.backup $1
-		cp $2.backup $1
-	}
-	if not
-		echo $1 has changed since patch was applied! >[2=1]
-}
-cat files | sed 's/^/xxx /' |rc
-
--- a//sys/man/1/patch
+++ /tmp/diff100000781357
@@ -1,158 +1,0 @@
-.TH PATCH 1
-.SH NAME
-patch \- simple patch creation and tracking system
-.SH SYNOPSIS
-.B patch/create
-.I name
-.I email
-.I files ...
-[
-.B < 
-.I description
-]
-.PP
-.B patch/list
-[
-.I name ...
-]
-.PP
-.B patch/diff
-.I name
-.PP
-.B patch/apply
-.I name
-.PP
-.B patch/undo
-.I name
-.PP
-.B patch/note
-.I name 
-[
-.B <
-.I note
-]
-.SH DESCRIPTION
-These scripts are a simple patch submission and tracking system
-used to propose additions or changes to Plan 9.
-There is no guarantee that any patch will be accepted, nor
-that it will be accepted verbatim.
-Each patch has a 
-.I name
-(lowercase letters, numbers, dash, dot, and underscore only)
-and is stored in
-.BI /n/sources/patch/ name.
-.PP
-.I Patch/create
-creates a new patch consisting of the changes to
-the listed files from the distribution, reading
-a description of the patch from standard input:
-please provide an explanation of what the change is supposed to do,
-some context, and a rationale for the change.
-Test data or pointers to same to verify that the fix works are also welcome.
-When sending a patch, follow these guidelines:
-.IP • 3
-Before preparing the patch, run
-.I replica/pull
-and base your patch on current distribution source code.
-.IP •
-If this is a bug fix, explain the bug clearly.
-Don't assume the bug is obvious from the fix.
-.IP •
-If this is a new feature, explain it clearly.
-Don't assume it is obvious from the change.
-.IP •
-Make the new code look as much like the old code as possible:
-don't make gratuitous changes, and do follow the style of the old code.
-See
-.IR style (6)
-for the canonical Plan 9 coding style.
-.IP •
-If your patch changes externally-visible behaviour,
-update the manual page.
-.PP
-The
-.I email
-address, if not
-.LR - ,
-will be sent notification messages when the patch is applied, rejected,
-or commented on.
-If rejected, the e-mail will contain a note explaining why and
-probably listing suggested changes and encouraging you to resubmit.
-.PP
-.I Patch/list
-displays information about the named patches,
-or all currently pending patches if none are specified.
-.PP
-.I Patch/diff
-shows a patch as diffs between the original
-source files and the patched source files.
-.PP
-.I Patch/apply
-applies the patch to the current source tree.
-It is intended to be run by the Plan 9 developers with
-.B pie
-as their root file system.
-If the source has changed since the patch was
-created,
-.I apply
-will report the conflict and not change any files.
-Before changing any files,
-.I patch/apply
-makes backup copies of the current source tree's
-files.  The backups are stored in the patch directory.
-.PP
-.I Patch/undo
-will copy the backups saved by
-.I patch/apply
-back into the source tree.
-It will not restore a backup if the file
-being replaced is not byte-identical to the one
-created by 
-.I patch/apply.
-.SH EXAMPLES
-Propose a change to
-.IR pwd ,
-which you have modified locally:
-.IP
-.EX
-% patch/create pwd-errors user@host.dom /sys/src/cmd/pwd.c
-Fix pwd to print errors to fd 2 rather than 1.
-^D
-% 
-.EE
-.PP
-Then the developers at Bell Labs run
-.IP
-.EX
-patch/diff pwd-errors
-.EE
-.PP
-to inspect the change (possibly viewing
-.B /n/sources/patch/pwd-errors/pwd.c
-to see the larger context).
-To make the change, they run
-.IP
-.EX
-patch/apply pwd-errors
-.EE
-.LP
-Otherwise they run
-.IP
-.EX
-% patch/note pwd-errors
-Pwd should definitely print errors to fd 1 because ...
-^D
-% 
-.EE
-.PP
-to add a note to the 
-.B /n/sources/pwd-errors/notes
-file.
-.SH FILES
-.B /n/sources/patch
-.SH SOURCE
-.B /rc/bin/patch
-.SH SEE ALSO
-.IR diff (1)
-.br
-.B http://plan9.bell-labs.com/wiki/plan9/How_to_contribute


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9front] [PATCH] patch(1): remove dead link
  2022-02-02 17:46 ` ori
@ 2022-02-04 18:11   ` craekz
  2022-02-15 21:34   ` craekz
  1 sibling, 0 replies; 4+ messages in thread
From: craekz @ 2022-02-04 18:11 UTC (permalink / raw)
  To: 9front

On Wed, Feb 02, 2022 at 12:46:27PM -0500, ori@eigenstate.org wrote:
> Quoth craekz <craekz7@gmail.com>:
> > It seems like this link is dead and shouldn't be mentioned anymore.
> > 
> > ---
> > diff --git a/sys/man/1/patch b/sys/man/1/patch
> > index 3fb4a490c..badb9298c 100644
> > --- a/sys/man/1/patch
> > +++ b/sys/man/1/patch
> > @@ -154,5 +154,3 @@ file.
> >  .B /rc/bin/patch
> >  .SH SEE ALSO
> >  .IR diff (1)
> > -.br
> > -.B http://plan9.bell-labs.com/wiki/plan9/How_to_contribute
> > 
> 
> How about we drop the whole thing instead, since
> that's not how you submit patches to 9front?
If it's just legacy, sure. I think there aren't much people using this
thing or even know about it.

> it also makes room for (eventually) a native,
> simplified version of ape/patch, which can
> live in /bin/patch.
Which would be great!

--
craekz

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [9front] [PATCH] patch(1): remove dead link
  2022-02-02 17:46 ` ori
  2022-02-04 18:11   ` craekz
@ 2022-02-15 21:34   ` craekz
  1 sibling, 0 replies; 4+ messages in thread
From: craekz @ 2022-02-15 21:34 UTC (permalink / raw)
  To: 9front

ping
Anyone?
-- 
craekz

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2022-02-16 10:38 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-02 16:42 [9front] [PATCH] patch(1): remove dead link craekz
2022-02-02 17:46 ` ori
2022-02-04 18:11   ` craekz
2022-02-15 21:34   ` craekz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).