Bug 237982

Summary: devel/powerpc64-gcc: Regular expression use is not suitable for targets with multiple hyphens
Product: Ports & Packages Reporter: James Shuriff <james>
Component: Individual Port(s)Assignee: freebsd-ports-bugs mailing list <ports-bugs>
Status: Open ---    
Severity: Affects Some People CC: bapt, gerald, linimon, lwhsu, pi
Priority: --- Keywords: easy, needs-patch, needs-qa
Version: LatestFlags: koobs: maintainer-feedback? (lwhsu)
Hardware: Any   
OS: Any   

Description James Shuriff 2019-05-19 14:45:50 UTC
Regex for COMMENT, PLIST_SUB's TARGETARCH, TARGETARCH, and CONFIGURE_ARGS's --with-pkgversion is not suitable for targets with multiple hyphens. For example, the aarch64-none-elf-gcc port uses this as a master and the regular expressions change this to "aarch64noneelfgcc". Should be using ${PKGNAMEPREFIX:C/-$//} for the comments and pkgversion and ${PKGNAMEPREFIX:C/-.*//} for both TARGETARCH's.
Comment 1 Kubilay Kocak freebsd_committer freebsd_triage 2019-05-20 05:02:30 UTC
Thank you for the report James.

Bapt created these ports in ports r370506, perhaps he knows the provenance of the regular expression (if they came from somewhere else)

Looks like the other cross compiler ports are similarly affected:

devel/arm-none-eabi-gcc492 (cc ian@)
devel/riscv64-gcc (cc lwhsu@)

Might be worth sweeping at least all other compiler/cross-compiler ports, if not the whole tree for further examples of this issue and sorting them all out at once.