dpkg-source: Clean source package from isar-apt

Message ID b52ed340-0a13-4a11-b9a8-6129bfcae5ad@siemens.com
State Accepted, archived
Headers show
Series dpkg-source: Clean source package from isar-apt | expand

Commit Message

Jan Kiszka Nov. 7, 2024, 7:28 a.m. UTC
From: Jan Kiszka <jan.kiszka@siemens.com>

We should not leave the patched sources behind in isar-apt when cleaning
up.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
 meta/classes/dpkg-source.bbclass | 7 +++++++
 1 file changed, 7 insertions(+)

Comments

Uladzimir Bely Nov. 13, 2024, 2:18 p.m. UTC | #1
On Thu, 2024-11-07 at 08:28 +0100, 'Jan Kiszka' via isar-users wrote:
> From: Jan Kiszka <jan.kiszka@siemens.com>
> 
> We should not leave the patched sources behind in isar-apt when
> cleaning
> up.
> 
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
> ---
>  meta/classes/dpkg-source.bbclass | 7 +++++++
>  1 file changed, 7 insertions(+)
> 
> diff --git a/meta/classes/dpkg-source.bbclass b/meta/classes/dpkg-
> source.bbclass
> index a70a392d..a2eb37a4 100644
> --- a/meta/classes/dpkg-source.bbclass
> +++ b/meta/classes/dpkg-source.bbclass
> @@ -20,6 +20,13 @@ do_dpkg_source() {
>  }
>  addtask dpkg_source after do_prepare_build
>  
> +CLEANFUNCS += "deb_clean_source"
> +
> +deb_clean_source() {
> +    repo_del_srcpackage "${REPO_ISAR_DIR}"/"${DISTRO}" \
> +        "${REPO_ISAR_DB_DIR}"/"${DISTRO}" "${DEBDISTRONAME}"
> "${DEBIAN_SOURCE}"
> +}
> +
>  do_deploy_source[depends] += "isar-apt:do_cache_config"
>  do_deploy_source[lockfiles] = "${REPO_ISAR_DIR}/isar.lock"
>  do_deploy_source[dirs] = "${S}"
> -- 
> 2.43.0
> 

Applied to next, thanks.

Patch

diff --git a/meta/classes/dpkg-source.bbclass b/meta/classes/dpkg-source.bbclass
index a70a392d..a2eb37a4 100644
--- a/meta/classes/dpkg-source.bbclass
+++ b/meta/classes/dpkg-source.bbclass
@@ -20,6 +20,13 @@  do_dpkg_source() {
 }
 addtask dpkg_source after do_prepare_build
 
+CLEANFUNCS += "deb_clean_source"
+
+deb_clean_source() {
+    repo_del_srcpackage "${REPO_ISAR_DIR}"/"${DISTRO}" \
+        "${REPO_ISAR_DB_DIR}"/"${DISTRO}" "${DEBDISTRONAME}" "${DEBIAN_SOURCE}"
+}
+
 do_deploy_source[depends] += "isar-apt:do_cache_config"
 do_deploy_source[lockfiles] = "${REPO_ISAR_DIR}/isar.lock"
 do_deploy_source[dirs] = "${S}"