Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Arnout Vandecappelle <arnout@mind.be>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH 3/5] package/tzdata: install a default localtime
Date: Thu, 09 Jan 2014 18:13:23 +0100	[thread overview]
Message-ID: <52CED8B3.5090800@mind.be> (raw)
In-Reply-To: <d33faa4dcebfdac0f304495fcdac3db1f31c791d.1389134731.git.yann.morin.1998@free.fr>

On 07/01/14 23:46, Yann E. MORIN wrote:
> From: "Yann E. MORIN" <yann.morin.1998@free.fr>
>
> Add an option to install a default localtime.
>
> since tzdata only makes sense for (e)glibc, we don't care
> that we install timezone files that uClibc can't understand.
>
> Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
> ---
>   package/tzdata/Config.in | 10 ++++++++++
>   package/tzdata/tzdata.mk |  8 +++++++-
>   2 files changed, 17 insertions(+), 1 deletion(-)
>
> diff --git a/package/tzdata/Config.in b/package/tzdata/Config.in
> index 1be6814..c0ede1f 100644
> --- a/package/tzdata/Config.in
> +++ b/package/tzdata/Config.in
> @@ -23,4 +23,14 @@ config BR2_PACKAGE_TZDATA_ZONELIST
>   	  The full list is the list of files in the time zone database source,
>   	  not including the build and .tab files.
>
> +config BR2_PACKAGE_TZDATA_LOCALTIME
> +	string "default local time"
> +	help
> +	  The time zone to install as the default local time, expressed as a
> +	  tzdata location, such as:
> +	    GMT, Europe/Paris, America/New_York, Pacific/Wallis...

  I hope this will not confuse users to think that they can specify 
multiple values separated by a comma...

> +
> +	  If empty, no local time will be set, and the dates will be
> +	  expressed in UTC.
> +
>   endif
> diff --git a/package/tzdata/tzdata.mk b/package/tzdata/tzdata.mk
> index 1cb5b3f..74263e1 100644
> --- a/package/tzdata/tzdata.mk
> +++ b/package/tzdata/tzdata.mk
> @@ -39,8 +39,14 @@ define TZDATA_INSTALL_TARGET_CMDS
>   	cp -a $(@D)/_output/* $(TARGET_DIR)/usr/share/zoneinfo
>   	cd $(TARGET_DIR)/usr/share/zoneinfo;    \
>   	for zone in posix/*; do                 \
> -	    ln -sfn "$${zone}" "$${zone##*/}";    \
> +	    ln -sfn "$${zone}" "$${zone##*/}";  \
>   	done
> +	if [ -n "$(BR2_PACKAGE_TZDATA_LOCALTIME)" ]; then                   \

  Ick, this looks ugly... If it is unset, make will evaluate it to

	if [ -n """" ]; then ...

which is indeed an empty string, but not so nice... IOW, it's missing a 
qstrip.

  Also, instead of a shell condition I'd prefer a make condition, but 
that's probably a matter of taste.

> +	    cd $(TARGET_DIR)/etc;                                           \
> +	    ln -sf ../usr/share/zoneinfo/$(BR2_PACKAGE_TZDATA_LOCALTIME)    \

  Same here. But also quotes should be added in case the user put 
something stupid there.

> +	           localtime;                                               \
> +	    echo "$(BR2_PACKAGE_TZDATA_LOCALTIME)" >timezone;               \

  Same here. The quotes are not actually quoting anything now...


  Regards,
  Arnout

> +	fi
>   endef
>
>   $(eval $(generic-package))
>


-- 
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

  reply	other threads:[~2014-01-09 17:13 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-01-07 22:46 [Buildroot] [PATCH 0/5] Misc accumulated changes Yann E. MORIN
2014-01-07 22:46 ` [Buildroot] [PATCH 1/5] Makefile: support running graph-depends from out-of-tree Yann E. MORIN
2014-01-09 20:28   ` Peter Korsgaard
2014-01-07 22:46 ` [Buildroot] [PATCH 2/5] toolchain/external: fix wrapper by not passing conflicting flags Yann E. MORIN
2014-01-08 12:45   ` Maxime Hadjinlian
2014-01-08 15:51     ` Thomas Petazzoni
2014-01-08 15:57       ` Maxime Hadjinlian
2014-01-08 18:01         ` Yann E. MORIN
2014-01-08 18:46           ` Maxime Hadjinlian
2014-01-09 20:28   ` Peter Korsgaard
2014-01-07 22:46 ` [Buildroot] [PATCH 3/5] package/tzdata: install a default localtime Yann E. MORIN
2014-01-09 17:13   ` Arnout Vandecappelle [this message]
2014-01-09 22:57     ` Yann E. MORIN
2014-01-09 20:29   ` Peter Korsgaard
2014-01-28 21:13     ` Thomas Petazzoni
2014-01-07 22:46 ` [Buildroot] [PATCH 4/5] system: default to empty issue/hostname for custom skeleton Yann E. MORIN
2014-01-09 20:32   ` Peter Korsgaard
2014-01-09 20:44     ` Yann E. MORIN
2014-01-10  8:52       ` Sagaert Johan
2014-01-10 14:35         ` Peter Korsgaard
2014-01-07 22:46 ` [Buildroot] [PATCH 5/5] manual: add section about dealing efficiently with big image files Yann E. MORIN
2014-01-09 20:29   ` Peter Korsgaard

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=52CED8B3.5090800@mind.be \
    --to=arnout@mind.be \
    --cc=buildroot@busybox.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox