aboutsummaryrefslogtreecommitdiff
path: root/pkgpatch
blob: 408edc41c4abe465ebca343c4ad0b8da73766948 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/sh

# pkgpatch -- patch but don't overwrite original files

move()
{
	echo "${0##*/}: renaming *.$1 to *.$2..." 1>&2
	for orig in *.$1; do
		mv -i "$orig" "${orig%.$1}".$2
	done
}

move orig ~1~
trap 'move ~1~ orig; trap -' INT QUIT TERM EXIT
patch -Vt -F3 "$@"