diff mbox

[PATCHv3,19/74] gpsd: use <pkg>_INSTALL_INIT_SYSV mechanism

Message ID 1417357142-14307-20-git-send-email-thomas.petazzoni@free-electrons.com
State Accepted
Headers show

Commit Message

Thomas Petazzoni Nov. 30, 2014, 2:18 p.m. UTC
Also makes the installation of the init script unconditional.

Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
---
 package/gpsd/gpsd.mk | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

Comments

Yann E. MORIN Nov. 30, 2014, 3:38 p.m. UTC | #1
Thomas, All,

On 2014-11-30 15:18 +0100, Thomas Petazzoni spake thusly:
> Also makes the installation of the init script unconditional.
> 
> Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
> ---
>  package/gpsd/gpsd.mk | 9 +++++----
>  1 file changed, 5 insertions(+), 4 deletions(-)
> 
> diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
> index 7dc27e8..5092b38 100644
> --- a/package/gpsd/gpsd.mk
> +++ b/package/gpsd/gpsd.mk
> @@ -206,10 +206,11 @@ define GPSD_INSTALL_TARGET_CMDS
>  		$(SCONS) \
>  		$(GPSD_SCONS_OPTS) \
>  		install)
> -	if [ ! -f $(TARGET_DIR)/etc/init.d/S50gpsd ]; then \
> -		$(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd; \
> -		$(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd; \
> -	fi
> +endef
> +
> +define GPSD_INSTALL_INIT_SYSV
> +	$(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd
> +	$(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd

Unrelated to your patch, but since the variable is a plural DEVICES, I
would expect to be able to set more than one device. In this case, what
is the format of this devices list? Is it comma-separated? If so, the
sed expression above would break, no?

(Cc-ing Simon and Gustavo, since they have contributed significantly to
that package.)

Anyway, since this is not a problem your patch is introducing, and it is
just cleaning up the exisiting code:

Acked-by: "Yann E. MORIN" <yann.morin.1998@free.fr>

Regards,
Yann E. MORIN.

>  endef
>  
>  define GPSD_INSTALL_STAGING_CMDS
> -- 
> 2.1.0
> 
> _______________________________________________
> buildroot mailing list
> buildroot@busybox.net
> http://lists.busybox.net/mailman/listinfo/buildroot
Peter Korsgaard Dec. 1, 2014, 9:57 p.m. UTC | #2
>>>>> "Thomas" == Thomas Petazzoni <thomas.petazzoni@free-electrons.com> writes:

 > Also makes the installation of the init script unconditional.
 > Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>

Committed, thanks.
Peter Korsgaard Dec. 1, 2014, 9:59 p.m. UTC | #3
>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 >> +define GPSD_INSTALL_INIT_SYSV
 >> +	$(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd
 >> +	$(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd

 > Unrelated to your patch, but since the variable is a plural DEVICES, I
 > would expect to be able to set more than one device. In this case, what
 > is the format of this devices list? Is it comma-separated? If so, the
 > sed expression above would break, no?

 > (Cc-ing Simon and Gustavo, since they have contributed significantly to
 > that package.)

I don't know gpsd, but judging from Config.in, S50gpsd and
http://www.catb.org/gpsd/gpsd.html it looks to be space separated, so it
should be OK (unless one of the words ends up with a comma).
diff mbox

Patch

diff --git a/package/gpsd/gpsd.mk b/package/gpsd/gpsd.mk
index 7dc27e8..5092b38 100644
--- a/package/gpsd/gpsd.mk
+++ b/package/gpsd/gpsd.mk
@@ -206,10 +206,11 @@  define GPSD_INSTALL_TARGET_CMDS
 		$(SCONS) \
 		$(GPSD_SCONS_OPTS) \
 		install)
-	if [ ! -f $(TARGET_DIR)/etc/init.d/S50gpsd ]; then \
-		$(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd; \
-		$(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd; \
-	fi
+endef
+
+define GPSD_INSTALL_INIT_SYSV
+	$(INSTALL) -m 0755 -D package/gpsd/S50gpsd $(TARGET_DIR)/etc/init.d/S50gpsd
+	$(SED) 's,^DEVICES=.*,DEVICES=$(BR2_PACKAGE_GPSD_DEVICES),' $(TARGET_DIR)/etc/init.d/S50gpsd
 endef
 
 define GPSD_INSTALL_STAGING_CMDS