* [PATCHv2] dpkg-base: derive "Package" and "Architecture" from .deb in cleanup
@ 2019-02-19 15:05 Henning Schild
2019-02-19 15:08 ` Henning Schild
2019-02-21 15:04 ` Henning Schild
0 siblings, 2 replies; 3+ messages in thread
From: Henning Schild @ 2019-02-19 15:05 UTC (permalink / raw)
To: isar-users; +Cc: Vladislav Jasek, Henning Schild
From: Henning Schild <henning.schild@siemens.com>
Instead of using "sed" pattern magic ask the .debs their name and
architecture and remove exactly that. Especially the hardcoded
Architecture caused problems for packages of architecture "all". If
your recipe created such a package it could never be cleaned because it
simply was not in the arch we expected it in. And now in a rebuild we
can not add an updated version of the "all" deb.
Reported-by: Vladislav Jasek <vladislav.jasek@siemens.com>
Signed-off-by: Henning Schild <henning.schild@siemens.com>
---
meta/classes/dpkg-base.bbclass | 18 +++++++++++-------
1 file changed, 11 insertions(+), 7 deletions(-)
diff --git a/meta/classes/dpkg-base.bbclass b/meta/classes/dpkg-base.bbclass
index 742b8ad..0f70f1d 100644
--- a/meta/classes/dpkg-base.bbclass
+++ b/meta/classes/dpkg-base.bbclass
@@ -98,13 +98,17 @@ do_build() {
CLEANFUNCS += "repo_clean"
repo_clean() {
- PACKAGES=$(cd ${S}/..; ls *.deb | sed 's/\([^_]*\).*/\1/')
- if [ -n "${PACKAGES}" ]; then
- reprepro -b ${REPO_ISAR_DIR}/${DISTRO} \
- --dbdir ${REPO_ISAR_DB_DIR}/${DISTRO} \
- -C main -A ${DISTRO_ARCH} \
- remove ${DEBDISTRONAME} \
- ${PACKAGES}
+ DEBS=$( ls ${S}/../*.deb )
+ if [ -n "${DEBS}" ]; then
+ for d in ${DEBS}; do
+ p=$( dpkg-deb --show --showformat '${Package}' ${d} )
+ a=$( dpkg-deb --show --showformat '${Architecture}' ${d} )
+ reprepro -b ${REPO_ISAR_DIR}/${DISTRO} \
+ --dbdir ${REPO_ISAR_DB_DIR}/${DISTRO} \
+ -C main -A ${a} \
+ remove ${DEBDISTRONAME} \
+ ${p}
+ done
fi
}
--
2.19.2
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCHv2] dpkg-base: derive "Package" and "Architecture" from .deb in cleanup
2019-02-19 15:05 [PATCHv2] dpkg-base: derive "Package" and "Architecture" from .deb in cleanup Henning Schild
@ 2019-02-19 15:08 ` Henning Schild
2019-02-21 15:04 ` Henning Schild
1 sibling, 0 replies; 3+ messages in thread
From: Henning Schild @ 2019-02-19 15:08 UTC (permalink / raw)
To: isar-users; +Cc: Vladislav Jasek
Changes to v1 are whitespace/indent corrections, otherwise it is the
same.
I guess we should have our own hello example and its lib have an "all"
and an "any" example, "any" will become interesting for cross. And if
we already had an "all" package before, we would have found that issue
earlier.
Henning
On Tue, 19 Feb 2019 16:05:20 +0100
Henning Schild <henning.schild@siemens.com> wrote:
> From: Henning Schild <henning.schild@siemens.com>
>
> Instead of using "sed" pattern magic ask the .debs their name and
> architecture and remove exactly that. Especially the hardcoded
> Architecture caused problems for packages of architecture "all". If
> your recipe created such a package it could never be cleaned because
> it simply was not in the arch we expected it in. And now in a rebuild
> we can not add an updated version of the "all" deb.
>
> Reported-by: Vladislav Jasek <vladislav.jasek@siemens.com>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
> meta/classes/dpkg-base.bbclass | 18 +++++++++++-------
> 1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/meta/classes/dpkg-base.bbclass
> b/meta/classes/dpkg-base.bbclass index 742b8ad..0f70f1d 100644
> --- a/meta/classes/dpkg-base.bbclass
> +++ b/meta/classes/dpkg-base.bbclass
> @@ -98,13 +98,17 @@ do_build() {
> CLEANFUNCS += "repo_clean"
>
> repo_clean() {
> - PACKAGES=$(cd ${S}/..; ls *.deb | sed 's/\([^_]*\).*/\1/')
> - if [ -n "${PACKAGES}" ]; then
> - reprepro -b ${REPO_ISAR_DIR}/${DISTRO} \
> - --dbdir ${REPO_ISAR_DB_DIR}/${DISTRO} \
> - -C main -A ${DISTRO_ARCH} \
> - remove ${DEBDISTRONAME} \
> - ${PACKAGES}
> + DEBS=$( ls ${S}/../*.deb )
> + if [ -n "${DEBS}" ]; then
> + for d in ${DEBS}; do
> + p=$( dpkg-deb --show --showformat '${Package}' ${d} )
> + a=$( dpkg-deb --show --showformat '${Architecture}'
> ${d} )
> + reprepro -b ${REPO_ISAR_DIR}/${DISTRO} \
> + --dbdir ${REPO_ISAR_DB_DIR}/${DISTRO} \
> + -C main -A ${a} \
> + remove ${DEBDISTRONAME} \
> + ${p}
> + done
> fi
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCHv2] dpkg-base: derive "Package" and "Architecture" from .deb in cleanup
2019-02-19 15:05 [PATCHv2] dpkg-base: derive "Package" and "Architecture" from .deb in cleanup Henning Schild
2019-02-19 15:08 ` Henning Schild
@ 2019-02-21 15:04 ` Henning Schild
1 sibling, 0 replies; 3+ messages in thread
From: Henning Schild @ 2019-02-21 15:04 UTC (permalink / raw)
To: isar-users; +Cc: Vladislav Jasek
Please do not merge. I did not actually test this with an actuall "all"
package and just got some feedback that i need to parse/understand.
Henning
Am Tue, 19 Feb 2019 16:05:20 +0100
schrieb Henning Schild <henning.schild@siemens.com>:
> From: Henning Schild <henning.schild@siemens.com>
>
> Instead of using "sed" pattern magic ask the .debs their name and
> architecture and remove exactly that. Especially the hardcoded
> Architecture caused problems for packages of architecture "all". If
> your recipe created such a package it could never be cleaned because
> it simply was not in the arch we expected it in. And now in a rebuild
> we can not add an updated version of the "all" deb.
>
> Reported-by: Vladislav Jasek <vladislav.jasek@siemens.com>
> Signed-off-by: Henning Schild <henning.schild@siemens.com>
> ---
> meta/classes/dpkg-base.bbclass | 18 +++++++++++-------
> 1 file changed, 11 insertions(+), 7 deletions(-)
>
> diff --git a/meta/classes/dpkg-base.bbclass
> b/meta/classes/dpkg-base.bbclass index 742b8ad..0f70f1d 100644
> --- a/meta/classes/dpkg-base.bbclass
> +++ b/meta/classes/dpkg-base.bbclass
> @@ -98,13 +98,17 @@ do_build() {
> CLEANFUNCS += "repo_clean"
>
> repo_clean() {
> - PACKAGES=$(cd ${S}/..; ls *.deb | sed 's/\([^_]*\).*/\1/')
> - if [ -n "${PACKAGES}" ]; then
> - reprepro -b ${REPO_ISAR_DIR}/${DISTRO} \
> - --dbdir ${REPO_ISAR_DB_DIR}/${DISTRO} \
> - -C main -A ${DISTRO_ARCH} \
> - remove ${DEBDISTRONAME} \
> - ${PACKAGES}
> + DEBS=$( ls ${S}/../*.deb )
> + if [ -n "${DEBS}" ]; then
> + for d in ${DEBS}; do
> + p=$( dpkg-deb --show --showformat '${Package}' ${d} )
> + a=$( dpkg-deb --show --showformat '${Architecture}'
> ${d} )
> + reprepro -b ${REPO_ISAR_DIR}/${DISTRO} \
> + --dbdir ${REPO_ISAR_DB_DIR}/${DISTRO} \
> + -C main -A ${a} \
> + remove ${DEBDISTRONAME} \
> + ${p}
> + done
> fi
> }
>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2019-02-21 15:04 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-02-19 15:05 [PATCHv2] dpkg-base: derive "Package" and "Architecture" from .deb in cleanup Henning Schild
2019-02-19 15:08 ` Henning Schild
2019-02-21 15:04 ` Henning Schild
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox