#! /bin/sh

debian_series=debian/patches/series-rt
rt_series="$(mktemp)"

trap 'rm "$rt_series"' INT QUIT EXIT

# Remove comments and empty lines. Drop localversion patch as uname version
# shouldn't be touched. Reformat to match series format.
sed -r -e 's/ *#.*//; /^$/d; /^....-(localversion\.patch|Linux-.*-REBASE)\.patch$/d; s,.*,features/all/rt/&,' "debian/patches/features/all/rt/series" > "$rt_series"

# removed lines are OK if the rt patch contains fixes that are applied on
# featureset=none kernels, too.
diff -u --label "debian/patches/features/all/rt/series" --label "debian/patches/series/base-extra" "$rt_series" "$debian_series"
