Bug 236170 - ports-mgmt/portmaster exclude option
Summary: ports-mgmt/portmaster exclude option
Status: In Progress
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Many People
Assignee: Stefan Esser
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-03-03 01:57 UTC by mikhail.rokhin
Modified: 2020-01-26 19:11 UTC (History)
3 users (show)

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


Attachments
patch for portmaster (391 bytes, patch)
2019-03-06 00:31 UTC, Tatsuki Makino
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description mikhail.rokhin 2019-03-03 01:57:08 UTC
As it is now for ` -x ` option
  for `-a` case : `-x firefox` = `-x firefox\*` = `-x \*firefox\*` = `-x /firefox\*` - it uses value to pattern *firefox*

Question is - how should I exclude `firefox\*` pattern ?

  for `portname portname ...` case: `/` should be followed by name to exclude and works like `-x /firefox\*` to exclude any port beginning with `firefox\*` .

Why do I need it? I don't want to compile huge ports like firefox, llvm, etc. and they are updated via `pkg upgrade`. Now in case of `-a` option I can't control it properly - for `-x llvm` it excludes needed to be excluded llvm70, llvm80 ... and needed to be included py36*llvm* either.

Portmaster is 3.19_18 .

Please, point me to ways, whether I fail.

Thank you for development.
Comment 1 Walter Schwarzenfeld freebsd_triage 2019-03-03 11:36:34 UTC
I have made for me a "exclude.txt" :
-x firefox 
-x webkit\*
-x rust\*
-x gcc\*
-x llvm\*
-x virtuallbox-ose\*
-x palemoon
-x thunderbird
-x vis
-x abiword
-a
-d
-y

And call it from an update-script with:
/usr/local/sbin/portmaster `cat /home/ngorx/exclude.txt|grep -v '#'`

I think you can include a line with
py36*llvm* (without -x).

(the # is if I want to comment something out).

I am not really  clear if this is what you want.
Comment 2 Walter Schwarzenfeld freebsd_triage 2019-03-03 11:37:28 UTC
correct
/usr/local/sbin/portmaster `cat /home/ngorx/exclude.txt|grep -v '#'``
Comment 3 Walter Schwarzenfeld freebsd_triage 2019-03-03 12:10:00 UTC
For py*llvm*: the wildcard does not work, you have insert separate lines
py36-llvmcpy
py36-llvmlite  

(I think you mean this two ports).
Comment 4 Tatsuki Makino 2019-03-03 22:29:07 UTC
-x firefox matches firefox-0.0 and firefoxdehanaisomething-0.0. So I think -x firefox- is better than -x firefox .
But, -x gimp- matches gimp-2.x and gimp-app-2.x. So I think -x gimp-\[0-9\] is better than -x gimp- .

We can also use "pkg lock firefox" to avoid updating.
However, the following prompt will appear.

===>>> firefox-x.x has an +IGNOREME file
        ===>>> Update anyway? y/n [n]

I don't want portmaster to handle pkg-lock, so please remove this prompt from portmaster :)
Comment 5 Tatsuki Makino 2019-03-03 23:03:45 UTC
I used -x without much concern.
But my comment #4 is tremendously wrong :)

-x is applied function globstrip. globstrip strips last * and last \.
-x is used in function check_exclude. check_exclude is using case ... esac for pattern match. -x pattern is used as *pattern*.
So, -x firefox is used as *firefox*. -x firefox-\[0-9\] may also match kankeinai-firefox-0.0 .
mmm difficult.
Comment 6 mikhail.rokhin 2019-03-04 12:09:22 UTC
(In reply to Tatsuki Makino from comment #4)
Does `-y` option remove this prompt from portmaster ?
Comment 7 Walter Schwarzenfeld freebsd_triage 2019-03-04 12:16:15 UTC
No!
Comment 8 Tatsuki Makino 2019-03-06 00:31:23 UTC
Created attachment 202629 [details]
patch for portmaster

(In reply to w.schwarzenfeld from comment #1)
I think this patch is necessary to make exclude.txt file like comment #1 work better.

(In reply to mikhail.rokhin from comment #6)
It seems that the places where -y and -n can be used are decided. -e, -s, --clean-distfiles, --clean-packages, --check-depends and --check-port-dbdir can be used.
Comment 9 Walter Schwarzenfeld freebsd_triage 2019-03-06 05:27:27 UTC
Had no problems with the textfile.
Comment 10 Tatsuki Makino 2019-03-07 01:29:26 UTC
If attachment 202629 [details] doesn't be used, more detailed llvm* patterns are needed to avoid other *llvm* like py36-llvmlite.

For example, -x llvm[0-9][0-9]-[0-9] , -x llvm6[0-9]-6. or etc...
Comment 11 Stefan Esser freebsd_committer 2020-01-26 19:11:42 UTC
I'm not sure what to do with this PR.

The patch that has been attached to this PR implements changed semantics for the "-x" option, and this might be considered a break of POLA.

Therefore I do not plan to change the current behavior unless there is strong consensus (outside the list of participants of this PR) about the correct semantics.