build: fix STAGING_DIR cleaning for packages
authorJeffery To <jeffery.to@gmail.com>
Wed, 12 Dec 2018 17:33:36 +0000 (01:33 +0800)
committerJo-Philipp Wich <jo@mein.io>
Wed, 30 Jan 2019 11:32:07 +0000 (12:32 +0100)
commita1170936798e519776de605d6986ccb72f04cb06
treee7dce9b0785f28b50dd45ffbfac33b6050fc22a0
parented514e7f9ecc557fdddf2e22f3ad372affc1999b
build: fix STAGING_DIR cleaning for packages

This fixes two issues with cleaning package files from STAGING_DIR:

* CleanStaging currently can only remove files and not directories. This
  changes CleanStaging to use clean-package.sh, which does remove
  directories.

* Because of the way directories are ordered in the staging files list,
  clean-package.sh currently tries (and fails) to remove parent
  directories before removing subdirectories. This changes
  clean-package.sh to process the staging files list in reverse, so that
  subdirectories are removed first.

Signed-off-by: Jeffery To <jeffery.to@gmail.com>
include/package.mk
scripts/clean-package.sh