0003-all-use-install-1-to-install-executables.patch 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. From d3bd7b29b79147b4155e78a8ea06ded98b91f92a Mon Sep 17 00:00:00 2001
  2. From: "Yann E. MORIN" <yann.morin.1998@free.fr>
  3. Date: Tue, 8 May 2018 15:23:57 +0200
  4. Subject: [PATCH] all: use install(1) to install executables
  5. When the destination file already exists, the current install script
  6. will overwrite it with the new executable.
  7. However, when the existing executable is a symlink or hardlink to
  8. something else, like busybox, this effectively overwrites that something
  9. with the new executable, and thus replaces busybox and all its applets
  10. with the code for either of the three commands.
  11. We fix that by simply calling install(1). install(1) is sufficiently
  12. widespread that we don't bother checking for it, as tis is just a
  13. workaround while waiting for the version bump that will eventually fix
  14. it for good.
  15. Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
  16. ---
  17. chacl/Makefile | 4 ++--
  18. getfacl/Makefile | 4 ++--
  19. setfacl/Makefile | 4 ++--
  20. 3 files changed, 6 insertions(+), 6 deletions(-)
  21. diff --git a/chacl/Makefile b/chacl/Makefile
  22. index 33858d6..c857329 100644
  23. --- a/chacl/Makefile
  24. +++ b/chacl/Makefile
  25. @@ -30,6 +30,6 @@ default: $(LTCOMMAND)
  26. include $(BUILDRULES)
  27. install: default
  28. - $(INSTALL) -m 755 -d $(PKG_BIN_DIR)
  29. - $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
  30. + install -D -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)/$(LTCOMMAND)
  31. +
  32. install-dev install-lib:
  33. diff --git a/getfacl/Makefile b/getfacl/Makefile
  34. index 7fbafda..8ac63e0 100644
  35. --- a/getfacl/Makefile
  36. +++ b/getfacl/Makefile
  37. @@ -31,6 +31,6 @@ default: $(LTCOMMAND)
  38. include $(BUILDRULES)
  39. install: default
  40. - $(INSTALL) -m 755 -d $(PKG_BIN_DIR)
  41. - $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
  42. + install -D -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)/$(LTCOMMAND)
  43. +
  44. install-dev install-lib:
  45. diff --git a/setfacl/Makefile b/setfacl/Makefile
  46. index c44e7c0..eea2ede 100644
  47. --- a/setfacl/Makefile
  48. +++ b/setfacl/Makefile
  49. @@ -31,6 +31,6 @@ default: $(LTCOMMAND)
  50. include $(BUILDRULES)
  51. install: default
  52. - $(INSTALL) -m 755 -d $(PKG_BIN_DIR)
  53. - $(LTINSTALL) -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)
  54. + install -D -m 755 $(LTCOMMAND) $(PKG_BIN_DIR)/$(LTCOMMAND)
  55. +
  56. install-dev install-lib:
  57. --
  58. 2.14.1