packaging: switch find calls from -exec to xargs 54/91954/5 accepted/tizen/mobile/20161114.073913 submit/tizen/20161114.022710
authorSlava Barinov <v.barinov@samsung.com>
Wed, 12 Oct 2016 09:06:23 +0000 (12:06 +0300)
committerInki Dae <inki.dae@samsung.com>
Wed, 2 Nov 2016 01:42:44 +0000 (18:42 -0700)
The -delete and xargs approach is faster than -exec and in Tizen 3.0
cross-builds it grants huge build acceleration due to tool acceleration
system peculiarities.

Change-Id: Ibbbb82962235cd098cd6952c288e9f120bb63ed3
Signed-off-by: Slava Barinov <v.barinov@samsung.com>
packaging/linux-3.10-sc7730.spec

index 0900b54..6b1ac30 100644 (file)
@@ -116,18 +116,18 @@ for i in %{BOARDS}; do
        make modules_install INSTALL_MOD_PATH=%_builddir/mod_$target
 
        # prepare for devel package
-       find %{_builddir}/%{name}-%{version} -name ".tmp_vmlinux*" -exec rm -f {} \;
-       find %{_builddir}/%{name}-%{version} -name "\.*dtb*tmp" -exec rm -f {} \;
-       find %{_builddir}/%{name}-%{version} -name "*\.*tmp" -exec rm -f {} \;
-       find %{_builddir}/%{name}-%{version} -name "vmlinux" -exec rm -f {} \;
-       find %{_builddir}/%{name}-%{version} -name "bzImage" -exec rm -f {} \;
-       find %{_builddir}/%{name}-%{version} -name "zImage" -exec rm -f {} \;
-       find %{_builddir}/%{name}-%{version} -name "dzImage" -exec rm -f {} \;
-       find %{_builddir}/%{name}-%{version} -name "*.cmd" -exec rm -f {} \;
-       find %{_builddir}/%{name}-%{version} -name "*\.ko" -exec rm -f {} \;
-       find %{_builddir}/%{name}-%{version} -name "*\.o" -exec rm -f {} \;
-       find %{_builddir}/%{name}-%{version} -name "*\.S" -exec rm -f {} \;
-       find %{_builddir}/%{name}-%{version} -name "*\.c" -not -path "%{_builddir}/%{name}-%{version}/scripts/*" -exec rm -f {} \;
+       find %{_builddir}/%{name}-%{version} -name ".tmp_vmlinux*" -delete
+       find %{_builddir}/%{name}-%{version} -name "\.*dtb*tmp" -delete
+       find %{_builddir}/%{name}-%{version} -name "*\.*tmp" -delete
+       find %{_builddir}/%{name}-%{version} -name "vmlinux" -delete
+       find %{_builddir}/%{name}-%{version} -name "bzImage" -delete
+       find %{_builddir}/%{name}-%{version} -name "zImage" -delete
+       find %{_builddir}/%{name}-%{version} -name "dzImage" -delete
+       find %{_builddir}/%{name}-%{version} -name "*.cmd" -delete
+       find %{_builddir}/%{name}-%{version} -name "*\.ko" -delete
+       find %{_builddir}/%{name}-%{version} -name "*\.o" -delete
+       find %{_builddir}/%{name}-%{version} -name "*\.S" -delete
+       find %{_builddir}/%{name}-%{version} -name "*\.c" -not -path "%{_builddir}/%{name}-%{version}/scripts/*" -delete
 
        # prepare for the next build
        cd %_builddir
@@ -142,8 +142,8 @@ make mrproper
 make headers_check
 make headers_install INSTALL_HDR_PATH=%{buildroot}/usr
 
-find  %{buildroot}/usr/include -name ".install" | xargs rm -f
-find  %{buildroot}/usr/include -name "..install.cmd" | xargs rm -f
+find  %{buildroot}/usr/include -name ".install" -delete
+find  %{buildroot}/usr/include -name "..install.cmd" -delete
 rm -rf %{buildroot}/usr/include/scsi
 rm -f %{buildroot}/usr/include/asm*/atomic.h
 rm -f %{buildroot}/usr/include/asm*/io.h
@@ -173,7 +173,7 @@ done
 # Assumed that actually there is one board
 ln -s kernel-devel-$i %{buildroot}/boot/kernel/devel/tizen-devel
 
-find %{buildroot}/boot/kernel/ -name "*.h" -exec chmod 644 {} \;
+find %{buildroot}/boot/kernel/ -name "*.h" -print0 | xargs -0 chmod 644
 
 find %{buildroot}/boot/kernel/ -name 'System.map' -not -path "%{buildroot}/boot/kernel/devel/*" > develfiles.pre # for secure storage
 find %{buildroot}/boot/kernel/ -name 'vmlinux' -not -path "%{buildroot}/boot/kernel/devel/*" >> develfiles.pre   # for TIMA