shithub: riscv

ref: 1b4758d596b70384d7f6389171030611a0f97f7c
dir: /rc/bin/patch/remove/

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