Bug 205032 - Mk/bsd.{port,sites}.mk: Allow hyphens and periods in group names
Summary: Mk/bsd.{port,sites}.mk: Allow hyphens and periods in group names
Status: Closed Overcome By Events
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Ports Framework (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Port Management Team
Keywords: needs-qa, patch
Depends on:
Blocks: 205053 205282
  Show dependency treegraph
Reported: 2015-12-05 01:51 UTC by Yuri Victorovich
Modified: 2016-05-07 16:37 UTC (History)
3 users (show)

See Also:
koobs: maintainer-feedback? (portmgr)
koobs: exp-run?

patch (11.65 KB, patch)
2015-12-05 01:51 UTC, Yuri Victorovich
no flags Details | Diff
patch (11.65 KB, patch)
2015-12-05 07:59 UTC, Yuri Victorovich
no flags Details | Diff
patch (12.06 KB, patch)
2015-12-13 15:12 UTC, Yuri Victorovich
no flags Details | Diff
patch (11.99 KB, patch)
2015-12-13 15:14 UTC, Yuri Victorovich
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Yuri Victorovich freebsd_committer 2015-12-05 01:51:44 UTC
Created attachment 163862 [details]

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 2015-12-05 07:59:06 UTC
Created attachment 163865 [details]
Comment 2 Mathieu Arnold freebsd_committer 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 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 2015-12-13 15:12:16 UTC
Created attachment 164189 [details]

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 2015-12-13 15:14:44 UTC
Created attachment 164190 [details]
Comment 6 Mathieu Arnold freebsd_committer 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 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 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 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 2016-05-07 14:44:18 UTC
No feedback timeout
Comment 11 Mathieu Arnold freebsd_committer 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 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.