Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
How to create diff file for gentoo ebuild patch

An example to patch unixODBC-2.3.0 on a 64bit machine to work with oracle 8.

First download unixODBC source. mkdir /tmp/unixODBC/source

Create two new folder. mkdir /tmp/unixODBC/patch/original mkdir /tmp/unixODBC/patch/unixODBC-2.3.0/DriverManager/

cp /tmp/unixODBC/source/unixODBC-2.3.0/DriverManager/SQLConnect.c /tmp/unixODBC/patch/original
cp /tmp/unixODBC/source/unixODBC-2.3.0/DriverManager/SQLConnect.c /tmp/unixODBC/patch/unixODBC-2.3.0/DriverManager

Edit /tmp/unixODBC/patch/unixODBC-2.3.0/DriverManager/SQLConnect.c according this forum thread. #
cd /tmp/unixODBC/patch diff -u /tmp/unixODBC/patch/original/SQLConnect.c /tmp/unixODBC/patch/unixODBC-2.3.0/DriverManager/SQLConnect.c > 901-unixODBC-2.3.0-oracle-fixes.patch

Copy 901-unixODBC-2.3.0-oracle-fixes.patch to ebuild dir cp /tmp/unixODBC/patch/901-unixODBC-2.3.0-oracle-fixes.patch /usr/local/dev-db/unixODBC/files

# Modify ebuild file add follwing line to src_prepare()
epatch "${FILESDIR}/901-unixODBC-2.3.0-oracle-fixes.patch"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.