mailarchive of the ptxdist mailing list
 help / color / mirror / Atom feed
* [ptxdist] [PATCH 1/2] ptxdist: introduce the "clean target" subcommand
@ 2019-05-17 10:12 Roland Hieber
  2019-05-17 10:12 ` [ptxdist] [PATCH 2/2] ptxdist: clean root should clean all image packages too Roland Hieber
  2019-05-17 14:47 ` [ptxdist] [PATCH 1/2] ptxdist: introduce the "clean target" subcommand Michael Olbrich
  0 siblings, 2 replies; 3+ messages in thread
From: Roland Hieber @ 2019-05-17 10:12 UTC (permalink / raw)
  To: ptxdist; +Cc: Roland Hieber

From: Roland Hieber <rhi@pengutronix.de>

Signed-off-by: Roland Hieber <rhi@pengutronix.de>
---
 bin/ptxdist           | 17 +++++++++++++++++
 doc/ref_parameter.inc |  6 ++++++
 2 files changed, 23 insertions(+)

diff --git a/bin/ptxdist b/bin/ptxdist
index f52a668d3..a7be5cb3e 100755
--- a/bin/ptxdist
+++ b/bin/ptxdist
@@ -963,6 +963,7 @@ Clean Actions:
 
   clean				cleanup build-host and build-cross dirs
   clean root			cleanup root directory for target
+  clean target			cleanup all target packages
   distclean			cleanup everything
 
 Misc:
@@ -1059,6 +1060,22 @@ clean() {
 		return
 	fi
 
+	# we want to clean all target packages
+	if [ "${1}" = "target" ]; then
+		if [ ! -n "${PTXDIST_FORCE}${PTXDIST_QUIET}${PTXCONF_SETUP_DIRECT_CLEAN}" ]; then
+			read -e -p "really clean all target packages? [y/N] " r
+			case "${r}" in
+				y|Y) ;;
+				*) exit 1 ;;
+			esac
+		fi
+		check_premake_compiler &&
+		pkgs=($(ptxd_make "/print-PACKAGES /print-EXTRA_PACKAGES /print-LAZY_PACKAGES")) &&
+		ptxd_make_log "${pkgs[@]/%/_clean}" &&
+		clean root
+		return
+	fi
+
 	# we want to clean a single package
 	if [ -n "${1}" ]; then
 		check_if_selected "${@}" &&
diff --git a/doc/ref_parameter.inc b/doc/ref_parameter.inc
index 0b11563c9..4aecb0471 100644
--- a/doc/ref_parameter.inc
+++ b/doc/ref_parameter.inc
@@ -162,6 +162,12 @@ Clean Actions
   The ``clean root`` and ``go`` action is useful if the
   *targetinstall* stage for all packages should run again.
 
+``clean target``
+  this action will call the ``clean`` action for each target package,
+  and also clean the root file system afterwards.
+  This can be useful if you want to rebuild the target file system from
+  scratch, without throwing away the already built host and cross packages.
+
 ``clean <package>``
   this action will only clean the dedicated
   <package>. It will remove its build directory and all installed files
-- 
2.20.1


_______________________________________________
ptxdist mailing list
ptxdist@pengutronix.de

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2019-05-17 14:47 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-05-17 10:12 [ptxdist] [PATCH 1/2] ptxdist: introduce the "clean target" subcommand Roland Hieber
2019-05-17 10:12 ` [ptxdist] [PATCH 2/2] ptxdist: clean root should clean all image packages too Roland Hieber
2019-05-17 14:47 ` [ptxdist] [PATCH 1/2] ptxdist: introduce the "clean target" subcommand Michael Olbrich

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox