All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH] package/tzdata: fix installation commands
@ 2014-11-18 18:38 Yann E. MORIN
  2014-11-18 19:19 ` Arnout Vandecappelle
  2014-11-18 20:50 ` Peter Korsgaard
  0 siblings, 2 replies; 3+ messages in thread
From: Yann E. MORIN @ 2014-11-18 18:38 UTC (permalink / raw)
  To: buildroot

If the destination directory already exists (e.g. because of a re-run or
a custom skeleton), then the zoneinfo files will be installed in a
sub-directory of where we are trying to install them.

Fix that by creating the destination directory and copying the content
of the source directory.

Also fix the host install commands to match what we do in the target
install commands.

Reported-by: Martin Dorwig <dorwig@tetronik.com>
Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
---
 package/tzdata/tzdata.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/package/tzdata/tzdata.mk b/package/tzdata/tzdata.mk
index 47e29c0..d0aa857 100644
--- a/package/tzdata/tzdata.mk
+++ b/package/tzdata/tzdata.mk
@@ -26,8 +26,8 @@ TZDATA_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
 TZDATA_EXTRACT_CMDS =
 
 define TZDATA_INSTALL_TARGET_CMDS
-	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share
-	cp -a $(HOST_DIR)/usr/share/zoneinfo $(TARGET_DIR)/usr/share/zoneinfo
+	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share/zoneinfo
+	cp -a $(HOST_DIR)/usr/share/zoneinfo/* $(TARGET_DIR)/usr/share/zoneinfo
 	cd $(TARGET_DIR)/usr/share/zoneinfo;    \
 	for zone in posix/*; do                 \
 	    ln -sfn "$${zone}" "$${zone##*/}";  \
@@ -59,7 +59,7 @@ define HOST_TZDATA_BUILD_CMDS
 endef
 
 define HOST_TZDATA_INSTALL_CMDS
-	mkdir -p $(HOST_DIR)/usr/share/zoneinfo
+	$(INSTALL) -d -m 0755 $(HOST_DIR)/usr/share/zoneinfo
 	cp -a $(@D)/_output/* $(@D)/*.tab $(HOST_DIR)/usr/share/zoneinfo
 endef
 
-- 
1.9.1

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

* [Buildroot] [PATCH] package/tzdata: fix installation commands
  2014-11-18 18:38 [Buildroot] [PATCH] package/tzdata: fix installation commands Yann E. MORIN
@ 2014-11-18 19:19 ` Arnout Vandecappelle
  2014-11-18 20:50 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Arnout Vandecappelle @ 2014-11-18 19:19 UTC (permalink / raw)
  To: buildroot

On 18/11/14 19:38, Yann E. MORIN wrote:
> If the destination directory already exists (e.g. because of a re-run or
> a custom skeleton), then the zoneinfo files will be installed in a
> sub-directory of where we are trying to install them.
> 
> Fix that by creating the destination directory and copying the content
> of the source directory.
> 
> Also fix the host install commands to match what we do in the target
> install commands.
> 
> Reported-by: Martin Dorwig <dorwig@tetronik.com>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Reviewed-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>

> ---
>  package/tzdata/tzdata.mk | 6 +++---
>  1 file changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/package/tzdata/tzdata.mk b/package/tzdata/tzdata.mk
> index 47e29c0..d0aa857 100644
> --- a/package/tzdata/tzdata.mk
> +++ b/package/tzdata/tzdata.mk
> @@ -26,8 +26,8 @@ TZDATA_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME))
>  TZDATA_EXTRACT_CMDS =
>  
>  define TZDATA_INSTALL_TARGET_CMDS
> -	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share
> -	cp -a $(HOST_DIR)/usr/share/zoneinfo $(TARGET_DIR)/usr/share/zoneinfo
> +	$(INSTALL) -d -m 0755 $(TARGET_DIR)/usr/share/zoneinfo
> +	cp -a $(HOST_DIR)/usr/share/zoneinfo/* $(TARGET_DIR)/usr/share/zoneinfo

 Alternatively, the two lines could be replaced with

	rsync -a $(HOST_DIR)/usr/share/zoneinfo/ \
		$(TARGET_DIR)/usr/share/zoneinfo

(trailing / on the source dir avoids creating an additional directory level at
the destination)


 Maybe we should decide in general if we prefer cp or rsync.

 And then maybe we should also think about doing rsync --inplace or cp --reflink
to make use of btrfs COW...


 Regards,
 Arnout

>  	cd $(TARGET_DIR)/usr/share/zoneinfo;    \
>  	for zone in posix/*; do                 \
>  	    ln -sfn "$${zone}" "$${zone##*/}";  \
> @@ -59,7 +59,7 @@ define HOST_TZDATA_BUILD_CMDS
>  endef
>  
>  define HOST_TZDATA_INSTALL_CMDS
> -	mkdir -p $(HOST_DIR)/usr/share/zoneinfo
> +	$(INSTALL) -d -m 0755 $(HOST_DIR)/usr/share/zoneinfo
>  	cp -a $(@D)/_output/* $(@D)/*.tab $(HOST_DIR)/usr/share/zoneinfo
>  endef
>  
> 


-- 
Arnout Vandecappelle                          arnout at mind be
Senior Embedded Software Architect            +32-16-286500
Essensium/Mind                                http://www.mind.be
G.Geenslaan 9, 3001 Leuven, Belgium           BE 872 984 063 RPR Leuven
LinkedIn profile: http://www.linkedin.com/in/arnoutvandecappelle
GPG fingerprint:  7CB5 E4CC 6C2E EFD4 6E3D A754 F963 ECAB 2450 2F1F

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

* [Buildroot] [PATCH] package/tzdata: fix installation commands
  2014-11-18 18:38 [Buildroot] [PATCH] package/tzdata: fix installation commands Yann E. MORIN
  2014-11-18 19:19 ` Arnout Vandecappelle
@ 2014-11-18 20:50 ` Peter Korsgaard
  1 sibling, 0 replies; 3+ messages in thread
From: Peter Korsgaard @ 2014-11-18 20:50 UTC (permalink / raw)
  To: buildroot

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > If the destination directory already exists (e.g. because of a re-run or
 > a custom skeleton), then the zoneinfo files will be installed in a
 > sub-directory of where we are trying to install them.

 > Fix that by creating the destination directory and copying the content
 > of the source directory.

 > Also fix the host install commands to match what we do in the target
 > install commands.

 > Reported-by: Martin Dorwig <dorwig@tetronik.com>
 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Committed, thanks.

-- 
Bye, Peter Korsgaard

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

end of thread, other threads:[~2014-11-18 20:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-11-18 18:38 [Buildroot] [PATCH] package/tzdata: fix installation commands Yann E. MORIN
2014-11-18 19:19 ` Arnout Vandecappelle
2014-11-18 20:50 ` Peter Korsgaard

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.