Plan 9 from Bell Labs’s /usr/web/sources/plan9/rc/bin/patch/move

Copyright © 2021 Plan 9 Foundation.
Distributed under the MIT License.
Download the Plan 9 distribution.


#!/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
}

Bell Labs OSI certified Powered by Plan 9

(Return to Plan 9 Home Page)

Copyright © 2021 Plan 9 Foundation. All Rights Reserved.
Comments to [email protected].