diff mbox

[v5,07/14] skeleton-common: rename SKELETON_ROOT_PASSWORD to SKELETON_CUSTOM_ROOT_PASSWORD

Message ID 20170801225224.16899-8-arnout@mind.be
State Accepted
Headers show

Commit Message

Arnout Vandecappelle Aug. 1, 2017, 10:52 p.m. UTC
Package variables should always be prefixed with the package name. For
SKELETON_CUSTOM_ROOT_PASSWORD, this means we set the variable a second
time based on the value it previously had. Fortunately, this is fine
for make, even for recursively expanded variables.

This also allows to simplify the condition of the empty password - it's
not needed to set it again to empty if it already was empty.

Signed-off-by: Arnout Vandecappelle (Essensium/Mind) <arnout@mind.be>
---
Changes v4 -> v5: (Arnout)
 - New patch
---
 package/skeleton-common/skeleton-common.mk | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

Comments

Thomas Petazzoni Aug. 2, 2017, 5:29 p.m. UTC | #1
Hello,

On Wed, 2 Aug 2017 00:52:17 +0200, Arnout Vandecappelle
(Essensium/Mind) wrote:
> Package variables should always be prefixed with the package name. For
> SKELETON_CUSTOM_ROOT_PASSWORD, this means we set the variable a second

The variable is now named SKELETON_COMMON_ROOT_PASSWORD, not
SKELETON_CUSTOM_ROOT_PASSWORD. I've fixed that in both the commit title
and in the above sentence.

Thomas
Arnout Vandecappelle Aug. 2, 2017, 7:22 p.m. UTC | #2
On 02-08-17 19:29, Thomas Petazzoni wrote:
> Hello,
> 
> On Wed, 2 Aug 2017 00:52:17 +0200, Arnout Vandecappelle
> (Essensium/Mind) wrote:
>> Package variables should always be prefixed with the package name. For
>> SKELETON_CUSTOM_ROOT_PASSWORD, this means we set the variable a second
> 
> The variable is now named SKELETON_COMMON_ROOT_PASSWORD, not
> SKELETON_CUSTOM_ROOT_PASSWORD. I've fixed that in both the commit title
> and in the above sentence.

 Yeah, I sent it at 00:52, so you can imagine...

 Regards,
 Arnout
diff mbox

Patch

diff --git a/package/skeleton-common/skeleton-common.mk b/package/skeleton-common/skeleton-common.mk
index 07c434c07a..06e59c03df 100644
--- a/package/skeleton-common/skeleton-common.mk
+++ b/package/skeleton-common/skeleton-common.mk
@@ -62,20 +62,18 @@  SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_SET_ISSUE
 endif
 
 ifeq ($(BR2_TARGET_ENABLE_ROOT_LOGIN),y)
-ifeq ($(SKELETON_COMMON_ROOT_PASSWD),)
-SKELETON_ROOT_PASSWORD =
-else ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_COMMON_ROOT_PASSWD)),)
-SKELETON_ROOT_PASSWORD = '$(SKELETON_COMMON_ROOT_PASSWD)'
-else
+ifneq ($(filter $$1$$% $$5$$% $$6$$%,$(SKELETON_COMMON_ROOT_PASSWD)),)
+SKELETON_COMMON_ROOT_PASSWORD = '$(SKELETON_COMMON_ROOT_PASSWD)'
+else ifneq ($(SKELETON_COMMON_ROOT_PASSWD),)
 # This variable will only be evaluated in the finalize stage, so we can
 # be sure that host-mkpasswd will have already been built by that time.
-SKELETON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_COMMON_PASSWD_METHOD)" "$(SKELETON_COMMON_ROOT_PASSWD)"`"
+SKELETON_COMMON_ROOT_PASSWORD = "`$(MKPASSWD) -m "$(SKELETON_COMMON_PASSWD_METHOD)" "$(SKELETON_COMMON_ROOT_PASSWD)"`"
 endif
 else # !BR2_TARGET_ENABLE_ROOT_LOGIN
-SKELETON_ROOT_PASSWORD = "*"
+SKELETON_COMMON_ROOT_PASSWORD = "*"
 endif
 define SKELETON_COMMON_SET_ROOT_PASSWD
-	$(SED) s,^root:[^:]*:,root:$(SKELETON_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
+	$(SED) s,^root:[^:]*:,root:$(SKELETON_COMMON_ROOT_PASSWORD):, $(TARGET_DIR)/etc/shadow
 endef
 SKELETON_COMMON_TARGET_FINALIZE_HOOKS += SKELETON_COMMON_SET_ROOT_PASSWD