* [PATCH] classes/sdk.bbclass: remove additional "/" in new_target finding
@ 2023-07-04 10:24 Srinuvasan Arjunan
2023-07-11 6:40 ` Uladzimir Bely
0 siblings, 1 reply; 6+ messages in thread
From: Srinuvasan Arjunan @ 2023-07-04 10:24 UTC (permalink / raw)
To: isar-users; +Cc: jan.kiszka, Srinuvasan A
From: Srinuvasan A <srinuvasan.a@siemens.com>
We observed that one additional / present in finding the new_target,
here target already start with /, hence no need to append the additional
/.
In functionality wise there is no change.
Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
---
meta/classes/sdk.bbclass | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index c6dc689..3d650a1 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -98,9 +98,10 @@ sdkchroot_finalize() {
for link in $(find ${ROOTFSDIR}/ -type l); do
target=$(readlink $link)
+ # Enter into if condition if target has a leading /
if [ "${target#/}" != "${target}" ]; then
basedir=$(dirname $link)
- new_target=$(realpath --no-symlinks -m --relative-to=$basedir ${ROOTFSDIR}/${target})
+ new_target=$(realpath --no-symlinks -m --relative-to=$basedir ${ROOTFSDIR}${target})
# remove first to allow rewriting directory links
sudo rm $link
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] classes/sdk.bbclass: remove additional "/" in new_target finding
2023-07-04 10:24 [PATCH] classes/sdk.bbclass: remove additional "/" in new_target finding Srinuvasan Arjunan
@ 2023-07-11 6:40 ` Uladzimir Bely
0 siblings, 0 replies; 6+ messages in thread
From: Uladzimir Bely @ 2023-07-11 6:40 UTC (permalink / raw)
To: isar-users
On Tue, 2023-07-04 at 15:54 +0530, Srinuvasan Arjunan wrote:
> From: Srinuvasan A <srinuvasan.a@siemens.com>
>
> We observed that one additional / present in finding the new_target,
> here target already start with /, hence no need to append the
> additional
> /.
>
> In functionality wise there is no change.
>
> Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
> ---
> meta/classes/sdk.bbclass | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
> index c6dc689..3d650a1 100644
> --- a/meta/classes/sdk.bbclass
> +++ b/meta/classes/sdk.bbclass
> @@ -98,9 +98,10 @@ sdkchroot_finalize() {
> for link in $(find ${ROOTFSDIR}/ -type l); do
> target=$(readlink $link)
>
> + # Enter into if condition if target has a leading /
> if [ "${target#/}" != "${target}" ]; then
> basedir=$(dirname $link)
> - new_target=$(realpath --no-symlinks -m --relative-
> to=$basedir ${ROOTFSDIR}/${target})
> + new_target=$(realpath --no-symlinks -m --relative-
> to=$basedir ${ROOTFSDIR}${target})
>
> # remove first to allow rewriting directory links
> sudo rm $link
> --
> 2.34.1
>
Applied to next, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] classes/sdk.bbclass: remove additional "/" in new_target finding
2023-07-03 7:07 ` Srinuvasan Arjunan
@ 2023-07-03 10:59 ` Jan Kiszka
0 siblings, 0 replies; 6+ messages in thread
From: Jan Kiszka @ 2023-07-03 10:59 UTC (permalink / raw)
To: Srinuvasan Arjunan, isar-users
On 03.07.23 09:07, Srinuvasan Arjunan wrote:
>
>
> On Wednesday, June 28, 2023 at 12:42:52 PM UTC+5:30 Jan Kiszka wrote:
>
> On 28.06.23 07:19, Srinuvasan Arjunan wrote:
> > From: Srinuvasan A <srinuv...@siemens.com>
> >
> > We observed that one additional / present in finding the new_target,
> > here target already start with /, hence no need to append the
> additional
> > /.
> >
> > In functionality wise there is no change.
> >
> > Signed-off-by: Srinuvasan A <srinuv...@siemens.com>
> > ---
> > meta/classes/sdk.bbclass | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
> > index c6dc689..f14b447 100644
> > --- a/meta/classes/sdk.bbclass
> > +++ b/meta/classes/sdk.bbclass
> > @@ -100,7 +100,7 @@ sdkchroot_finalize() {
> >
> > if [ "${target#/}" != "${target}" ]; then
> > basedir=$(dirname $link)
> > - new_target=$(realpath --no-symlinks -m --relative-to=$basedir
> ${ROOTFSDIR}/${target})
> > + new_target=$(realpath --no-symlinks -m --relative-to=$basedir
> ${ROOTFSDIR}${target})
> >
>
> Can you guarantee that ROOTFSDIR comes with a trailing / in ALL case?
> I'm skeptical about that.
>
>
> Actually ROOTFSDIR not contains / in all the cases, rather target
> always start with /, hence the additional / is not needed.
OK, we are under
if [ "${target#/}" != "${target}" ]; then
thus only enter this branch if target has a leading /. Maybe worth to
leave a comment behind in the code nevertheless.
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] classes/sdk.bbclass: remove additional "/" in new_target finding
2023-06-28 7:12 ` Jan Kiszka
@ 2023-07-03 7:07 ` Srinuvasan Arjunan
2023-07-03 10:59 ` Jan Kiszka
0 siblings, 1 reply; 6+ messages in thread
From: Srinuvasan Arjunan @ 2023-07-03 7:07 UTC (permalink / raw)
To: isar-users
[-- Attachment #1.1: Type: text/plain, Size: 2190 bytes --]
On Wednesday, June 28, 2023 at 12:42:52 PM UTC+5:30 Jan Kiszka wrote:
On 28.06.23 07:19, Srinuvasan Arjunan wrote:
> From: Srinuvasan A <srinuv...@siemens.com>
>
> We observed that one additional / present in finding the new_target,
> here target already start with /, hence no need to append the additional
> /.
>
> In functionality wise there is no change.
>
> Signed-off-by: Srinuvasan A <srinuv...@siemens.com>
> ---
> meta/classes/sdk.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
> index c6dc689..f14b447 100644
> --- a/meta/classes/sdk.bbclass
> +++ b/meta/classes/sdk.bbclass
> @@ -100,7 +100,7 @@ sdkchroot_finalize() {
>
> if [ "${target#/}" != "${target}" ]; then
> basedir=$(dirname $link)
> - new_target=$(realpath --no-symlinks -m --relative-to=$basedir
${ROOTFSDIR}/${target})
> + new_target=$(realpath --no-symlinks -m --relative-to=$basedir
${ROOTFSDIR}${target})
>
Can you guarantee that ROOTFSDIR comes with a trailing / in ALL case?
I'm skeptical about that.
Actually ROOTFSDIR not contains / in all the cases, rather target always
start with /, hence the additional / is not needed.
f.e:
Debug Logs:
target=/etc/alternatives/lzma.1.gz
[ etc/alternatives/lzma.1.gz != /etc/alternatives/lzma.1.gz ]
dirname
/home/srinu/work/TEST/ISAR_REL_PATH_CHECK_TEST/build/tmp/work/debian-bullseye-armhf/isar-image-base-sdk-qemuarm/1.0-r0/rootfs/usr/share/man/man1/lzma.1.gz
basedir=/home/srinu/work/TEST/ISAR_REL_PATH_CHECK_TEST/build/tmp/work/debian-bullseye-armhf/isar-image-base-sdk-qemuarm/1.0-r0/rootfs/usr/share/man/man1
realpath --no-symlinks -m
--relative-to=/home/srinu/work/TEST/ISAR_REL_PATH_CHECK_TEST/build/tmp/work/debian-bullseye-armhf/isar-image-base-sdk-qemuarm/1.0-r0/rootfs/usr/share/man/man1
/home/srinu/work/TEST/ISAR_REL_PATH_CHECK_TEST/build/tmp/work/debian-bullseye-armhf/isar-image-base-sdk-qemuarm/1.0-r0/rootfs//etc/alternatives/lzma.1.gz
new_target=../../../../etc/alternatives/lzma.1.gz
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
[-- Attachment #1.2: Type: text/html, Size: 2926 bytes --]
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] classes/sdk.bbclass: remove additional "/" in new_target finding
2023-06-28 5:19 Srinuvasan Arjunan
@ 2023-06-28 7:12 ` Jan Kiszka
2023-07-03 7:07 ` Srinuvasan Arjunan
0 siblings, 1 reply; 6+ messages in thread
From: Jan Kiszka @ 2023-06-28 7:12 UTC (permalink / raw)
To: Srinuvasan Arjunan, isar-users; +Cc: Srinuvasan A
On 28.06.23 07:19, Srinuvasan Arjunan wrote:
> From: Srinuvasan A <srinuvasan.a@siemens.com>
>
> We observed that one additional / present in finding the new_target,
> here target already start with /, hence no need to append the additional
> /.
>
> In functionality wise there is no change.
>
> Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
> ---
> meta/classes/sdk.bbclass | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
> index c6dc689..f14b447 100644
> --- a/meta/classes/sdk.bbclass
> +++ b/meta/classes/sdk.bbclass
> @@ -100,7 +100,7 @@ sdkchroot_finalize() {
>
> if [ "${target#/}" != "${target}" ]; then
> basedir=$(dirname $link)
> - new_target=$(realpath --no-symlinks -m --relative-to=$basedir ${ROOTFSDIR}/${target})
> + new_target=$(realpath --no-symlinks -m --relative-to=$basedir ${ROOTFSDIR}${target})
>
Can you guarantee that ROOTFSDIR comes with a trailing / in ALL case?
I'm skeptical about that.
Jan
--
Siemens AG, Technology
Competence Center Embedded Linux
^ permalink raw reply [flat|nested] 6+ messages in thread
* [PATCH] classes/sdk.bbclass: remove additional "/" in new_target finding
@ 2023-06-28 5:19 Srinuvasan Arjunan
2023-06-28 7:12 ` Jan Kiszka
0 siblings, 1 reply; 6+ messages in thread
From: Srinuvasan Arjunan @ 2023-06-28 5:19 UTC (permalink / raw)
To: isar-users; +Cc: jan.kiszka, Srinuvasan A
From: Srinuvasan A <srinuvasan.a@siemens.com>
We observed that one additional / present in finding the new_target,
here target already start with /, hence no need to append the additional
/.
In functionality wise there is no change.
Signed-off-by: Srinuvasan A <srinuvasan.a@siemens.com>
---
meta/classes/sdk.bbclass | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/meta/classes/sdk.bbclass b/meta/classes/sdk.bbclass
index c6dc689..f14b447 100644
--- a/meta/classes/sdk.bbclass
+++ b/meta/classes/sdk.bbclass
@@ -100,7 +100,7 @@ sdkchroot_finalize() {
if [ "${target#/}" != "${target}" ]; then
basedir=$(dirname $link)
- new_target=$(realpath --no-symlinks -m --relative-to=$basedir ${ROOTFSDIR}/${target})
+ new_target=$(realpath --no-symlinks -m --relative-to=$basedir ${ROOTFSDIR}${target})
# remove first to allow rewriting directory links
sudo rm $link
--
2.34.1
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2023-07-11 6:39 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-07-04 10:24 [PATCH] classes/sdk.bbclass: remove additional "/" in new_target finding Srinuvasan Arjunan
2023-07-11 6:40 ` Uladzimir Bely
-- strict thread matches above, loose matches on Subject: below --
2023-06-28 5:19 Srinuvasan Arjunan
2023-06-28 7:12 ` Jan Kiszka
2023-07-03 7:07 ` Srinuvasan Arjunan
2023-07-03 10:59 ` Jan Kiszka
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox