Bug#855399: debian-installer: EXTRAFILES copies all parent directories and does not copy directories

2017-02-19 Thread Tshepang Lekhonkhobe
On Sun, Feb 19, 2017 at 1:26 AM, Cyril Brulebois  wrote:
> Hi,
>
> Tshepang Lekhonkhobe  (2017-02-17):
>> Adding 'EXTRAFILES = ~/foo/bar/baz' to config/local resulted in
>> /home/tshepang/foo/bar directory initrd.
>> Also, if 'baz' is a directory, it did not get copied.
>
> Please note it's called EXTRA*FILES* so I'm not really surprised that it
> works on files instead of on directories… Anyway, you could just put the
> files you need in the build/ directory, that works well with:
>
> EXTRA_FILES = foo/bar/baz/*

I would like to avoid copying those files into the build/ directory if
I can simply specify their location in a variable.

> If you have several levels, you can use this instead:
>
> EXTRAFILES = `find foo -type f`
>
> If anything, I think we should improve (as in: write) documentations in
> build/README instead of changing a long standing behaviour which might
> be relied on.

I am more interested in being able to specify a directory tree. Should
I create a new variable to avoid breaking existing setups?

> By the way, this patch seems to be reversed:

Sorry, I don't know what happened there.

>> diff --git a/build/Makefile b/build/Makefile
>> index 88ccad9fd..8f87b1559 100644
>> --- a/build/Makefile
>> +++ b/build/Makefile
>> @@ -400,8 +400,8 @@ ifdef EXTRAFILES
>>   # Copy in any extra files.
>>   set -e; \
>>   for file in $(EXTRAFILES); do \
>> - mkdir --parents $(TREE); \
>> - cp --archive --recursive $$file $(TREE); \
>> + mkdir -p $(TREE)/`dirname $$file`; \
>> + cp -a $$file $(TREE)/$$file; \
>>   done
>>  endif
>
>
> KiBi.



Bug#855399: debian-installer: EXTRAFILES copies all parent directories and does not copy directories

2017-02-18 Thread Cyril Brulebois
Hi,

Tshepang Lekhonkhobe  (2017-02-17):
> Adding 'EXTRAFILES = ~/foo/bar/baz' to config/local resulted in
> /home/tshepang/foo/bar directory initrd.
> Also, if 'baz' is a directory, it did not get copied.

Please note it's called EXTRA*FILES* so I'm not really surprised that it
works on files instead of on directories… Anyway, you could just put the
files you need in the build/ directory, that works well with:

EXTRA_FILES = foo/bar/baz/*

If you have several levels, you can use this instead:

EXTRAFILES = `find foo -type f`

If anything, I think we should improve (as in: write) documentations in
build/README instead of changing a long standing behaviour which might
be relied on.

By the way, this patch seems to be reversed:
> diff --git a/build/Makefile b/build/Makefile
> index 88ccad9fd..8f87b1559 100644
> --- a/build/Makefile
> +++ b/build/Makefile
> @@ -400,8 +400,8 @@ ifdef EXTRAFILES
>   # Copy in any extra files.
>   set -e; \
>   for file in $(EXTRAFILES); do \
> - mkdir --parents $(TREE); \
> - cp --archive --recursive $$file $(TREE); \
> + mkdir -p $(TREE)/`dirname $$file`; \
> + cp -a $$file $(TREE)/$$file; \
>   done
>  endif


KiBi.


signature.asc
Description: Digital signature


Bug#855399: debian-installer: EXTRAFILES copies all parent directories and does not copy directories

2017-02-17 Thread Tshepang Lekhonkhobe
Package: debian-installer
Version: 20170127
Severity: normal

Adding 'EXTRAFILES = ~/foo/bar/baz' to config/local resulted in
/home/tshepang/foo/bar directory initrd.
Also, if 'baz' is a directory, it did not get copied.

-- System Information:
Debian Release: 9.0
  APT prefers testing
  APT policy: (500, 'testing')
Architecture: amd64 (x86_64)

Kernel: Linux 4.9.0-1-amd64 (SMP w/4 CPU cores)
Locale: LANG=en_ZA.UTF-8, LC_CTYPE=en_ZA.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
Init: systemd (via /run/systemd/system)

-- no debconf information
diff --git a/build/Makefile b/build/Makefile
index 88ccad9fd..8f87b1559 100644
--- a/build/Makefile
+++ b/build/Makefile
@@ -400,8 +400,8 @@ ifdef EXTRAFILES
# Copy in any extra files.
set -e; \
for file in $(EXTRAFILES); do \
-   mkdir --parents $(TREE); \
-   cp --archive --recursive $$file $(TREE); \
+   mkdir -p $(TREE)/`dirname $$file`; \
+   cp -a $$file $(TREE)/$$file; \
done
 endif