Skip to contentSkip to conversation

package/pkg-generic: remove trailing slash in the package-specific PKGDIR variable

PATCH Applied Scott Fan 3 participants 7 messages Mar 23, 2024 – Mar 25, 2024

lore
Share & tools
lore

Scott Fan

author
#0 lore raw

PATCH 1/2 package/pkg-generic: remove trailing slash in the package-specific PKGDIR variable

---
 package/pkg-generic.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-generic.mk +1 -1
index 577a148c1e..f9cb8722b8 100644
@@ -489,7 +489,7 @@ PACKAGES_ALL += $(1)
 $(2)_TYPE                       =  $(4)
 $(2)_NAME			=  $(1)
 $(2)_RAWNAME			=  $$(patsubst host-%,%,$(1))
-$(2)_PKGDIR			=  $(pkgdir)
+$(2)_PKGDIR			=  $$(patsubst %/,%,$(pkgdir))
 
 # Keep the package version that may contain forward slashes in the _DL_VERSION
 # variable, then replace all forward slashes ('/') by underscores ('_') to
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
author
#1 lore raw

PATCH 2/2 package/owfs: add missing slash after the OWFS_PKGDIR variable

---
 package/owfs/owfs.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
package/owfs/owfs.mk +2 -2
index 986dca921a..6b22282486 100644
@@ -28,7 +28,7 @@ OWFS_CONF_OPTS += \
 	--with-fuseinclude=$(STAGING_DIR)/usr/include \
 	--with-fuselib=$(STAGING_DIR)/usr/lib
 define OWFS_INSTALL_FUSE_INIT_SYSV
-	$(INSTALL) -D -m 0755 $(OWFS_PKGDIR)S60owfs \
+	$(INSTALL) -D -m 0755 $(OWFS_PKGDIR)/S60owfs \
 		$(TARGET_DIR)/etc/init.d/S60owfs
 endef
 define OWFS_CREATE_MOUNTPOINT
@@ -78,7 +78,7 @@ endif
 OWFS_MAKE = $(MAKE) $(OWFS_EXTRA_MAKE_OPTS)
 
 define OWFS_INSTALL_INIT_SYSV
-	$(INSTALL) -D -m 0755 $(OWFS_PKGDIR)S55owserver \
+	$(INSTALL) -D -m 0755 $(OWFS_PKGDIR)/S55owserver \
 		$(TARGET_DIR)/etc/init.d/S55owserver
 	$(OWFS_INSTALL_FUSE_INIT_SYSV)
 endef
Signature · 6 lines
2.34.1

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot
#2 lore raw

Re: [Buildroot] [PATCH 2/2] package/owfs: add missing slash after the OWFS_PKGDIR variable

Quoted 1 line · Scott Fan

Applied to master, thanks.

It now has a double slash, but that's no problem.

Regards,
Arnout

Quoted 18 lines
---
  package/owfs/owfs.mk | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
package/owfs/owfs.mk +1 -1
index 986dca921a..6b22282486 100644
@@ -28,7 +28,7 @@ OWFS_CONF_OPTS += \
  	--with-fuseinclude=$(STAGING_DIR)/usr/include \
  	--with-fuselib=$(STAGING_DIR)/usr/lib
  define OWFS_INSTALL_FUSE_INIT_SYSV
-	$(INSTALL) -D -m 0755 $(OWFS_PKGDIR)S60owfs \
+	$(INSTALL) -D -m 0755 $(OWFS_PKGDIR)/S60owfs \
  		$(TARGET_DIR)/etc/init.d/S60owfs
  endef
  define OWFS_CREATE_MOUNTPOINT

package/owfs/owfs.mk endif · line 84

Quoted 8 lines
package/owfs/owfs.mk +1 -1
@@ -78,7 +78,7 @@ endif
  OWFS_MAKE = $(MAKE) $(OWFS_EXTRA_MAKE_OPTS)
 
  define OWFS_INSTALL_INIT_SYSV
-	$(INSTALL) -D -m 0755 $(OWFS_PKGDIR)S55owserver \
+	$(INSTALL) -D -m 0755 $(OWFS_PKGDIR)/S55owserver \
  		$(TARGET_DIR)/etc/init.d/S55owserver
  	$(OWFS_INSTALL_FUSE_INIT_SYSV)
  endef

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#3 lore raw
In reply to Scott Fan

Hi Scott,

Quoted 10 lines · Scott Fan
---
  package/pkg-generic.mk | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-generic.mk +0 -0
index 577a148c1e..f9cb8722b8 100644

package/pkg-generic.mk PACKAGES_ALL += $(1) · line 492

Quoted 5 lines
package/pkg-generic.mk +1 -1
@@ -489,7 +489,7 @@ PACKAGES_ALL += $(1)
  $(2)_TYPE                       =  $(4)
  $(2)_NAME			=  $(1)
  $(2)_RAWNAME			=  $$(patsubst host-%,%,$(1))
-$(2)_PKGDIR			=  $(pkgdir)
+$(2)_PKGDIR			=  $$(patsubst %/,%,$(pkgdir))

Can you explain why you want to do this? Perhaps it makes the PKGDIR contents
a little bit more "pure", but is that really so useful?

Regards,
Arnout

package/pkg-generic.mk PACKAGES_ALL += $(1) · line 495

Quoted 3 lines
package/pkg-generic.mk +0 -0
  # Keep the package version that may contain forward slashes in the _DL_VERSION
  # variable, then replace all forward slashes ('/') by underscores ('_') to

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

author
#4 lore raw

Hi Arnout,

It is really NOT MUST, but SUGGEST to do it.

I saw a lot of lines containing double slash paths in the build log, then I found
the $(2)_PKGDIR variable always ends with a slash character, it causes double slash in paths.

Although it has no substantial adverse consequences, the double slash is completely unnecessary.

Scott Fan

Quoted 23 lines · Arnout Vandecappelle

Hi Scott,

Quoted 10 lines · Scott Fan
---
  package/pkg-generic.mk | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
package/pkg-generic.mk +0 -0
index 577a148c1e..f9cb8722b8 100644

package/pkg-generic.mk PACKAGES_ALL += $(1) · line 492

Quoted 5 lines
package/pkg-generic.mk +1 -1
@@ -489,7 +489,7 @@ PACKAGES_ALL += $(1)
  $(2)_TYPE                       =  $(4)
  $(2)_NAME                   =  $(1)
  $(2)_RAWNAME                        =  $$(patsubst host-%,%,$(1))
-$(2)_PKGDIR                  =  $(pkgdir)
+$(2)_PKGDIR                  =  $$(patsubst %/,%,$(pkgdir))

Can you explain why you want to do this? Perhaps it makes the PKGDIR contents
a little bit more "pure", but is that really so useful?

Quoted 6 lines

Regards,
Arnout

Quoted 3 lines
package/pkg-generic.mk +0 -0
  # Keep the package version that may contain forward slashes in the _DL_VERSION
  # variable, then replace all forward slashes ('/') by underscores ('_') to

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#5 lore raw

Hi Scott,

Please don't top-post, but reply inline like I do below. Note that this
requires configuring your mailer to quote replies properly.

Quoted 11 lines · Scott Fan

Hi Arnout,

It is really NOT MUST, but SUGGEST to do it.

I saw a lot of lines containing double slash paths in the build log, then I found
the $(2)_PKGDIR variable always ends with a slash character, it causes double slash in paths.

Although it has no substantial adverse consequences, the double slash is completely unnecessary.

Yeah, but I'm a bit hesitant to apply anything that adds complexity to the
code without good reason...

Quoted 13 lines

Scott Fan

Quoted 9 lines · Arnout Vandecappelle

Hi Scott,

Quoted 5 lines · Scott Fan
---
   package/pkg-generic.mk | 2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 10 lines
Quoted 10 lines

package/pkg-generic.mk PACKAGES_ALL += $(1) · line 492

Quoted 10 lines
package/pkg-generic.mk +1 -1
index 577a148c1e..f9cb8722b8 100644
@@ -489,7 +489,7 @@ PACKAGES_ALL += $(1)
   $(2)_TYPE                       =  $(4)
   $(2)_NAME                   =  $(1)
   $(2)_RAWNAME                        =  $$(patsubst host-%,%,$(1))
-$(2)_PKGDIR                  =  $(pkgdir)
+$(2)_PKGDIR                  =  $$(patsubst %/,%,$(pkgdir))

$(pkgdir) is used in a number of other places, and we don't want the trailing
slash either in any of them. So I moved this to the definition of pkgdir instead, and applied to master, thanks.

Regards,
Arnout

Quoted 10 lines
Quoted 10 lines

Can you explain why you want to do this? Perhaps it makes the PKGDIR contents
a little bit more "pure", but is that really so useful?

Regards,
Arnout

Quoted 3 lines
package/pkg-generic.mk +0 -0
   # Keep the package version that may contain forward slashes in the _DL_VERSION
   # variable, then replace all forward slashes ('/') by underscores ('_') to

_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot

#6 lore raw
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line
Quoted 1 line

"Arnout" == Arnout Vandecappelle via buildroot <[email protected]> writes:

Hi,

Quoted 5 lines
Quoted 5 lines
Quoted 5 lines
Quoted 5 lines

---
package/pkg-generic.mk | 2 +-

1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 14 lines
Quoted 10 lines
Quoted 10 lines

package/pkg-generic.mk PACKAGES_ALL += $(1) · line 492

Quoted 10 lines
package/pkg-generic.mk +1 -1
index 577a148c1e..f9cb8722b8 100644
@@ -489,7 +489,7 @@ PACKAGES_ALL += $(1)
 $(2)_TYPE                       =  $(4)
 $(2)_NAME                   =  $(1)
 $(2)_RAWNAME                        =  $$(patsubst host-%,%,$(1))
-$(2)_PKGDIR                  =  $(pkgdir)
+$(2)_PKGDIR                  =  $$(patsubst %/,%,$(pkgdir))

$(pkgdir) is used in a number of other places, and we don't want the trailing slash either in any of them. So I moved this to the definition of pkgdir instead, and applied to master, thanks.

This unfortunately broke building the manual:

make manual-html

Quoted 2 lines
Quoted 2 lines
Quoted 2 lines

Preparing the manual sources...
Generating HTML manual...

a2x: ERROR: missing ASCIIDOC_FILE: /home/peko/source/buildroot/output/build/docs/manual/manual.adoc

make: *** [docs/manual/manual.mk:12: /home/peko/source/buildroot/output/docs/manual/manual.html] Error 1

(It ended up putting it in ../docs/manual/manual/manual.adoc)

Adding a trailing slash to _DOCDIR fixes it:

package/doc-asciidoc.mk +1 -1
index 40c9a725d1..5b4b86d463 100644
@@ -142,7 +142,7 @@ endef
 # resources, such as images, are located; must be an absolute path.
 ################################################################################
 define ASCIIDOC
-$(2)_DOCDIR = $(pkgdir)
+$(2)_DOCDIR = $(pkgdir)/
 
 # Single line, because splitting a foreach is not easy...
 .PHONY: $(1)-check-dependencies
Signature · 5 lines
Bye, Peter Korsgaard
_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot