Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found

Target

Select target project
  • ghc/head.hackage
  • RyanGlScott/head.hackage
  • vaibhavsagar/head.hackage
  • phadej/head.hackage
  • jessoune29/head.hackage
  • alanz/head.hackage
  • clint/head.hackage
  • osa1/head.hackage
  • supersven/head.hackage
  • fendor/head.hackage
  • hsyl20/head.hackage
  • adinapoli/head.hackage
  • alexbiehl/head.hackage
  • mimi.vx/head.hackage
  • Kleidukos/head.hackage
  • wz1000/head.hackage
  • alinab/head.hackage
  • teo/head.hackage
  • duog/head.hackage
  • sheaf/head.hackage
  • expipiplus1/head.hackage
  • drsooch/head.hackage
  • tobias/head.hackage
  • brandonchinn178/head.hackage
  • mpickering/hooks-setup-testing
  • Mikolaj/head.hackage
  • RandomMoonwalker/head.hackage
  • facundominguez/head.hackage
  • trac-fizzixnerd/head.hackage
  • neil.mayhew/head.hackage
  • jappeace/head.hackage
31 results
Show changes
Commits on Source (8)
......@@ -103,7 +103,13 @@ $ cp ${WhereThisGitHubRepoIsCloned}/patches/$PKGID.cabal ./*.cabal
$ cd ..
```
TODO: implement script
Alternatively, you can use the handy `patch-tool` utility:
```
$ scripts/patch-tool unpack-patch patches/$PKGID.patch
```
This will extract the given package into the `packages/$PKGID` directory,
initialize it as a git repository, and the patch.
### Adding a patch
......
......@@ -33,16 +33,32 @@ drop_old() {
add_pkg_dirs() {
local dirs=$@
echo "packages: $dirs" >> cabal.project.local
echo "optional-packages: $dirs" >> cabal.project.local
echo "Added $dirs to cabal.project.local"
}
patch_pkg() {
local patch=$(basename $1)
local pkg=$(basename $patch .patch)
local pkg=$(basename $1 .patch)
local pkg_dir=packages/$pkg
git -C $pkg_dir apply $patches_dir/$patch.patch
git -C $pkg_dir commit -a -m "head.hackage.org patch"
local patch=$patches_dir/$pkg.patch
local cabal=$patches_dir/$pkg.cabal
local patched=
if [ -f "$patch" ]; then
echo "Applied patch $patch to $pkg"
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"
fi
}
unpack_patch_pkg() {
......@@ -53,8 +69,8 @@ unpack_patch_pkg() {
}
unpack_patch_all() {
for p in $patches_dir/*; do
patch_pkg $p
for p in $patches_dir/*.patch; do
unpack_patch_pkg $p
done
}
......@@ -71,7 +87,7 @@ unpack_pkg() {
cd $pkg_dir
git init
git add .
git commit -m "Initial commit"
git commit -q -m "Initial commit of $pkg"
git tag upstream
popd
add_pkg_dirs packages/$pkg_dir
......@@ -93,8 +109,9 @@ usage() {
usage: $0 MODE ...
Modes:
unpack \$pkg unpack the given package into packages/
unpack-patch \$pkg unpack and apply patches to the given package
unpack-all unpack and patch all packages with patches
unpack \$pkg unpack the given package into packages/
unpack-patch \$pkg unpack and apply patches to the given package
update-patches update patches for all unpacked packages
drop-old drop patches for obsolete package versions
EOF
......@@ -110,7 +127,7 @@ case "X$1" in
;;
Xunpack-patch)
patch=$1
patch=$2
unpack_pkg $(basename $patch .patch)
patch_pkg $patch
;;
......