Bug 258469 - ports-mgmt/pkg_cutleaves: Improve regex for exclude file
Summary: ports-mgmt/pkg_cutleaves: Improve regex for exclude file
Status: New
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Muhammad Moinur Rahman
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-09-13 03:35 UTC by Derek Schrock
Modified: 2021-09-13 03:35 UTC (History)
0 users

See Also:
bugzilla: maintainer-feedback? (bofh)


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Derek Schrock 2021-09-13 03:35:29 UTC
Related to bug 228226 it seem pkg_cutleaves will exclude anything that doesn't match the following regex:

  /^(.+)-g?\d.*$/o

I believe this is trying to match portname-version.

The g was added to support github versioning gYYYYMMDD.  It appears there's a number of other ports that have "interesting" versioning schemes.  ex: universal-ctags: p5.9.20210815.0.   Changing the above regex to [gp] would fix it at least for this package's scheme.  However, that leaves ~100 oddly versioned packages left.


Looking at the output of:

   pkg rquery -r FreeBSD -a '%v %o' | grep -v "^[0-9g]"

You can see others that I would assume wouldn't be added to the exclude list.


Should the above regex allow at least the first couple characters after the - to be non-digits? 

Is it possible for $leavestokeep array to use $name instead of $file?  If so the regex wouldn't be required at all?