[v3,3/3] Makefile: rename tools binaries
diff mbox series

Message ID 20191021203157.28524-4-adrian.freihofer@siemens.com
State Accepted
Headers show
Series
  • lstat instead of stat
Related show

Commit Message

Freihofer, Adrian Oct. 21, 2019, 8:31 p.m. UTC
This adds a "swupdate-" prefix to all binary files in the tools
directory.
Binaries should not be installed as /usr/bin/client or
/usr/bin/progress. On the one hand, it is risky for name conflicts.
On the other hand, the name gives little indication of the meaning of
the binary. This renaming is also required by Debian maintainers.

Another reason for the renaming is that do_install in meta-swupdate is
currently defective. The binaries are installed twice, once with and
once without the swupdate prefix. If the binaries are already installed
correctly named by "make install", the code that renames and duplicates
the binaries can be deleted from meta-swupdate.

This change also fixes an inconsistency in the "make install" target.
The recently added service files call the binaries named swupdate-*.
But these binaries have not yet been installed. The inconsistency was
overlooked because meta-swupdate provides two copies of the binaries.

The swupdate-sysrestart was missing in the .gitignore file.

Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
---
 .gitignore                                          | 9 +++++----
 tools/Makefile                                      | 8 ++++----
 tools/{client.c => swupdate-client.c}               | 0
 tools/{hawkbitcfg.c => swupdate-hawkbitcfg.c}       | 0
 tools/{progress.c => swupdate-progress.c}           | 0
 tools/{sendtohawkbit.c => swupdate-sendtohawkbit.c} | 0
 6 files changed, 9 insertions(+), 8 deletions(-)
 rename tools/{client.c => swupdate-client.c} (100%)
 rename tools/{hawkbitcfg.c => swupdate-hawkbitcfg.c} (100%)
 rename tools/{progress.c => swupdate-progress.c} (100%)
 rename tools/{sendtohawkbit.c => swupdate-sendtohawkbit.c} (100%)

Comments

Stefano Babic Oct. 22, 2019, 9:55 a.m. UTC | #1
On 21/10/19 22:31, Adrian Freihofer wrote:
> This adds a "swupdate-" prefix to all binary files in the tools
> directory.
> Binaries should not be installed as /usr/bin/client or
> /usr/bin/progress. On the one hand, it is risky for name conflicts.
> On the other hand, the name gives little indication of the meaning of
> the binary. This renaming is also required by Debian maintainers.
> 
> Another reason for the renaming is that do_install in meta-swupdate is
> currently defective. The binaries are installed twice, once with and
> once without the swupdate prefix. If the binaries are already installed
> correctly named by "make install", the code that renames and duplicates
> the binaries can be deleted from meta-swupdate.
> 
> This change also fixes an inconsistency in the "make install" target.
> The recently added service files call the binaries named swupdate-*.
> But these binaries have not yet been installed. The inconsistency was
> overlooked because meta-swupdate provides two copies of the binaries.
> 
> The swupdate-sysrestart was missing in the .gitignore file.
> 
> Signed-off-by: Adrian Freihofer <adrian.freihofer@siemens.com>
> ---
>  .gitignore                                          | 9 +++++----
>  tools/Makefile                                      | 8 ++++----
>  tools/{client.c => swupdate-client.c}               | 0
>  tools/{hawkbitcfg.c => swupdate-hawkbitcfg.c}       | 0
>  tools/{progress.c => swupdate-progress.c}           | 0
>  tools/{sendtohawkbit.c => swupdate-sendtohawkbit.c} | 0
>  6 files changed, 9 insertions(+), 8 deletions(-)
>  rename tools/{client.c => swupdate-client.c} (100%)
>  rename tools/{hawkbitcfg.c => swupdate-hawkbitcfg.c} (100%)
>  rename tools/{progress.c => swupdate-progress.c} (100%)
>  rename tools/{sendtohawkbit.c => swupdate-sendtohawkbit.c} (100%)
> 
> diff --git a/.gitignore b/.gitignore
> index af9f5cc..652888b 100644
> --- a/.gitignore
> +++ b/.gitignore
> @@ -35,10 +35,11 @@ swupdate
>  swupdate_unstripped*
>  lua_swupdate.so*
>  tools/*_unstripped
> -tools/client
> -tools/progress
> -tools/sendtohawkbit
> -tools/hawkbitcfg
> +tools/swupdate-client
> +tools/swupdate-progress
> +tools/swupdate-sendtohawkbit
> +tools/swupdate-hawkbitcfg
> +tools/swupdate-sysrestart
>  tools/*.map
>  tools/*.out
>  
> diff --git a/tools/Makefile b/tools/Makefile
> index ca0a4a3..206b0eb 100644
> --- a/tools/Makefile
> +++ b/tools/Makefile
> @@ -9,10 +9,10 @@
>  # SPDX-License-Identifier:     GPL-2.0-or-later
>  
>  lib-y += \
> -	 client.o \
> -	 progress.o \
> -	 hawkbitcfg.o \
> -	 sendtohawkbit.o \
> +	 swupdate-client.o \
> +	 swupdate-progress.o \
> +	 swupdate-hawkbitcfg.o \
> +	 swupdate-sendtohawkbit.o \
>  	 swupdate-sysrestart.o
>  
>  # # Uncomment the next lines to integrate the compiling/linking of
> diff --git a/tools/client.c b/tools/swupdate-client.c
> similarity index 100%
> rename from tools/client.c
> rename to tools/swupdate-client.c
> diff --git a/tools/hawkbitcfg.c b/tools/swupdate-hawkbitcfg.c
> similarity index 100%
> rename from tools/hawkbitcfg.c
> rename to tools/swupdate-hawkbitcfg.c
> diff --git a/tools/progress.c b/tools/swupdate-progress.c
> similarity index 100%
> rename from tools/progress.c
> rename to tools/swupdate-progress.c
> diff --git a/tools/sendtohawkbit.c b/tools/swupdate-sendtohawkbit.c
> similarity index 100%
> rename from tools/sendtohawkbit.c
> rename to tools/swupdate-sendtohawkbit.c
> 

Acked-by: Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic

Patch
diff mbox series

diff --git a/.gitignore b/.gitignore
index af9f5cc..652888b 100644
--- a/.gitignore
+++ b/.gitignore
@@ -35,10 +35,11 @@  swupdate
 swupdate_unstripped*
 lua_swupdate.so*
 tools/*_unstripped
-tools/client
-tools/progress
-tools/sendtohawkbit
-tools/hawkbitcfg
+tools/swupdate-client
+tools/swupdate-progress
+tools/swupdate-sendtohawkbit
+tools/swupdate-hawkbitcfg
+tools/swupdate-sysrestart
 tools/*.map
 tools/*.out
 
diff --git a/tools/Makefile b/tools/Makefile
index ca0a4a3..206b0eb 100644
--- a/tools/Makefile
+++ b/tools/Makefile
@@ -9,10 +9,10 @@ 
 # SPDX-License-Identifier:     GPL-2.0-or-later
 
 lib-y += \
-	 client.o \
-	 progress.o \
-	 hawkbitcfg.o \
-	 sendtohawkbit.o \
+	 swupdate-client.o \
+	 swupdate-progress.o \
+	 swupdate-hawkbitcfg.o \
+	 swupdate-sendtohawkbit.o \
 	 swupdate-sysrestart.o
 
 # # Uncomment the next lines to integrate the compiling/linking of
diff --git a/tools/client.c b/tools/swupdate-client.c
similarity index 100%
rename from tools/client.c
rename to tools/swupdate-client.c
diff --git a/tools/hawkbitcfg.c b/tools/swupdate-hawkbitcfg.c
similarity index 100%
rename from tools/hawkbitcfg.c
rename to tools/swupdate-hawkbitcfg.c
diff --git a/tools/progress.c b/tools/swupdate-progress.c
similarity index 100%
rename from tools/progress.c
rename to tools/swupdate-progress.c
diff --git a/tools/sendtohawkbit.c b/tools/swupdate-sendtohawkbit.c
similarity index 100%
rename from tools/sendtohawkbit.c
rename to tools/swupdate-sendtohawkbit.c