aboutsummaryrefslogtreecommitdiff
path: root/conv
diff options
context:
space:
mode:
Diffstat (limited to 'conv')
-rwxr-xr-xconv28
1 files changed, 28 insertions, 0 deletions
diff --git a/conv b/conv
new file mode 100755
index 0000000..7d5a508
--- /dev/null
+++ b/conv
@@ -0,0 +1,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