summaryrefslogtreecommitdiffstats
path: root/bin/debian-patches-unapply
blob: fc7f204c19d67ec747c8b6044a05d7e86507100b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh

if [ -e patches/series ] && [ "$(basename ${PWD})" = "debian" ]
then
	cd ..
fi

if [ -e debian/patches/series ]
then
	for PATCH in $(grep -v '^#' debian/patches/series | reverse)
	do
		echo -n "${PATCH}:"

		patch -Np1 -R -s -i "debian/patches/${PATCH}" > /dev/null 2>&1

		case "${?}" in
			0)
				echo " Ok"
				;;

			*)
				echo " Failed"
				;;
		esac
	done
else
	echo "package does not have patches"
fi