feat: allow updating a patch
This commit is contained in:
parent
547480a378
commit
a065129fdb
1 changed files with 5 additions and 1 deletions
6
apatch
Normal file → Executable file
6
apatch
Normal file → Executable file
|
@ -1,7 +1,10 @@
|
|||
#!/bin/sh
|
||||
|
||||
startdir="$PWD"
|
||||
patch_exists=0
|
||||
|
||||
[ -f APKBUILD ] || ( echo "please run this in a package directory"; exit 1 )
|
||||
[ ! -f "$1" ] || ( echo "patch $1 already exists"; exit 1 )
|
||||
[ -f "$1" ] && patch_exists=1
|
||||
[ "$1" != "" ] || ( echo "usage: apatch <patch name>"; exit 1 )
|
||||
|
||||
abuild clean fetch unpack prepare
|
||||
|
@ -13,6 +16,7 @@ abuild clean fetch unpack prepare
|
|||
cp -r src src-old
|
||||
(
|
||||
cd "src$builddir"
|
||||
[ "$patch_exists" -eq 1 ] && patch -p1 < "$startdir/$1"
|
||||
$SHELL
|
||||
)
|
||||
busybox diff -U3 -r "src-old$builddir" "src$builddir" | sed "s|src-old$builddir|a|g;s|src$builddir|b|g" > $1
|
||||
|
|
Loading…
Reference in a new issue