All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] relocate_sdk.py: remove hardcoded SDK path
@ 2017-11-22 11:20 Ruslan Bilovol
  2018-07-17 14:59 ` Ruslan Bilovol
  0 siblings, 1 reply; 5+ messages in thread
From: Ruslan Bilovol @ 2017-11-22 11:20 UTC (permalink / raw)
  To: openembedded-core; +Cc: xe-linux-external

This patch removes hardcodes added to relocate_sdk.py
during SDK build, making it flexible and reusable.
Now default SDK path is passed to the script as
parameter rather then harcoded inside it.

This allows to reuse this script for multiple
relocations, and adds possibility to relocate
SDK multiple times

Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
---
 meta/classes/populate_sdk_base.bbclass |  5 -----
 meta/files/toolchain-shar-relocate.sh  |  2 +-
 scripts/relocate_sdk.py                | 17 +++++++++--------
 3 files changed, 10 insertions(+), 14 deletions(-)

diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
index 424c63c..e7aa5a8 100644
--- a/meta/classes/populate_sdk_base.bbclass
+++ b/meta/classes/populate_sdk_base.bbclass
@@ -152,11 +152,6 @@ do_populate_sdk[stamp-extra-info] = "${MACHINE}${SDKMACHINE}"
 
 fakeroot create_sdk_files() {
 	cp ${COREBASE}/scripts/relocate_sdk.py ${SDK_OUTPUT}/${SDKPATH}/
-
-	# Replace the ##DEFAULT_INSTALL_DIR## with the correct pattern.
-	# Escape special characters like '+' and '.' in the SDKPATH
-	escaped_sdkpath=$(echo ${SDKPATH} |sed -e "s:[\+\.]:\\\\\\\\\0:g")
-	sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
 }
 
 python check_sdk_sysroots() {
diff --git a/meta/files/toolchain-shar-relocate.sh b/meta/files/toolchain-shar-relocate.sh
index e3c1001..f82ff2b 100644
--- a/meta/files/toolchain-shar-relocate.sh
+++ b/meta/files/toolchain-shar-relocate.sh
@@ -36,7 +36,7 @@ if [ x\${PYTHON} = "x"  ]; then
 	echo "SDK could not be relocated.  No python found."
 	exit 1
 fi
-\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files
+\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $DEFAULT_INSTALL_DIR $target_sdk_dir $dl_path $executable_files
 EOF
 
 $SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh
diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
index c752fa2..0d5a6f5 100755
--- a/scripts/relocate_sdk.py
+++ b/scripts/relocate_sdk.py
@@ -38,8 +38,6 @@ else:
     def b(x):
         return x.encode(sys.getfilesystemencoding())
 
-old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##"))
-
 def get_arch():
     f.seek(0)
     e_ident =f.read(16)
@@ -212,19 +210,22 @@ def change_dl_sysdirs(elf_file_name):
         f.write(sysdirslen)
 
 # MAIN
-if len(sys.argv) < 4:
+if len(sys.argv) < 5:
     sys.exit(-1)
 
 # In python > 3, strings may also contain Unicode characters. So, convert
 # them to bytes
 if sys.version_info < (3,):
-    new_prefix = sys.argv[1]
-    new_dl_path = sys.argv[2]
+    new_prefix = sys.argv[2]
+    new_dl_path = sys.argv[3]
 else:
-    new_prefix = sys.argv[1].encode()
-    new_dl_path = sys.argv[2].encode()
+    new_prefix = sys.argv[2].encode()
+    new_dl_path = sys.argv[3].encode()
+
+executables_list = sys.argv[4:]
 
-executables_list = sys.argv[3:]
+old_prefix_ne = b(sys.argv[1])
+old_prefix = re.compile(re.escape(old_prefix_ne));
 
 for e in executables_list:
     perms = os.stat(e)[stat.ST_MODE]
-- 
1.9.1



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

* Re: [PATCH] relocate_sdk.py: remove hardcoded SDK path
  2017-11-22 11:20 [PATCH] relocate_sdk.py: remove hardcoded SDK path Ruslan Bilovol
@ 2018-07-17 14:59 ` Ruslan Bilovol
  2018-07-17 15:22   ` Christopher Larson
  0 siblings, 1 reply; 5+ messages in thread
From: Ruslan Bilovol @ 2018-07-17 14:59 UTC (permalink / raw)
  To: openembedded-core; +Cc: Grygorii Tertychnyi (gtertych), xe-linux-external

Hi all,

Any comments on this patch?

Thanks
Ruslan

On 11/22/2017 01:20 PM, Ruslan Bilovol wrote:
> This patch removes hardcodes added to relocate_sdk.py
> during SDK build, making it flexible and reusable.
> Now default SDK path is passed to the script as
> parameter rather then harcoded inside it.
> 
> This allows to reuse this script for multiple
> relocations, and adds possibility to relocate
> SDK multiple times
> 
> Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
> ---
>   meta/classes/populate_sdk_base.bbclass |  5 -----
>   meta/files/toolchain-shar-relocate.sh  |  2 +-
>   scripts/relocate_sdk.py                | 17 +++++++++--------
>   3 files changed, 10 insertions(+), 14 deletions(-)
> 
> diff --git a/meta/classes/populate_sdk_base.bbclass b/meta/classes/populate_sdk_base.bbclass
> index 424c63c..e7aa5a8 100644
> --- a/meta/classes/populate_sdk_base.bbclass
> +++ b/meta/classes/populate_sdk_base.bbclass
> @@ -152,11 +152,6 @@ do_populate_sdk[stamp-extra-info] = "${MACHINE}${SDKMACHINE}"
>   
>   fakeroot create_sdk_files() {
>   	cp ${COREBASE}/scripts/relocate_sdk.py ${SDK_OUTPUT}/${SDKPATH}/
> -
> -	# Replace the ##DEFAULT_INSTALL_DIR## with the correct pattern.
> -	# Escape special characters like '+' and '.' in the SDKPATH
> -	escaped_sdkpath=$(echo ${SDKPATH} |sed -e "s:[\+\.]:\\\\\\\\\0:g")
> -	sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:" ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
>   }
>   
>   python check_sdk_sysroots() {
> diff --git a/meta/files/toolchain-shar-relocate.sh b/meta/files/toolchain-shar-relocate.sh
> index e3c1001..f82ff2b 100644
> --- a/meta/files/toolchain-shar-relocate.sh
> +++ b/meta/files/toolchain-shar-relocate.sh
> @@ -36,7 +36,7 @@ if [ x\${PYTHON} = "x"  ]; then
>   	echo "SDK could not be relocated.  No python found."
>   	exit 1
>   fi
> -\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir $dl_path $executable_files
> +\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $DEFAULT_INSTALL_DIR $target_sdk_dir $dl_path $executable_files
>   EOF
>   
>   $SUDO_EXEC mv $tdir/relocate_sdk.sh ${env_setup_script%/*}/relocate_sdk.sh
> diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
> index c752fa2..0d5a6f5 100755
> --- a/scripts/relocate_sdk.py
> +++ b/scripts/relocate_sdk.py
> @@ -38,8 +38,6 @@ else:
>       def b(x):
>           return x.encode(sys.getfilesystemencoding())
>   
> -old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##"))
> -
>   def get_arch():
>       f.seek(0)
>       e_ident =f.read(16)
> @@ -212,19 +210,22 @@ def change_dl_sysdirs(elf_file_name):
>           f.write(sysdirslen)
>   
>   # MAIN
> -if len(sys.argv) < 4:
> +if len(sys.argv) < 5:
>       sys.exit(-1)
>   
>   # In python > 3, strings may also contain Unicode characters. So, convert
>   # them to bytes
>   if sys.version_info < (3,):
> -    new_prefix = sys.argv[1]
> -    new_dl_path = sys.argv[2]
> +    new_prefix = sys.argv[2]
> +    new_dl_path = sys.argv[3]
>   else:
> -    new_prefix = sys.argv[1].encode()
> -    new_dl_path = sys.argv[2].encode()
> +    new_prefix = sys.argv[2].encode()
> +    new_dl_path = sys.argv[3].encode()
> +
> +executables_list = sys.argv[4:]
>   
> -executables_list = sys.argv[3:]
> +old_prefix_ne = b(sys.argv[1])
> +old_prefix = re.compile(re.escape(old_prefix_ne));
>   
>   for e in executables_list:
>       perms = os.stat(e)[stat.ST_MODE]
> 


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

* Re: [PATCH] relocate_sdk.py: remove hardcoded SDK path
  2018-07-17 14:59 ` Ruslan Bilovol
@ 2018-07-17 15:22   ` Christopher Larson
  2018-07-25 15:44     ` Richard Purdie
  0 siblings, 1 reply; 5+ messages in thread
From: Christopher Larson @ 2018-07-17 15:22 UTC (permalink / raw)
  To: rbilovol
  Cc: gtertych, xe-linux-external,
	Patches and discussions about the oe-core layer

[-- Attachment #1: Type: text/plain, Size: 4229 bytes --]

IMHO this is a solid improvement that should go in.

On Tue, Jul 17, 2018 at 8:09 AM Ruslan Bilovol via Openembedded-core <
openembedded-core@lists.openembedded.org> wrote:

> Hi all,
>
> Any comments on this patch?
>
> Thanks
> Ruslan
>
> On 11/22/2017 01:20 PM, Ruslan Bilovol wrote:
> > This patch removes hardcodes added to relocate_sdk.py
> > during SDK build, making it flexible and reusable.
> > Now default SDK path is passed to the script as
> > parameter rather then harcoded inside it.
> >
> > This allows to reuse this script for multiple
> > relocations, and adds possibility to relocate
> > SDK multiple times
> >
> > Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
> > ---
> >   meta/classes/populate_sdk_base.bbclass |  5 -----
> >   meta/files/toolchain-shar-relocate.sh  |  2 +-
> >   scripts/relocate_sdk.py                | 17 +++++++++--------
> >   3 files changed, 10 insertions(+), 14 deletions(-)
> >
> > diff --git a/meta/classes/populate_sdk_base.bbclass
> b/meta/classes/populate_sdk_base.bbclass
> > index 424c63c..e7aa5a8 100644
> > --- a/meta/classes/populate_sdk_base.bbclass
> > +++ b/meta/classes/populate_sdk_base.bbclass
> > @@ -152,11 +152,6 @@ do_populate_sdk[stamp-extra-info] =
> "${MACHINE}${SDKMACHINE}"
> >
> >   fakeroot create_sdk_files() {
> >       cp ${COREBASE}/scripts/relocate_sdk.py ${SDK_OUTPUT}/${SDKPATH}/
> > -
> > -     # Replace the ##DEFAULT_INSTALL_DIR## with the correct pattern.
> > -     # Escape special characters like '+' and '.' in the SDKPATH
> > -     escaped_sdkpath=$(echo ${SDKPATH} |sed -e "s:[\+\.]:\\\\\\\\\0:g")
> > -     sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:"
> ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
> >   }
> >
> >   python check_sdk_sysroots() {
> > diff --git a/meta/files/toolchain-shar-relocate.sh
> b/meta/files/toolchain-shar-relocate.sh
> > index e3c1001..f82ff2b 100644
> > --- a/meta/files/toolchain-shar-relocate.sh
> > +++ b/meta/files/toolchain-shar-relocate.sh
> > @@ -36,7 +36,7 @@ if [ x\${PYTHON} = "x"  ]; then
> >       echo "SDK could not be relocated.  No python found."
> >       exit 1
> >   fi
> > -\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $target_sdk_dir
> $dl_path $executable_files
> > +\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py $DEFAULT_INSTALL_DIR
> $target_sdk_dir $dl_path $executable_files
> >   EOF
> >
> >   $SUDO_EXEC mv $tdir/relocate_sdk.sh
> ${env_setup_script%/*}/relocate_sdk.sh
> > diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
> > index c752fa2..0d5a6f5 100755
> > --- a/scripts/relocate_sdk.py
> > +++ b/scripts/relocate_sdk.py
> > @@ -38,8 +38,6 @@ else:
> >       def b(x):
> >           return x.encode(sys.getfilesystemencoding())
> >
> > -old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##"))
> > -
> >   def get_arch():
> >       f.seek(0)
> >       e_ident =f.read(16)
> > @@ -212,19 +210,22 @@ def change_dl_sysdirs(elf_file_name):
> >           f.write(sysdirslen)
> >
> >   # MAIN
> > -if len(sys.argv) < 4:
> > +if len(sys.argv) < 5:
> >       sys.exit(-1)
> >
> >   # In python > 3, strings may also contain Unicode characters. So,
> convert
> >   # them to bytes
> >   if sys.version_info < (3,):
> > -    new_prefix = sys.argv[1]
> > -    new_dl_path = sys.argv[2]
> > +    new_prefix = sys.argv[2]
> > +    new_dl_path = sys.argv[3]
> >   else:
> > -    new_prefix = sys.argv[1].encode()
> > -    new_dl_path = sys.argv[2].encode()
> > +    new_prefix = sys.argv[2].encode()
> > +    new_dl_path = sys.argv[3].encode()
> > +
> > +executables_list = sys.argv[4:]
> >
> > -executables_list = sys.argv[3:]
> > +old_prefix_ne = b(sys.argv[1])
> > +old_prefix = re.compile(re.escape(old_prefix_ne));
> >
> >   for e in executables_list:
> >       perms = os.stat(e)[stat.ST_MODE]
> >
> --
> _______________________________________________
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>


-- 
Christopher Larson
kergoth at gmail dot com
Founder - BitBake, OpenEmbedded, OpenZaurus
Senior Software Engineer, Mentor Graphics

[-- Attachment #2: Type: text/html, Size: 5588 bytes --]

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

* Re: [PATCH] relocate_sdk.py: remove hardcoded SDK path
  2018-07-17 15:22   ` Christopher Larson
@ 2018-07-25 15:44     ` Richard Purdie
  2018-07-26 10:39       ` Ruslan Bilovol
  0 siblings, 1 reply; 5+ messages in thread
From: Richard Purdie @ 2018-07-25 15:44 UTC (permalink / raw)
  To: Christopher Larson, rbilovol
  Cc: Patches and discussions about the oe-core layer, xe-linux-external

Whilst we merged this, it has unfortunately totally broken uninative-
tarball. We're under pressure to update to a new uninative to unbreak
builds on recent distros with sstate sharing and this now blocks doing
so.

I can't add the value to the relocate_sdk.py call from
uninative.bbclass since I don't know what value the tarball would have
been generated with.

I suspect I'll have to revert this and then you can work on a way to
fix this...

Cheers,

Richard

On Tue, 2018-07-17 at 08:22 -0700, Christopher Larson wrote:
> IMHO this is a solid improvement that should go in.
> 
> On Tue, Jul 17, 2018 at 8:09 AM Ruslan Bilovol via Openembedded-core
> <openembedded-core@lists.openembedded.org> wrote:
> > Hi all,
> > 
> > Any comments on this patch?
> > 
> > Thanks
> > Ruslan
> > 
> > On 11/22/2017 01:20 PM, Ruslan Bilovol wrote:
> > > This patch removes hardcodes added to relocate_sdk.py
> > > during SDK build, making it flexible and reusable.
> > > Now default SDK path is passed to the script as
> > > parameter rather then harcoded inside it.
> > > 
> > > This allows to reuse this script for multiple
> > > relocations, and adds possibility to relocate
> > > SDK multiple times
> > > 
> > > Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
> > > ---
> > >   meta/classes/populate_sdk_base.bbclass |  5 -----
> > >   meta/files/toolchain-shar-relocate.sh  |  2 +-
> > >   scripts/relocate_sdk.py                | 17 +++++++++--------
> > >   3 files changed, 10 insertions(+), 14 deletions(-)
> > > 
> > > diff --git a/meta/classes/populate_sdk_base.bbclass
> > b/meta/classes/populate_sdk_base.bbclass
> > > index 424c63c..e7aa5a8 100644
> > > --- a/meta/classes/populate_sdk_base.bbclass
> > > +++ b/meta/classes/populate_sdk_base.bbclass
> > > @@ -152,11 +152,6 @@ do_populate_sdk[stamp-extra-info] =
> > "${MACHINE}${SDKMACHINE}"
> > >   
> > >   fakeroot create_sdk_files() {
> > >       cp ${COREBASE}/scripts/relocate_sdk.py
> > ${SDK_OUTPUT}/${SDKPATH}/
> > > -
> > > -     # Replace the ##DEFAULT_INSTALL_DIR## with the correct
> > pattern.
> > > -     # Escape special characters like '+' and '.' in the SDKPATH
> > > -     escaped_sdkpath=$(echo ${SDKPATH} |sed -e
> > "s:[\+\.]:\\\\\\\\\0:g")
> > > -     sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:"
> > ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
> > >   }
> > >   
> > >   python check_sdk_sysroots() {
> > > diff --git a/meta/files/toolchain-shar-relocate.sh
> > b/meta/files/toolchain-shar-relocate.sh
> > > index e3c1001..f82ff2b 100644
> > > --- a/meta/files/toolchain-shar-relocate.sh
> > > +++ b/meta/files/toolchain-shar-relocate.sh
> > > @@ -36,7 +36,7 @@ if [ x\${PYTHON} = "x"  ]; then
> > >       echo "SDK could not be relocated.  No python found."
> > >       exit 1
> > >   fi
> > > -\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py
> > $target_sdk_dir $dl_path $executable_files
> > > +\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py
> > $DEFAULT_INSTALL_DIR $target_sdk_dir $dl_path $executable_files
> > >   EOF
> > >   
> > >   $SUDO_EXEC mv $tdir/relocate_sdk.sh
> > ${env_setup_script%/*}/relocate_sdk.sh
> > > diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
> > > index c752fa2..0d5a6f5 100755
> > > --- a/scripts/relocate_sdk.py
> > > +++ b/scripts/relocate_sdk.py
> > > @@ -38,8 +38,6 @@ else:
> > >       def b(x):
> > >           return x.encode(sys.getfilesystemencoding())
> > >   
> > > -old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##"))
> > > -
> > >   def get_arch():
> > >       f.seek(0)
> > >       e_ident =f.read(16)
> > > @@ -212,19 +210,22 @@ def change_dl_sysdirs(elf_file_name):
> > >           f.write(sysdirslen)
> > >   
> > >   # MAIN
> > > -if len(sys.argv) < 4:
> > > +if len(sys.argv) < 5:
> > >       sys.exit(-1)
> > >   
> > >   # In python > 3, strings may also contain Unicode characters.
> > So, convert
> > >   # them to bytes
> > >   if sys.version_info < (3,):
> > > -    new_prefix = sys.argv[1]
> > > -    new_dl_path = sys.argv[2]
> > > +    new_prefix = sys.argv[2]
> > > +    new_dl_path = sys.argv[3]
> > >   else:
> > > -    new_prefix = sys.argv[1].encode()
> > > -    new_dl_path = sys.argv[2].encode()
> > > +    new_prefix = sys.argv[2].encode()
> > > +    new_dl_path = sys.argv[3].encode()
> > > +
> > > +executables_list = sys.argv[4:]
> > >   
> > > -executables_list = sys.argv[3:]
> > > +old_prefix_ne = b(sys.argv[1])
> > > +old_prefix = re.compile(re.escape(old_prefix_ne));
> > >   
> > >   for e in executables_list:
> > >       perms = os.stat(e)[stat.ST_MODE]
> > > 
> > -- 
> > _______________________________________________
> > Openembedded-core mailing list
> > Openembedded-core@lists.openembedded.org
> > http://lists.openembedded.org/mailman/listinfo/openembedded-core
> 
> 


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

* Re: [PATCH] relocate_sdk.py: remove hardcoded SDK path
  2018-07-25 15:44     ` Richard Purdie
@ 2018-07-26 10:39       ` Ruslan Bilovol
  0 siblings, 0 replies; 5+ messages in thread
From: Ruslan Bilovol @ 2018-07-26 10:39 UTC (permalink / raw)
  To: Richard Purdie, Christopher Larson
  Cc: Patches and discussions about the oe-core layer, xe-linux-external

Hi Richard,

I see I'm too late and the patch is already reverted. I'll
update it and push again later then.

Thanks,
Ruslan

On 07/25/2018 06:44 PM, Richard Purdie wrote:
> Whilst we merged this, it has unfortunately totally broken uninative-
> tarball. We're under pressure to update to a new uninative to unbreak
> builds on recent distros with sstate sharing and this now blocks doing
> so.
> 
> I can't add the value to the relocate_sdk.py call from
> uninative.bbclass since I don't know what value the tarball would have
> been generated with.
> 
> I suspect I'll have to revert this and then you can work on a way to
> fix this...
> 
> Cheers,
> 
> Richard
> 
> On Tue, 2018-07-17 at 08:22 -0700, Christopher Larson wrote:
>> IMHO this is a solid improvement that should go in.
>>
>> On Tue, Jul 17, 2018 at 8:09 AM Ruslan Bilovol via Openembedded-core
>> <openembedded-core@lists.openembedded.org> wrote:
>>> Hi all,
>>>
>>> Any comments on this patch?
>>>
>>> Thanks
>>> Ruslan
>>>
>>> On 11/22/2017 01:20 PM, Ruslan Bilovol wrote:
>>>> This patch removes hardcodes added to relocate_sdk.py
>>>> during SDK build, making it flexible and reusable.
>>>> Now default SDK path is passed to the script as
>>>> parameter rather then harcoded inside it.
>>>>
>>>> This allows to reuse this script for multiple
>>>> relocations, and adds possibility to relocate
>>>> SDK multiple times
>>>>
>>>> Signed-off-by: Ruslan Bilovol <rbilovol@cisco.com>
>>>> ---
>>>>    meta/classes/populate_sdk_base.bbclass |  5 -----
>>>>    meta/files/toolchain-shar-relocate.sh  |  2 +-
>>>>    scripts/relocate_sdk.py                | 17 +++++++++--------
>>>>    3 files changed, 10 insertions(+), 14 deletions(-)
>>>>
>>>> diff --git a/meta/classes/populate_sdk_base.bbclass
>>> b/meta/classes/populate_sdk_base.bbclass
>>>> index 424c63c..e7aa5a8 100644
>>>> --- a/meta/classes/populate_sdk_base.bbclass
>>>> +++ b/meta/classes/populate_sdk_base.bbclass
>>>> @@ -152,11 +152,6 @@ do_populate_sdk[stamp-extra-info] =
>>> "${MACHINE}${SDKMACHINE}"
>>>>    
>>>>    fakeroot create_sdk_files() {
>>>>        cp ${COREBASE}/scripts/relocate_sdk.py
>>> ${SDK_OUTPUT}/${SDKPATH}/
>>>> -
>>>> -     # Replace the ##DEFAULT_INSTALL_DIR## with the correct
>>> pattern.
>>>> -     # Escape special characters like '+' and '.' in the SDKPATH
>>>> -     escaped_sdkpath=$(echo ${SDKPATH} |sed -e
>>> "s:[\+\.]:\\\\\\\\\0:g")
>>>> -     sed -i -e "s:##DEFAULT_INSTALL_DIR##:$escaped_sdkpath:"
>>> ${SDK_OUTPUT}/${SDKPATH}/relocate_sdk.py
>>>>    }
>>>>    
>>>>    python check_sdk_sysroots() {
>>>> diff --git a/meta/files/toolchain-shar-relocate.sh
>>> b/meta/files/toolchain-shar-relocate.sh
>>>> index e3c1001..f82ff2b 100644
>>>> --- a/meta/files/toolchain-shar-relocate.sh
>>>> +++ b/meta/files/toolchain-shar-relocate.sh
>>>> @@ -36,7 +36,7 @@ if [ x\${PYTHON} = "x"  ]; then
>>>>        echo "SDK could not be relocated.  No python found."
>>>>        exit 1
>>>>    fi
>>>> -\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py
>>> $target_sdk_dir $dl_path $executable_files
>>>> +\${PYTHON} ${env_setup_script%/*}/relocate_sdk.py
>>> $DEFAULT_INSTALL_DIR $target_sdk_dir $dl_path $executable_files
>>>>    EOF
>>>>    
>>>>    $SUDO_EXEC mv $tdir/relocate_sdk.sh
>>> ${env_setup_script%/*}/relocate_sdk.sh
>>>> diff --git a/scripts/relocate_sdk.py b/scripts/relocate_sdk.py
>>>> index c752fa2..0d5a6f5 100755
>>>> --- a/scripts/relocate_sdk.py
>>>> +++ b/scripts/relocate_sdk.py
>>>> @@ -38,8 +38,6 @@ else:
>>>>        def b(x):
>>>>            return x.encode(sys.getfilesystemencoding())
>>>>    
>>>> -old_prefix = re.compile(b("##DEFAULT_INSTALL_DIR##"))
>>>> -
>>>>    def get_arch():
>>>>        f.seek(0)
>>>>        e_ident =f.read(16)
>>>> @@ -212,19 +210,22 @@ def change_dl_sysdirs(elf_file_name):
>>>>            f.write(sysdirslen)
>>>>    
>>>>    # MAIN
>>>> -if len(sys.argv) < 4:
>>>> +if len(sys.argv) < 5:
>>>>        sys.exit(-1)
>>>>    
>>>>    # In python > 3, strings may also contain Unicode characters.
>>> So, convert
>>>>    # them to bytes
>>>>    if sys.version_info < (3,):
>>>> -    new_prefix = sys.argv[1]
>>>> -    new_dl_path = sys.argv[2]
>>>> +    new_prefix = sys.argv[2]
>>>> +    new_dl_path = sys.argv[3]
>>>>    else:
>>>> -    new_prefix = sys.argv[1].encode()
>>>> -    new_dl_path = sys.argv[2].encode()
>>>> +    new_prefix = sys.argv[2].encode()
>>>> +    new_dl_path = sys.argv[3].encode()
>>>> +
>>>> +executables_list = sys.argv[4:]
>>>>    
>>>> -executables_list = sys.argv[3:]
>>>> +old_prefix_ne = b(sys.argv[1])
>>>> +old_prefix = re.compile(re.escape(old_prefix_ne));
>>>>    
>>>>    for e in executables_list:
>>>>        perms = os.stat(e)[stat.ST_MODE]
>>>>
>>> -- 
>>> _______________________________________________
>>> Openembedded-core mailing list
>>> Openembedded-core@lists.openembedded.org
>>> http://lists.openembedded.org/mailman/listinfo/openembedded-core
>>
>>


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

end of thread, other threads:[~2018-07-26 10:39 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-22 11:20 [PATCH] relocate_sdk.py: remove hardcoded SDK path Ruslan Bilovol
2018-07-17 14:59 ` Ruslan Bilovol
2018-07-17 15:22   ` Christopher Larson
2018-07-25 15:44     ` Richard Purdie
2018-07-26 10:39       ` Ruslan Bilovol

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.