baa2bfa
#!/bin/bash
baa2bfa
e58e944
LIBSELINUX_VERSION=2.5-rc1
e58e944
REPO=https://github.com/fedora-selinux/selinux
e58e944
BRANCH=master-rc
baa2bfa
baa2bfa
REBASEDIR=`mktemp -d rebase.XXXXXX`
baa2bfa
pushd $REBASEDIR
baa2bfa
e58e944
git clone $REPO
baa2bfa
pushd selinux; git checkout $BRANCH; COMMIT=`git rev-parse --verify HEAD`; popd
baa2bfa
baa2bfa
# prepare libselinux-rhat.patch
baa2bfa
tar xfz ../libselinux-$LIBSELINUX_VERSION.tar.gz
baa2bfa
pushd libselinux-$LIBSELINUX_VERSION
baa2bfa
baa2bfa
git init; git add .; git commit -m "init"
baa2bfa
cp -r ../selinux/libselinux/* .
baa2bfa
git add -A .
baa2bfa
baa2bfa
git diff --cached --src-prefix=libselinux-$LIBSELINUX_VERSION/ --dst-prefix=libselinux-$LIBSELINUX_VERSION/ > ../../libselinux-rhat.patch
baa2bfa
baa2bfa
popd
baa2bfa
baa2bfa
popd
baa2bfa
# echo rm -rf $REBASEDIR
baa2bfa
e58e944
echo libselinux-rhat.patch created from $REPO/commit/$COMMIT