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