apatch/apatch
2022-04-25 21:16:04 +02:00

19 lines
504 B
Bash

#!/bin/sh
[ -f APKBUILD ] || ( echo "please run this in a package directory"; exit 1 )
[ ! -f "$1" ] || ( echo "patch $1 already exists"; exit 1 )
[ "$1" != "" ] || ( echo "usage: apatch <patch name>"; exit 1 )
abuild clean fetch unpack prepare
# obtain builddir
. APKBUILD
[ -z "$builddir" ] && builddir="/$pkgname-$pkgver"
cp -r src src-old
(
cd "src$builddir"
$SHELL
)
busybox diff -U3 -r "src-old$builddir" "src$builddir" | sed "s|src-old$builddir|a|g;s|src$builddir|b|g" > $1
rm -rf src-old