public inbox for isar-users@googlegroups.com
 help / color / mirror / Atom feed
* [PATCH] deb-dl-dir.bbclass: grep exact package from dpkg.log file
@ 2022-05-09 12:51 Srinuvasan A
  2022-05-09 14:14 ` Jan Kiszka
  0 siblings, 1 reply; 4+ messages in thread
From: Srinuvasan A @ 2022-05-09 12:51 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, Srinuvasan A

From: Srinuvasan A <srinuvasan_a@mentor.com>

When we grep the package status from dpkg.log file it returns the output
with partial matches, this leads to downlaod src packages with unknown version fixed that.

Ex: we try to grep this "libgmp10:amd64 2:6.2.1+dfsg-1" package, but it
returns "libgmp10:amd64 2:6.2.1+dfsg-1+deb11u1" package, hence fixed
this grep pattern processing part.

Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
---
 meta/classes/deb-dl-dir.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
index eace510..4780228 100644
--- a/meta/classes/deb-dl-dir.bbclass
+++ b/meta/classes/deb-dl-dir.bbclass
@@ -12,7 +12,7 @@ is_not_part_of_current_build() {
     # Since we are parsing all the debs in DEBDIR, we can to some extend
     # try to eliminate some debs that are not part of the current multiconfig
     # build using the below method.
-    local output="$( grep -hs "status installed ${package}:${arch} ${version}$" \
+    local output="$( grep -xhs ".* status installed ${package}:${arch} ${version}" \
             "${IMAGE_ROOTFS}"/var/log/dpkg.log \
             "${BUILDCHROOT_HOST_DIR}"/var/log/dpkg.log \
             "${BUILDCHROOT_TARGET_DIR}"/var/log/dpkg.log | head -1 )"
-- 
2.25.1


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

* Re: [PATCH] deb-dl-dir.bbclass: grep exact package from dpkg.log file
  2022-05-09 12:51 [PATCH] deb-dl-dir.bbclass: grep exact package from dpkg.log file Srinuvasan A
@ 2022-05-09 14:14 ` Jan Kiszka
  2022-05-10  5:00   ` Srinuvasan A
  0 siblings, 1 reply; 4+ messages in thread
From: Jan Kiszka @ 2022-05-09 14:14 UTC (permalink / raw)
  To: Srinuvasan A, isar-users

On 09.05.22 14:51, Srinuvasan A wrote:
> From: Srinuvasan A <srinuvasan_a@mentor.com>
> 
> When we grep the package status from dpkg.log file it returns the output
> with partial matches, this leads to downlaod src packages with unknown version fixed that.

That "fixed that" in the sentence above seems grammatically wrong to me.

> 
> Ex: we try to grep this "libgmp10:amd64 2:6.2.1+dfsg-1" package, but it
> returns "libgmp10:amd64 2:6.2.1+dfsg-1+deb11u1" package, hence fixed
> this grep pattern processing part.

That reads a bit clearer, but that "hence fixed this ..." is not needed
in the sentence.

> 
> Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
> ---
>  meta/classes/deb-dl-dir.bbclass | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
> index eace510..4780228 100644
> --- a/meta/classes/deb-dl-dir.bbclass
> +++ b/meta/classes/deb-dl-dir.bbclass
> @@ -12,7 +12,7 @@ is_not_part_of_current_build() {
>      # Since we are parsing all the debs in DEBDIR, we can to some extend
>      # try to eliminate some debs that are not part of the current multiconfig
>      # build using the below method.
> -    local output="$( grep -hs "status installed ${package}:${arch} ${version}$" \

Hmm, there was already the attempt to match on the line end. Maybe that
closing "$" required escaping ("\$")?

> +    local output="$( grep -xhs ".* status installed ${package}:${arch} ${version}" \

But this one seems fine as well to me.

Jan

>              "${IMAGE_ROOTFS}"/var/log/dpkg.log \
>              "${BUILDCHROOT_HOST_DIR}"/var/log/dpkg.log \
>              "${BUILDCHROOT_TARGET_DIR}"/var/log/dpkg.log | head -1 )"

-- 
Siemens AG, Technology
Competence Center Embedded Linux

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

* [PATCH] deb-dl-dir.bbclass: grep exact package from dpkg.log file
  2022-05-09 14:14 ` Jan Kiszka
@ 2022-05-10  5:00   ` Srinuvasan A
  2022-05-18 11:03     ` Anton Mikanovich
  0 siblings, 1 reply; 4+ messages in thread
From: Srinuvasan A @ 2022-05-10  5:00 UTC (permalink / raw)
  To: isar-users; +Cc: jan.kiszka, Srinuvasan A

From: Srinuvasan A <srinuvasan_a@mentor.com>

When we grep the package status from dpkg.log file it returns the output
with partial matches, this leads to download src packages with an unknown version

Added provision for grep the exact package

Ex: we try to grep this "libgmp10:amd64 2:6.2.1+dfsg-1" package, but it
returns "libgmp10:amd64 2:6.2.1+dfsg-1+deb11u1" package.

Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
---
 meta/classes/deb-dl-dir.bbclass | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
index eace510..4780228 100644
--- a/meta/classes/deb-dl-dir.bbclass
+++ b/meta/classes/deb-dl-dir.bbclass
@@ -12,7 +12,7 @@ is_not_part_of_current_build() {
     # Since we are parsing all the debs in DEBDIR, we can to some extend
     # try to eliminate some debs that are not part of the current multiconfig
     # build using the below method.
-    local output="$( grep -hs "status installed ${package}:${arch} ${version}$" \
+    local output="$( grep -xhs ".* status installed ${package}:${arch} ${version}" \
             "${IMAGE_ROOTFS}"/var/log/dpkg.log \
             "${BUILDCHROOT_HOST_DIR}"/var/log/dpkg.log \
             "${BUILDCHROOT_TARGET_DIR}"/var/log/dpkg.log | head -1 )"
-- 
2.25.1


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

* Re: [PATCH] deb-dl-dir.bbclass: grep exact package from dpkg.log file
  2022-05-10  5:00   ` Srinuvasan A
@ 2022-05-18 11:03     ` Anton Mikanovich
  0 siblings, 0 replies; 4+ messages in thread
From: Anton Mikanovich @ 2022-05-18 11:03 UTC (permalink / raw)
  To: Srinuvasan A, isar-users; +Cc: jan.kiszka

10.05.2022 08:00, Srinuvasan A wrote:
> From: Srinuvasan A <srinuvasan_a@mentor.com>
>
> When we grep the package status from dpkg.log file it returns the output
> with partial matches, this leads to download src packages with an unknown version
>
> Added provision for grep the exact package
>
> Ex: we try to grep this "libgmp10:amd64 2:6.2.1+dfsg-1" package, but it
> returns "libgmp10:amd64 2:6.2.1+dfsg-1+deb11u1" package.
>
> Signed-off-by: Srinuvasan A <srinuvasan_a@mentor.com>
> ---
>   meta/classes/deb-dl-dir.bbclass | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/deb-dl-dir.bbclass b/meta/classes/deb-dl-dir.bbclass
> index eace510..4780228 100644
> --- a/meta/classes/deb-dl-dir.bbclass
> +++ b/meta/classes/deb-dl-dir.bbclass
> @@ -12,7 +12,7 @@ is_not_part_of_current_build() {
>       # Since we are parsing all the debs in DEBDIR, we can to some extend
>       # try to eliminate some debs that are not part of the current multiconfig
>       # build using the below method.
> -    local output="$( grep -hs "status installed ${package}:${arch} ${version}$" \
> +    local output="$( grep -xhs ".* status installed ${package}:${arch} ${version}" \
>               "${IMAGE_ROOTFS}"/var/log/dpkg.log \
>               "${BUILDCHROOT_HOST_DIR}"/var/log/dpkg.log \
>               "${BUILDCHROOT_TARGET_DIR}"/var/log/dpkg.log | head -1 )"

Applied to next, thanks.


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

end of thread, other threads:[~2022-05-18 11:03 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-09 12:51 [PATCH] deb-dl-dir.bbclass: grep exact package from dpkg.log file Srinuvasan A
2022-05-09 14:14 ` Jan Kiszka
2022-05-10  5:00   ` Srinuvasan A
2022-05-18 11:03     ` Anton Mikanovich

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