diff options
author | Marc Kleine-Budde <mkl@pengutronix.de> | 2010-07-19 09:53:55 +0200 |
---|---|---|
committer | Marc Kleine-Budde <mkl@pengutronix.de> | 2010-07-19 12:01:22 +0200 |
commit | 4db2105e5de7a593a9295df2a33865599709453d (patch) | |
tree | 53ca854acd9365f19d1f5a3348be3d0b5fca7964 /bin | |
parent | 8a9f2c6500efc62841cd18214737b63cdc99e6c6 (diff) | |
download | ptxdist-4db2105e5de7a593a9295df2a33865599709453d.tar.gz ptxdist-4db2105e5de7a593a9295df2a33865599709453d.tar.xz |
[ptxdist] clean: remove everything even in production builds
Signed-off-by: Marc Kleine-Budde <mkl@pengutronix.de>
Diffstat (limited to 'bin')
-rwxr-xr-x | bin/ptxdist | 27 |
1 files changed, 18 insertions, 9 deletions
diff --git a/bin/ptxdist b/bin/ptxdist index 7f02a9a0a..e8130f645 100755 --- a/bin/ptxdist +++ b/bin/ptxdist @@ -918,23 +918,32 @@ clean() { local ptxconf_sysroot_host="$(ptxd_get_ptxconf PTXCONF_SYSROOT_HOST)" local ptxconf_sysroot_cross="$(ptxd_get_ptxconf PTXCONF_SYSROOT_CROSS)" local ptxconf_gnu_target="$(ptxd_get_ptxconf PTXCONF_GNU_TARGET)" + local ptxconf_project_build_production="$(ptxd_get_ptxconf PTXCONF_PROJECT_BUILD_PRODUCTION)" for dir in "${ptxconf_sysroot_target}" "${ptxconf_sysroot_host}" "${ptxconf_sysroot_cross}"; do - if [ ! -d "${dir}" ]; then - continue - fi + if [ ! -d "${dir}" ]; then + continue + fi + + if [ -n "${ptxconf_project_build_production}" ]; then + # + # in case of a production build, delete sysroots. + # it makes no sense to keep them, + # but delete the image and state dirs + # + rm -fr -- "${dir}" + else # # remove the dir only if it is inside the workspace; if we for - # example build toolchains or production builds to /opt/..., + # example build toolchains to /opt/..., # we don't want to clean them here! # case "${dir}" in - (${PTXDIST_WORKSPACE}/*) - rm -fr -- "${dir}" - ;; - (*) - ;; + (${PTXDIST_WORKSPACE}/*) + rm -fr -- "${dir}" ;; + (*) ;; esac + fi done # this is for ptxdist-1 backward compatibility |