Mercurial > hg > dml-open-cliopatria
comparison cpack/dml/scripts/compression/zdiff @ 0:718306e29690 tip
commiting public release
author | Daniel Wolff |
---|---|
date | Tue, 09 Feb 2016 21:05:06 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:718306e29690 |
---|---|
1 #!/usr/bin/env bash | |
2 # diff <reference:filename> | |
3 # Produces on standard output ed script required to recreate standard input given reference. | |
4 here="$(dirname "$0")" | |
5 function encode { "$here/bufs" 1 "$here/prefix" <(diff -e <(xxd -p -c 1 < "$1") <(xxd -p -c 1)); } | |
6 # function decode { "$here/bufs" 1 "$here/unprefix" <(cat) | patch -e -o >(xxd -r -p -c 1) <(xxd -p -c 1 < "$1"); } | |
7 function decode { ("$here/bufs" 1 "$here/unprefix" <(cat) && echo ,p) | ed -s <(xxd -p -c 1 < "$1") | xxd -r -p -c 1; } | |
8 "$@" | |
9 xxd -c 1 -p | xxd -r -c 1 -p |