diff options
author | John Ankarström <john@ankarstrom.se> | 2021-06-07 01:23:39 +0200 |
---|---|---|
committer | John Ankarström <john@ankarstrom.se> | 2021-06-07 01:23:39 +0200 |
commit | 10afde33e2d3281c1cd807b978480bef19026351 (patch) | |
tree | 7284d907f64c0bccddd5bdb049e0f785c7ff1147 /conv | |
download | patches-10afde33e2d3281c1cd807b978480bef19026351.tar.gz |
Add 'sum' and 'conv' utilities
Diffstat (limited to 'conv')
-rwxr-xr-x | conv | 28 |
1 files changed, 28 insertions, 0 deletions
@@ -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 |