From bbec9acf5d6e04042b88fedd8262e8b16bf43f15 Mon Sep 17 00:00:00 2001 From: Michael Snoyman Date: Sun, 30 Jun 2013 13:14:05 +0300 Subject: [PATCH] Patching scripts --- patching/.gitignore | 3 +++ patching/scripts/create-patches.sh | 23 +++++++++++++++++++++++ patching/scripts/create-tarballs.sh | 21 +++++++++++++++++++++ patching/scripts/edit-package.sh | 6 ++++++ 4 files changed, 53 insertions(+) create mode 100644 patching/.gitignore create mode 100755 patching/scripts/create-patches.sh create mode 100755 patching/scripts/create-tarballs.sh create mode 100755 patching/scripts/edit-package.sh diff --git a/patching/.gitignore b/patching/.gitignore new file mode 100644 index 00000000..ea9a1cd4 --- /dev/null +++ b/patching/.gitignore @@ -0,0 +1,3 @@ +/patches +/tarballs +/work diff --git a/patching/scripts/create-patches.sh b/patching/scripts/create-patches.sh new file mode 100755 index 00000000..6f7a4c7d --- /dev/null +++ b/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 diff --git a/patching/scripts/create-tarballs.sh b/patching/scripts/create-tarballs.sh new file mode 100755 index 00000000..f9bd3cb0 --- /dev/null +++ b/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 diff --git a/patching/scripts/edit-package.sh b/patching/scripts/edit-package.sh new file mode 100755 index 00000000..7cdd6352 --- /dev/null +++ b/patching/scripts/edit-package.sh @@ -0,0 +1,6 @@ +#!/bin/bash -ex + +mkdir -p work +cd work +rm -rf $1 +cabal unpack $1