Skip to content
Snippets Groups Projects
Commit f1d444ff authored by Ben Gamari's avatar Ben Gamari :turtle:
Browse files

patch-tool: Apply cabal file patches

parent c15cbc01
No related branches found
No related tags found
No related merge requests found
...@@ -39,12 +39,24 @@ add_pkg_dirs() { ...@@ -39,12 +39,24 @@ add_pkg_dirs() {
patch_pkg() { patch_pkg() {
local pkg=$(basename $1 .patch) local pkg=$(basename $1 .patch)
local pkg_dir=packages/$pkg
local patch=$patches_dir/$pkg.patch local patch=$patches_dir/$pkg.patch
if [ ! -e "$patch" ]; then local cabal=$patches_dir/$pkg.cabal
echo "No patches for $pkg; skipping patching." return
else local patched=
local pkg_dir=packages/$pkg if [ -f "$patch" ]; then
echo "Applied patch $patch to $pkg"
git -C $pkg_dir apply $patch git -C $pkg_dir apply $patch
patched=1
fi
if [ -f "$cabal" ]; then
echo "Updated cabal file of $pkg with $cabal"
cp "$cabal" $pkg_dir/*.cabal
patched=1
fi
if [ -n "$patched" ]; then
git -C $pkg_dir commit -q -a -m "head.hackage.org patch" git -C $pkg_dir commit -q -a -m "head.hackage.org patch"
fi fi
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment