diff --git a/scripts/build b/scripts/build index b741872626..2dc4f221d6 100755 --- a/scripts/build +++ b/scripts/build @@ -325,31 +325,30 @@ if [ ! -f $STAMP ]; then fi if [ "$TARGET" = "target" -o "$TARGET" = "init" ]; then - if [ -d $INSTALL ] ; then - for i in $INSTALL $INSTALL/usr; do - rm -rf $i/include - rm -rf $i/lib/cmake - rm -rf $i/lib/pkgconfig - rm -rf $i/man - rm -rf $i/share/aclocal - rm -rf $i/share/bash-completion - rm -rf $i/share/doc - rm -rf $i/share/gtk-doc - rm -rf $i/share/info - rm -rf $i/share/locale - rm -rf $i/share/man - rm -rf $i/share/pkgconfig - find $i -name "*.la" -exec rm -f "{}" ";" 2>/dev/null || true - find $i -name "*.a" -exec rm -f "{}" ";" 2>/dev/null || true - find $i -name "*.so*T" -exec rm -f "{}" ";" 2>/dev/null || true - # patch backups nonsense - find $i -name "*.orig" -exec rm -f "{}" ";" 2>/dev/null || true - # kodi / addons nonsense - find $i -name "addon.xml.in" -exec rm -f "{}" ";" 2>/dev/null || true - find $i -name "Makefile.in" -exec rm -f "{}" ";" 2>/dev/null || true - done - - find $INSTALL -type d -exec rmdir -p "{}" ";" 2>/dev/null || true + if [ -d $INSTALL ] ; then + rm -rf $INSTALL/{usr/,}include + rm -rf $INSTALL/{usr/,}lib/cmake + rm -rf $INSTALL/{usr/,}lib/pkgconfig + rm -rf $INSTALL/{usr/,}man + rm -rf $INSTALL/{usr/,}share/aclocal + rm -rf $INSTALL/{usr/,}share/bash-completion + rm -rf $INSTALL/{usr/,}share/doc + rm -rf $INSTALL/{usr/,}share/gtk-doc + rm -rf $INSTALL/{usr/,}share/info + rm -rf $INSTALL/{usr/,}share/locale + rm -rf $INSTALL/{usr/,}share/man + rm -rf $INSTALL/{usr/,}share/pkgconfig + rm -rf $INSTALL/{usr/,}share/zsh + rm -rf $INSTALL/{usr/,}var + find $INSTALL \( -name "*.orig" \ + -o -name "*.rej" \ + -o -name "*.a" \ + -o -name "*.la" \ + -o -name "*.o" \ + -o -name "*.in" \ + -o -name ".git*" \) \ + -exec rm -f {} \; 2>/dev/null || : + find $INSTALL -type d -exec rmdir -p {} \; 2>/dev/null || : if [ ! "$DEBUG" = yes ]; then $STRIP `find $INSTALL \