aboutsummaryrefslogtreecommitdiff
path: root/conv
blob: 7d5a50896e53f50f4e5efe511ba01d9df97546a4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

# conv -- convert git diff -p output to pkgsrc patch

IFS='
'

echo '$NetBSD'
echo
sed '
	/^diff/d;
	/^index/d;
	s/^--- .*/&/;
' |
while read line; do
	case "$line" in
	diff*)	;;
	index*)	;;
	'--- a/'*)
		file=${line#--- a/}
		echo -n "--- $file.orig	"
		echo "$(stat -x "$file")" | sed -n 's/^Access: //p' ;;
	'+++ b/'*)
		echo "+++ ${line#+++ b/}" ;;
	*)
		echo "$line" ;;
	esac
done