Skip to contentSkip to conversation

package/tzdata: fix installation commands

PATCH New Yann E. MORIN 3 participants 3 messages Nov 18, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 package/tzdata: fix installation commands

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.

---
 package/tzdata/tzdata.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/tzdata/tzdata.mk +3 -3
index 47e29c0..d0aa857 100644
@@ -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
 
Signature · 1 line
1.9.1
#1 lore raw

PATCH 1/1 package/tzdata: fix installation commands

Quoted 4 lines · Yann E. MORIN

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.

Quoted 8 lines

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.

Quoted 9 lines
---
 package/tzdata/tzdata.mk | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)
package/tzdata/tzdata.mk +0 -0
index 47e29c0..d0aa857 100644

package/tzdata/tzdata.mk TZDATA_LOCALTIME = $(call qstrip,$(BR2_TARGET_LOCALTIME)) · line 30

Quoted 7 lines
package/tzdata/tzdata.mk +2 -2
@@ -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

Quoted 13 lines
package/tzdata/tzdata.mk +1 -1
 	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
 
Signature · 6 lines
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
#2 lore raw

PATCH 1/1 package/tzdata: fix installation commands

In reply to Yann E. MORIN
Quoted 6 lines
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Yann" == Yann E MORIN <[email protected]> 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.

Quoted 8 lines

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.

Committed, thanks.

Signature · 1 line
Bye, Peter Korsgaard