Bug 205032

Summary: Mk/bsd.{port,sites}.mk: Allow hyphens and periods in group names
Product: Ports & Packages Reporter: Yuri Victorovich <yuri>
Component: Ports FrameworkAssignee: Port Management Team <portmgr>
Status: Closed Overcome By Events    
Severity: Affects Only Me CC: mfechner, portmgr, ports-bugs
Priority: --- Keywords: needs-qa, patch
Version: LatestFlags: koobs: maintainer-feedback? (portmgr)
koobs: exp-run?
Hardware: Any   
OS: Any   
Bug Depends on:    
Bug Blocks: 205053, 205282    
Attachments:
Description Flags
patch
none
patch
none
patch
none
patch none

Description Yuri Victorovich freebsd_committer freebsd_triage 2015-12-05 01:51:44 UTC
Created attachment 163862 [details]
patch

It is beneficial to have hyphens allowed in group names, because group names can sometimes be associated with the project-defined directories where for example GitHub projects are extracted.

The attached patch solves the issue.

Later I will add the blocked by this port www/sharelatex that greatly benefits from this.
Comment 1 Yuri Victorovich freebsd_committer freebsd_triage 2015-12-05 07:59:06 UTC
Created attachment 163865 [details]
patch
Comment 2 Mathieu Arnold freebsd_committer freebsd_triage 2015-12-05 08:43:13 UTC
What problem exactly does having an hyphen in a variable name do you have ?

Because make(1) sure does not have any.
Comment 3 Yuri Victorovich freebsd_committer freebsd_triage 2015-12-05 09:06:15 UTC
When I replace group 'duk' -> 'd-uk', I get this error:
===>   aseprite-1.1.1 depends on file: /usr/local/sbin/pkg - found
_MASTER_SITES_d-uk=https://codeload.github.com/aseprite/duktape/tar.gz/90090c7?dummy=/: not found

I didn't realize that make supports hyphens in variable names. I assumed it doesn't. But this experiment proves that hyphenated variable names don't quite work the same way.
Comment 4 Yuri Victorovich freebsd_committer freebsd_triage 2015-12-13 15:12:16 UTC
Created attachment 164189 [details]
patch

Good news - needed to also allow periods, and potentially some other characters can be needed. Can't expect all these characters to be supported by the make(1) as variable names, can we?

So I reworked and generalized the patch, added the regex variables.

It all works. I think it can be committed now.
Comment 5 Yuri Victorovich freebsd_committer freebsd_triage 2015-12-13 15:14:44 UTC
Created attachment 164190 [details]
patch
Comment 6 Mathieu Arnold freebsd_committer freebsd_triage 2015-12-13 16:04:12 UTC
This is getting more and more complicated, and making things less and less readable.  It would be more simple to simply forbid anything outside of [a-zA-Z0-9_]
Comment 7 Yuri Victorovich freebsd_committer freebsd_triage 2015-12-13 16:08:10 UTC
No, I disagree, group names aren't simply typed in. It is often easy to make them equal to the github project name. This is where the problem comes from.

As usual, there are a lot of users (or ports), and one framework. You shouldn't force many users to work around the bug in one framework. It should just be fixed.
Comment 8 Yuri Victorovich freebsd_committer freebsd_triage 2015-12-13 16:12:57 UTC
This isn't just a bunch of changes. This is the functional relationship, the mapping from the group name with the wider character set into the variable name with the narrower character set. One function.
Comment 9 Yuri Victorovich freebsd_committer freebsd_triage 2016-01-12 16:07:15 UTC
I found that this patch breaks on 9.X (with the older version of make). I am looking for the solution for this.
Comment 10 Yuri Victorovich freebsd_committer freebsd_triage 2016-05-07 14:44:18 UTC
No feedback timeout
Comment 11 Mathieu Arnold freebsd_committer freebsd_triage 2016-05-07 16:33:52 UTC
Well, you last said "I am looking for the solutions". Timeout is two weeks, I gave it three months.
Comment 12 Yuri Victorovich freebsd_committer freebsd_triage 2016-05-07 16:37:39 UTC
Matt, sorry I didn't realize this.

I am testing the workaround now, until 9.X goes out of support.
Will update all depending ports and will temporarily close this until 2017.