Browse Source

Patching scripts

fpco
Michael Snoyman 9 years ago
parent
commit
bbec9acf5d
  1. 3
      patching/.gitignore
  2. 23
      patching/scripts/create-patches.sh
  3. 21
      patching/scripts/create-tarballs.sh
  4. 6
      patching/scripts/edit-package.sh

3
patching/.gitignore

@ -0,0 +1,3 @@
/patches
/tarballs
/work

23
patching/scripts/create-patches.sh

@ -0,0 +1,23 @@
#!/bin/bash -ex
mkdir -p patches work
for f in work/*
do
(
cd $f
PKG=$(basename $(pwd))
cabal sdist
cd ../..
rm -rf tmp
mkdir tmp
cd tmp
tar zxfv ../$f/dist/$PKG.tar.gz
mv $PKG new
cabal unpack $PKG
mv $PKG orig
diff -ru orig new > ../patches/$PKG.patch || true
cd ..
rm -rf tmp
)
done

21
patching/scripts/create-tarballs.sh

@ -0,0 +1,21 @@
#!/bin/bash -ex
mkdir -p tarballs
for f in patches/*
do
(
PKG1=$(basename $f)
PKG=${PKG1%.patch}
rm -rf tmp
mkdir tmp
cd tmp
cabal unpack $PKG
cd $PKG
patch -p1 < ../../$f
cabal sdist
mv dist/$PKG.tar.gz ../../tarballs
cd ..
rm -rf tmp
)
done

6
patching/scripts/edit-package.sh

@ -0,0 +1,6 @@
#!/bin/bash -ex
mkdir -p work
cd work
rm -rf $1
cabal unpack $1
Loading…
Cancel
Save