feat: even more fancy log messages
This commit is contained in:
parent
a85bf4c080
commit
4e824d06f5
1 changed files with 20 additions and 13 deletions
33
apatch
33
apatch
|
@ -71,25 +71,32 @@ if [ -f "$patch" ]; then
|
|||
fi
|
||||
|
||||
(
|
||||
cd "$builddir"
|
||||
git init
|
||||
git add .
|
||||
git commit -m "$pkgver" >/dev/null
|
||||
cd "$builddir"
|
||||
git init
|
||||
git add .
|
||||
git commit -m "$pkgver" >/dev/null
|
||||
|
||||
# if file exists, try to apply
|
||||
if [ -e "$patchpath" ]; then
|
||||
git apply --reject --whitespace=fix "$patchpath" || {
|
||||
git status --porcelain | grep '\?\? .*\.rej$' | cut -c4- | while read -r reject; do
|
||||
target="${reject%.rej}"
|
||||
echo "[*] trying to wiggle $target"
|
||||
wiggle --merge --replace "$target" "$reject" || {
|
||||
echo "[!] could not merge $target, fix manually"
|
||||
}
|
||||
rm "$reject"
|
||||
rm "$target.porig" # left by wiggle
|
||||
done
|
||||
rejects="$(git status --porcelain | grep '\?\? .*\.rej$' | cut -c4-)"
|
||||
if [ -n "$rejects" ]; then
|
||||
warning "$patch partially applied with rejects"
|
||||
for reject in $rejects; do
|
||||
target="${reject%.rej}"
|
||||
msg "trying to wiggle $target"
|
||||
wiggle --merge --replace "$target" "$reject" || {
|
||||
warning "could not merge $target, fix manually"
|
||||
}
|
||||
rm "$reject"
|
||||
rm "$target.porig" # left by wiggle
|
||||
done
|
||||
else
|
||||
warning "$patch failed to apply"
|
||||
fi
|
||||
}
|
||||
fi
|
||||
msg "you can edit now!"
|
||||
|
||||
$SHELL
|
||||
|
||||
|
|
Loading…
Reference in a new issue