diff mbox

builddeb: clean up the linux-headers package by using tar exclude option

Message ID 1397563424-10134-1-git-send-email-fathi.boudra@linaro.org (mailing list archive)
State New, archived
Headers show

Commit Message

Fathi Boudra April 15, 2014, 12:03 p.m. UTC
Use tar --exclude option to clean up the kernel headers package
 (linux-headers) from unecessary files.

Signed-off-by: Fathi Boudra <fathi.boudra@linaro.org>
---
 scripts/package/builddeb | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff mbox

Patch

diff --git a/scripts/package/builddeb b/scripts/package/builddeb
index f46e4dd..f5ac45d 100644
--- a/scripts/package/builddeb
+++ b/scripts/package/builddeb
@@ -293,8 +293,9 @@  fi
 (cd $objtree; find arch/$SRCARCH/include Module.symvers include scripts -type f >> "$objtree/debian/hdrobjfiles")
 destdir=$kernel_headers_dir/usr/src/linux-headers-$version
 mkdir -p "$destdir"
-(cd $srctree; tar -c -f - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -)
-(cd $objtree; tar -c -f - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -)
+excludes="--exclude-vcs --exclude=*.cmd --exclude=*.o --exclude=Documentation"
+(cd $srctree; tar $excludes -cf - -T "$objtree/debian/hdrsrcfiles") | (cd $destdir; tar -xf -)
+(cd $objtree; tar $excludes -cf - -T "$objtree/debian/hdrobjfiles") | (cd $destdir; tar -xf -)
 (cd $objtree; cp $KCONFIG_CONFIG $destdir/.config) # copy .config manually to be where it's expected to be
 ln -sf "/usr/src/linux-headers-$version" "$kernel_headers_dir/lib/modules/$version/build"
 rm -f "$objtree/debian/hdrsrcfiles" "$objtree/debian/hdrobjfiles"