Message ID | 20240323160120.1276293-1-fancp2007@gmail.com |
---|---|
State | Accepted |
Headers | show |
Series | [1/2] package/pkg-generic: remove trailing slash in the package-specific PKGDIR variable | expand |
Hi Scott, On 23/03/2024 17:01, Scott Fan wrote: > Signed-off-by: Scott Fan <fancp2007@gmail.com> > --- > package/pkg-generic.mk | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk > index 577a148c1e..f9cb8722b8 100644 > --- a/package/pkg-generic.mk > +++ b/package/pkg-generic.mk > @@ -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 > > # Keep the package version that may contain forward slashes in the _DL_VERSION > # variable, then replace all forward slashes ('/') by underscores ('_') to
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 On Sun, Mar 24, 2024 at 4:22 AM Arnout Vandecappelle <arnout@mind.be> wrote: > > Hi Scott, > > On 23/03/2024 17:01, Scott Fan wrote: > > Signed-off-by: Scott Fan <fancp2007@gmail.com> > > --- > > package/pkg-generic.mk | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk > > index 577a148c1e..f9cb8722b8 100644 > > --- a/package/pkg-generic.mk > > +++ b/package/pkg-generic.mk > > @@ -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 > > > > > # Keep the package version that may contain forward slashes in the _DL_VERSION > > # variable, then replace all forward slashes ('/') by underscores ('_') to
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. On 24/03/2024 05:53, Scott Fan wrote: > 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... > > Scott Fan > > On Sun, Mar 24, 2024 at 4:22 AM Arnout Vandecappelle <arnout@mind.be> wrote: >> >> Hi Scott, >> >> On 23/03/2024 17:01, Scott Fan wrote: >>> Signed-off-by: Scott Fan <fancp2007@gmail.com> >>> --- >>> package/pkg-generic.mk | 2 +- >>> 1 file changed, 1 insertion(+), 1 deletion(-) >>> >>> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk >>> index 577a148c1e..f9cb8722b8 100644 >>> --- a/package/pkg-generic.mk >>> +++ b/package/pkg-generic.mk >>> @@ -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 >> >> 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 >> >>> >>> # Keep the package version that may contain forward slashes in the _DL_VERSION >>> # variable, then replace all forward slashes ('/') by underscores ('_') to
>>>>> "Arnout" == Arnout Vandecappelle via buildroot <buildroot@buildroot.org> writes: Hi, >>>> Signed-off-by: Scott Fan <fancp2007@gmail.com> >>>> --- >>>> package/pkg-generic.mk | 2 +- >>>> 1 file changed, 1 insertion(+), 1 deletion(-) >>>> >>>> diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk >>>> index 577a148c1e..f9cb8722b8 100644 >>>> --- a/package/pkg-generic.mk >>>> +++ b/package/pkg-generic.mk >>>> @@ -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 >>> 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: diff --git a/package/doc-asciidoc.mk b/package/doc-asciidoc.mk index 40c9a725d1..5b4b86d463 100644 --- a/package/doc-asciidoc.mk +++ b/package/doc-asciidoc.mk @@ -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
diff --git a/package/pkg-generic.mk b/package/pkg-generic.mk index 577a148c1e..f9cb8722b8 100644 --- a/package/pkg-generic.mk +++ b/package/pkg-generic.mk @@ -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
Signed-off-by: Scott Fan <fancp2007@gmail.com> --- package/pkg-generic.mk | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)