trap "status=$?; echo cleaning up...; rm -rf orig-linux-$kver linux-$kver linux-$kver-$libre linux-$kver.tar linux-$kver-$libre.tar linux-$kver-$libre.tar.bz2 linux-$kver-$libre.patch linux-$kver-$libre.xdelta; (exit $status); exit" 0 1 2 15
+set -e
+
echo Uncompressing linux-$kver.tar.bz2 into linux-$kver.tar
rm -rf linux-$kver linux-$kver.tar
bunzip2 < linux-$kver.tar.bz2 > linux-$kver.tar
echo Removing removed or modified files from linux-$kver-$libre.tar
diff -rq linux-$kver linux-$kver-$libre |
sed -n "
- s,^Only in \(linux-$kver/\?.*\): \(.*\),\1/\2,p;
- s,^Files \(linux-$kver\)/\(.*\) and \1-$libre/\2 differ,\1/\2,p;
+ s,^Only in \\(linux-$kver\\(/.*\\)\\?\\): \\(.*\\),\1/\3,p;
+ s,^Files \\(linux-$kver\\)/\\(.*\\) and \\1-$libre/\\2 differ,\\1/\\2,p;
" |
xargs tar --delete -f linux-$kver-$libre.tar
mv linux-$kver-$libre linux-$kver
diff -rq orig-linux-$kver linux-$kver |
sed -n "
- s,^Files orig-\(linux-$kver/.*\) and \1 differ,\1,p;
- s,^Only in \(linux-$kver/?.*\): \(.*\),\1/\2,p;
+ s,^Files orig-\\(linux-$kver/.*\\) and \\1 differ,\\1,p;
+ s,^Only in \\(linux-$kver\\(/.*\\)\\?\\): \\(.*\\),\\1/\\3,p;
" |
xargs tar --append -f linux-$kver-$libre.tar