Page MenuHomeFreeBSD

Literal text for WWW variable
Needs RevisionPublic

Authored by makc on Wed, Nov 19, 11:30 AM.
Tags
None
Referenced Files
F139387992: D53824.diff
Thu, Dec 11, 2:17 PM
Unknown Object (File)
Wed, Dec 10, 12:13 AM
Unknown Object (File)
Sun, Dec 7, 2:14 AM
Unknown Object (File)
Sat, Nov 29, 11:22 PM
Unknown Object (File)
Fri, Nov 28, 10:23 AM
Unknown Object (File)
Sat, Nov 22, 8:45 PM
Unknown Object (File)
Sat, Nov 22, 8:29 PM
Unknown Object (File)
Sat, Nov 22, 8:29 PM

Details

Reviewers
salvadore
mat
Summary

The WWW variable was a plain text URL before it has been moved to the Makefile. Suggest to use the literal text URL unless the WWW variable is provided by the ports framework.

Prompted by the discussion https://lists.freebsd.org/archives/dev-commits-ports-main/2025-November/170048.html

Diff Detail

Repository
R9 FreeBSD doc repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

makc requested review of this revision.Wed, Nov 19, 11:30 AM
makc created this revision.

As the sentence says "should", it's an advice, which means, it's not enforcable, so, it's just more text that do not really add any no value.

documentation/content/en/books/porters-handbook/makefiles/_index.adoc
2615

While I disagree with this change, we document what should be done, not what should not be, so

Whenever the WWW variable is set in the [.filename]#Makefile# its value should be literal text.

vvd removed a subscriber: vvd.

I like this, removes a minor annoyance from working with some ports.

I am in general not a huge fan of using PORTNAME all over the place. It should only be used in places where the port would still work fine if PORTNAME is changed, not in every place where the string PORTNAME expands to appears. But that's another debate.

makc marked an inline comment as done.
adamw added inline comments.
documentation/content/en/books/porters-handbook/makefiles/_index.adoc
2615

I'll be honest, if I came across this I would be unclear what "literal text" is trying to imply.

Perhaps "must be literal text and not include variables"?

I was involved in the discussion on the mailing list and while I am a proponent of allowing the variable in the WWW.
In the end we're only ever talking about the difference of some half a dozen characters. So not a big deal either way.
If this should ever be documented as a MUST. I'd like to suggest the use of the terms:
"string literal" and "string variable" as opposed to "literal text". As both a variable AND a literal are still after all,
"literally text". :-)

I'd like to suggest the use of the terms:
"string literal" and "string variable" as opposed to "literal text". As both a variable AND a literal are still after all,
"literally text". :-)

Thank you, that word choice is the correct answer!

danfe added inline comments.
documentation/content/en/books/porters-handbook/makefiles/_index.adoc
2615

Perhaps "must be literal text and not include variables"?

Something like that, yes. Maybe also mention that some popular terminal emulators or text editors allow to click and open embedded links directly which many people find handy.

mat requested changes to this revision.Tue, Nov 25, 6:38 AM

Using must is a no.
This rule should not be absolute.
You can advise people to not put a variable, but variables may need to happen from time to time.
The WWW variable is there so make(1) can create things out of it.
The ports tree is to be used by developpers, not end users. End users have packages and should not have to interact with the ports tree ever.
If a developper needs to know the actual value, they can run make -V WWW, we could even add a few targets, like make open-www that would do stuff like xdg-open "${WWW}".

This revision now requires changes to proceed.Tue, Nov 25, 6:38 AM
@mat wrote:

The ports tree is to be used by developers, not end users. End users have packages and should not have to interact with the ports tree ever.

Yet there are plenty of users who prefer to work with the ports tree for various reasons and CBA to setup a local repo.

If a developer needs to know the actual value, they can run make -V WWW

They can (and do), but it's often easier and faster to simply click the link while editing the file and let either your editor or terminal emulator open it for you.

In D53824#1231777, @mat wrote:

Using must is a no.
This rule should not be absolute.

Sorry, Mathieu. I misread your first review. However,

You can advise people to not put a variable, but variables may need to happen from time to time.

the WWW has been plain URL in the pkg-descr for two decades. AFAIK, it was moved to Makefile to ease processing, not due to necessity of using variables inside URL.
So is there a strong demand for variables in the WWW when it's explicitly set in the port Makefile? Any good example?
The only example, i.e. for keeping WWW and PORTNAME synchronized, is a weak argument to me.

End users have packages and should not have to interact with the ports tree ever.

I agree. On the other hand, the ports tree is a great and prominent feature of FreeBSD.
I believe we should not make it harder for users to interact with the ports, if we want more developers in the future.

we could even add a few targets, like make open-www that would do stuff like xdg-open "${WWW}".

Great idea!

Now, back to the patch. Besides for developer- and user-friendliness, I'd prefer to disallow mangling the URL for security reasons.
If you think that security concerns are exaggerated or there is other reasons to not force clean URL, I'm opened to correct the wording.

In D53824#1231777, @mat wrote:

You can advise people to not put a variable, but variables may need to happen from time to time.

I can't think of any case where that would be true, but I'm always in favor of giving developers more options rather than fewer.

The ports tree is to be used by developpers, not end users. End users have packages and should not have to interact with the ports tree ever.

Mat, you know I think the world of you, but every word in there makes my skin crawl. My customers are the end-users, not the package builders.