[OE-core] [oe-core][PATCH] lib.oe.path: "copyhardlinktree" should be able to copy folder containng hidden files only

2020-01-31 Thread Ivan Efimov via Openembedded-core
Note: file is "hidden" if it's name starts with dot (.)

sstate.bbclass uses "copyhardlinktree" function to install sstate cache
content. Function "copyhardlinktree" uses "cp" command line which fail on copy
directories with hidden files only.  As a result folder containing only hidden 
files
cannot be installed from sstate cache.

"cp" source file glob argument has been changed from
  ./.??* ./*
to
  /./

Steps for reproduce:

* Add next lines into some recipe ...

inherit deploy
do_deploy() {
touch ${DEPLOYDIR}/.hidden
}
addtask deploy
* ... and try to build it

Error like next will occur:

Exception: subprocess.CalledProcessError: Command 'cp -afl --preserve=xattr 
./.??* ./* /path/to/deploy/images/machine' returned non-zero exit status 1.

Subprocess output:
cp: cannot stat './*': No such file or directory

Signed-off-by: Ivan Efimov 
---
 meta/lib/oe/path.py | 12 +++-
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/meta/lib/oe/path.py b/meta/lib/oe/path.py
index fa209b9795..49e13225d0 100644
--- a/meta/lib/oe/path.py
+++ b/meta/lib/oe/path.py
@@ -104,17 +104,11 @@ def copyhardlinktree(src, dst):
 # writers try and create a directory at the same time
 cmd = "cd %s; find . -type d -print | tar --xattrs 
--xattrs-include='*' -cf - -S -C %s -p --no-recursion --files-from - | tar 
--xattrs --xattrs-include='*' -xhf - -C %s" % (src, src, dst)
 subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
-source = ''
+source = src
 if os.path.isdir(src):
-if len(glob.glob('%s/.??*' % src)) > 0:
-source = './.??* '
-source += './*'
-s_dir = src
-else:
-source = src
-s_dir = os.getcwd()
+source += '/./'
 cmd = 'cp -afl --preserve=xattr %s %s' % (source, 
os.path.realpath(dst))
-subprocess.check_output(cmd, shell=True, cwd=s_dir, 
stderr=subprocess.STDOUT)
+subprocess.check_output(cmd, shell=True, stderr=subprocess.STDOUT)
 else:
 copytree(src, dst)
 
-- 
2.17.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [morty][PATCH v3] perl, do_install_ptest_base: add "--" into "tar" command line

2019-03-03 Thread Ivan Efimov
Add explicit separator "--" between options and arguments in "tar"
command to avoid mistakenly detection file with name starts with "-" as
an unknown option

Steps for reproduce issue:

* Add next variables into "conf/local.conf":

  CC_append_pn-perl = " -MD -Ml,M"
  CXX_append_pn-perl = " -MD -Ml,M"

* Then "bitbake perl"
* Task "do_install_ptest_base" will fail with error:

tar: invalid option -- '.'

  because of presence next file

tmp/work/i586-poky-linux/perl/5.22.1-r0/perl-5.22.1/-.d

  which starts from minus (-) sign and Yocto tries to run:

    tar  -.d 

  and "tar" parse "-.d" as a option instead of file

Signed-off-by: Ivan Efimov 
---
 meta/recipes-devtools/perl/perl-ptest.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/perl/perl-ptest.inc 
b/meta/recipes-devtools/perl/perl-ptest.inc
index d136c5c0e4..51367b5ed9 100644
--- a/meta/recipes-devtools/perl/perl-ptest.inc
+++ b/meta/recipes-devtools/perl/perl-ptest.inc
@@ -9,7 +9,7 @@ do_install_ptest () {
sed -e "s:\/opt:\/usr:" -i Porting/add-package.pl
sed -e "s:\/local\/gnu\/:\/:" -i hints/cxux.sh
tar -c --exclude=\*.o --exclude=libperl.so --exclude=Makefile 
--exclude=makefile --exclude=hostperl \
-   --exclude=miniperl --exclude=generate_uudmap --exclude=patches 
* | ( cd ${D}${PTEST_PATH} && tar -x )
+   --exclude=miniperl --exclude=generate_uudmap --exclude=patches 
-- * | ( cd ${D}${PTEST_PATH} && tar -x )
 
sed -i -e "s,${D},,g" \
   -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [morty][PATCH v2] perl, do_install_ptest_base: add "--" into "tar" command line

2019-03-03 Thread Ivan Efimov
Hi Alex,

Do you mean "master" branch of OE-core?

   I tried to reproduce the same bug on "master" branch, but fail.
   I know, that the same bug with "--" missing in "tar" command line is present 
in "master" branch,
  but if it does not prevent success compilation, so i'm not sure, that my 
patch will be accepted.

Best regards,
Ivan

- Original Message -
From: "Alexander Kanavin" 
To: "Ivan Efimov" 
Cc: "OE-core" 
Sent: Sunday, March 3, 2019 10:40:43 PM
Subject: Re: [OE-core] [morty][PATCH v2] perl, do_install_ptest_base: add "--" 
into "tar" command line

On Sun, 3 Mar 2019 at 18:38, Ivan Efimov  wrote:
> Upstream-Status: Pending

This is used only in patches to upstream source, and so not needed here.

Alex
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [morty][PATCH v2] perl, do_install_ptest_base: add "--" into "tar" command line

2019-03-03 Thread Ivan Efimov
Add explicit separator "--" between options and arguments in "tar"
command to avoid mistakenly detection file with name starts with "-" as
an unknown option

Steps for reproduce issue:

* Add next variables into "conf/local.conf":

  CC_append_pn-perl = " -MD -Ml,M"
  CXX_append_pn-perl = " -MD -Ml,M"

* Then "bitbake perl"
* Task "do_install_ptest_base" will fail with error:

tar: invalid option -- '.'

  because of presence next file

tmp/work/i586-poky-linux/perl/5.22.1-r0/perl-5.22.1/-.d

  which starts from minus (-) sign and Yocto tries to run:

tar  -.d 

  and "tar" parse "-.d" as a option instead of file

Upstream-Status: Pending

Signed-off-by: Ivan Efimov 
---
 meta/recipes-devtools/perl/perl-ptest.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/meta/recipes-devtools/perl/perl-ptest.inc 
b/meta/recipes-devtools/perl/perl-ptest.inc
index d136c5c0e4..51367b5ed9 100644
--- a/meta/recipes-devtools/perl/perl-ptest.inc
+++ b/meta/recipes-devtools/perl/perl-ptest.inc
@@ -9,7 +9,7 @@ do_install_ptest () {
sed -e "s:\/opt:\/usr:" -i Porting/add-package.pl
sed -e "s:\/local\/gnu\/:\/:" -i hints/cxux.sh
tar -c --exclude=\*.o --exclude=libperl.so --exclude=Makefile 
--exclude=makefile --exclude=hostperl \
-   --exclude=miniperl --exclude=generate_uudmap --exclude=patches 
* | ( cd ${D}${PTEST_PATH} && tar -x )
+   --exclude=miniperl --exclude=generate_uudmap --exclude=patches 
-- * | ( cd ${D}${PTEST_PATH} && tar -x )
 
sed -i -e "s,${D},,g" \
   -e "s,--sysroot=${STAGING_DIR_HOST},,g" \
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH v2] btrfs-tools, Makefile: remove duplicated '-o $@' option from CC cmdline for libbtrfsutil/ folder

2019-03-03 Thread Ivan Efimov
Command line for target "libbtrfsutil/%.o" contained
double usage of '-o $@' option and causes compilation error:

 cc1: error: too many filenames given

Upsteam-Status: Pending

Signed-off-by: Ivan Efimov 
---
 ...01-Makefile-fix-double-o-compiler-option-using.patch | 17 +
 meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb |  1 +
 2 files changed, 18 insertions(+)
 create mode 100644 
meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-fix-double-o-compiler-option-using.patch

diff --git 
a/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-fix-double-o-compiler-option-using.patch
 
b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-fix-double-o-compiler-option-using.patch
new file mode 100644
index 00..335067bc1f
--- /dev/null
+++ 
b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-fix-double-o-compiler-option-using.patch
@@ -0,0 +1,17 @@
+Command line for target "libbtrfsutil/%.o" contained double usage
+  of '-o $@' option and caused error:
+cc1: error: too many filenames given
+
+Index: git/Makefile
+===
+--- git.orig/Makefile
 git/Makefile
+@@ -414,7 +414,7 @@ libbtrfs.so.0 libbtrfs.so: libbtrfs.so.0
+ 
+ libbtrfsutil/%.o: libbtrfsutil/%.c
+   @echo "[CC] $@"
+-  $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) -o $@ -c $< -o $@
++  $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) -c $< -o $@
+ 
+ libbtrfsutil.so.$(libbtrfsutil_version): $(libbtrfsutil_objects)
+   @echo "[LD] $@"
diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb 
b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb
index 1b4f515cb6..f1c4691313 100644
--- a/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb
+++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb
@@ -19,6 +19,7 @@ SRC_URI = 
"git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \
file://0001-Makefile-build-mktables-using-native-gcc.patch \
file://0001-Add-LDFLAGS-when-building-libbtrfsutil.so.patch \

file://0001-Add-a-possibility-to-specify-where-python-modules-ar.patch \
+   file://0001-Makefile-fix-double-o-compiler-option-using.patch \
"
 
 inherit autotools-brokensep pkgconfig manpages distutils3-base
-- 
2.14.1

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


Re: [OE-core] [PATCH] btrfs-tools Makefile: remove duplicated '-o $@' option from CC cmdline for libbtrfsutil/ subfolder

2019-02-25 Thread Ivan Efimov
Thank you for info about 
https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded

   I mistakenly followed guide 
https://wiki.yoctoproject.org/wiki/Poky_Contributions.

Best regards,
Ivan

- Original Message -
From: "Ross Burton" 
To: "Ivan Efimov" 
Cc: "OE-core" 
Sent: Monday, February 25, 2019 4:24:24 PM
Subject: Re: [OE-core] [PATCH] btrfs-tools Makefile: remove duplicated '-o $@' 
option from CC cmdline for libbtrfsutil/ subfolder

Please don't send patches in HTML  [1].  The patch you add is also
missing a Signed-off-by and Upstream-Status [2]  For such a trivial
build issue, we encourage submitting the patch upstream too so we
don't have to carry it forever.

[1] https://www.openembedded.org/wiki/How_to_submit_a_patch_to_OpenEmbedded
[2] https://www.openembedded.org/wiki/Commit_Patch_Message_Guidelines

On Fri, 22 Feb 2019 at 18:32, Ivan Efimov  wrote:
>
> Command line for target "libbtrfsutil/%.o" contained
> double usage of '-o $@' option and causes compilation error:
>
>  cc1: error: too many filenames given
>
> Signed-off-by: Ivan Efimov 
> ---
>  ...01-Makefile-fix-double-o-compiler-option-using.patch | 17 
> +
>  meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb |  1 +
>  2 files changed, 18 insertions(+)
>  create mode 100644 
> meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-fix-double-o-compiler-option-using.patch
>
> diff --git 
> a/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-fix-double-o-compiler-option-using.patch
>  b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-fix-dou$
> le-o-compiler-option-using.patch
> new file mode 100644
> index 00..335067bc1f
> --- /dev/null
> +++ 
> b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-fix-double-o-compiler-option-using.patch
> @@ -0,0 +1,17 @@
> +Command line for target "libbtrfsutil/%.o" contained double usage
> +  of '-o $@' option and caused error:
> +cc1: error: too many filenames given
> +
> +Index: git/Makefile
> +===
> +--- git.orig/Makefile
>  git/Makefile
> +@@ -414,7 +414,7 @@ libbtrfs.so.0 libbtrfs.so: libbtrfs.so.0
> +
> + libbtrfsutil/%.o: libbtrfsutil/%.c
> +   @echo "[CC] $@"
> +-  $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) -o $@ -c $< -o $@
> ++  $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) -c $< -o $@
> +
> + libbtrfsutil.so.$(libbtrfsutil_version): $(libbtrfsutil_objects)
> +   @echo "[LD] $@"
> diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb 
> b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb
> index 1b4f515cb6..f1c4691313 100644
> --- a/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb
> +++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb
> @@ -19,6 +19,7 @@ SRC_URI = 
> "git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \
> file://0001-Makefile-build-mktables-using-native-gcc.patch \
> file://0001-Add-LDFLAGS-when-building-libbtrfsutil.so.patch \
> 
> file://0001-Add-a-possibility-to-specify-where-python-modules-ar.patch \
> +   file://0001-Makefile-fix-double-o-compiler-option-using.patch \
> "
>
>  inherit autotools-brokensep pkgconfig manpages distutils3-base
> --
> 2.14.1
> --
> ___
> Openembedded-core mailing list
> Openembedded-core@lists.openembedded.org
> http://lists.openembedded.org/mailman/listinfo/openembedded-core
-- 
[ https://inango.com/ |] 
Ivan Efimov 
Architect, Arch Group 
i.efi...@inango-systems.com 
T +7 343 298 0147 C +7 904 9 888 350 
[ https://inango.com/ | inango.com ] [ https://www.linkedin.com/company/inango ]
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH] btrfs-tools Makefile: remove duplicated '-o $@' option from CC cmdline for libbtrfsutil/ subfolder

2019-02-22 Thread Ivan Efimov
Command line for target "libbtrfsutil/%.o" contained 
double usage of '-o $@' option and causes compilation error: 

cc1: error: too many filenames given 

Signed-off-by: Ivan Efimov  
--- 
...01-Makefile-fix-double-o-compiler-option-using.patch | 17 + 
meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb | 1 + 
2 files changed, 18 insertions(+) 
create mode 100644 
meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-fix-double-o-compiler-option-using.patch
 

diff --git 
a/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-fix-double-o-compiler-option-using.patch
 b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-fix-dou$ 
le-o-compiler-option-using.patch 
new file mode 100644 
index 00..335067bc1f 
--- /dev/null 
+++ 
b/meta/recipes-devtools/btrfs-tools/btrfs-tools/0001-Makefile-fix-double-o-compiler-option-using.patch
 
@@ -0,0 +1,17 @@ 
+Command line for target "libbtrfsutil/%.o" contained double usage 
+ of '-o $@' option and caused error: 
+ cc1: error: too many filenames given 
+ 
+Index: git/Makefile 
+=== 
+--- git.orig/Makefile 
 git/Makefile 
+@@ -414,7 +414,7 @@ libbtrfs.so.0 libbtrfs.so: libbtrfs.so.0 
+ 
+ libbtrfsutil/%.o: libbtrfsutil/%.c 
+ @echo " [CC] $@" 
+- $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) -o $@ -c $< -o $@ 
++ $(Q)$(CC) $(LIBBTRFSUTIL_CFLAGS) -c $< -o $@ 
+ 
+ libbtrfsutil.so.$(libbtrfsutil_version): $(libbtrfsutil_objects) 
+ @echo " [LD] $@" 
diff --git a/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb 
b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb 
index 1b4f515cb6..f1c4691313 100644 
--- a/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb 
+++ b/meta/recipes-devtools/btrfs-tools/btrfs-tools_4.20.1.bb 
@@ -19,6 +19,7 @@ SRC_URI = 
"git://git.kernel.org/pub/scm/linux/kernel/git/kdave/btrfs-progs.git \ 
file://0001-Makefile-build-mktables-using-native-gcc.patch \ 
file://0001-Add-LDFLAGS-when-building-libbtrfsutil.so.patch \ 
file://0001-Add-a-possibility-to-specify-where-python-modules-ar.patch \ 
+ file://0001-Makefile-fix-double-o-compiler-option-using.patch \ 
" 

inherit autotools-brokensep pkgconfig manpages distutils3-base 
-- 
2.14.1 
-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core


[OE-core] [PATCH][morty] perl, do_install_ptest_base: add "--" into "tar" command line

2019-02-22 Thread Ivan Efimov
Add explicit separator "--" between options and arguments in "tar" 
command to avoid mistakenly detection file which name starts with "-" as 
an unknown option 

Steps for reproduce issue: 

* Add next variables into "conf/local.conf": 

CC_append_pn-perl = " -MD -Ml,M" 
CXX_append_pn-perl = " -MD -Ml,M" 

* Then "bitbake perl" 
* Task "do_install_ptest_base" will fail with error: 

tar: invalid option -- '.' 

because of presence next file 

tmp/work/i586-poky-linux/perl/5.22.1-r0/perl-5.22.1/-.d 

which starts from minus (-) sign and Yocto tries to run: 

tar  -.d  

and "tar" parse "-.d" as a option instead of file 

Signed-off-by: Ivan Efimov  
--- 
meta/recipes-devtools/perl/perl-ptest.inc | 2 +- 
1 file changed, 1 insertion(+), 1 deletion(-) 

diff --git a/meta/recipes-devtools/perl/perl-ptest.inc 
b/meta/recipes-devtools/perl/perl-ptest.inc 
index d136c5c0e4..51367b5ed9 100644 
--- a/meta/recipes-devtools/perl/perl-ptest.inc 
+++ b/meta/recipes-devtools/perl/perl-ptest.inc 
@@ -9,7 +9,7 @@ do_install_ptest () { 
sed -e "s:\/opt:\/usr:" -i Porting/add-package.pl 
sed -e "s:\/local\/gnu\/:\/:" -i hints/cxux.sh 
tar -c --exclude=\*.o --exclude=libperl.so --exclude=Makefile 
--exclude=makefile --exclude=hostperl \ 
- --exclude=miniperl --exclude=generate_uudmap --exclude=patches * | ( cd 
${D}${PTEST_PATH} && tar -x ) 
+ --exclude=miniperl --exclude=generate_uudmap --exclude=patches -- * | ( cd 
${D}${PTEST_PATH} && tar -x ) 

sed -i -e "s,${D},,g" \ 
-e "s,--sysroot=${STAGING_DIR_HOST},,g" \ 
-- 
2.14.1 

-- 
___
Openembedded-core mailing list
Openembedded-core@lists.openembedded.org
http://lists.openembedded.org/mailman/listinfo/openembedded-core