Those ports are meta ports, and are only there to improve the user's
experience, in which, if they want, say, python or gcc, they do not have
to figure out what version they should be installing, they simply
install python or gcc.
Reviewed by: antoine
Approved by: adamw
Differential Revision: https://reviews.freebsd.org/D19562
Previously it would do this:
$ pkg which -q -o /usr/local/lib/libphonon4qt5.so
multimedia/phonon
$ pkg pkg annotate -q -S multimedia/phonon flavor
qt4
qt5
And that would break things in an interesting way.
This changes makes it use the package name of the required file, which
is unique.
Note that this problem would probably only ever happen on a live system.
I was not able to find a single port that would trigger this it in a
clean environment (poudriere testport).
PR: 231332
Submitted by: dbn
for orphans, i.e., files in STAGEDIR that are not covered by plist.
This is a follow-up to revision 484628 after which texinfo files are
now installed into ${PREFIX}/share/info. (A file "dir" is then created
and maintained by the tooling.)
Approved by: portmgr (antoine)
This fixes PLIST_SUB being too big and PLIST_SUB_SED getting bigger than
_POSIX2_LINE_MAX.
PR: 222355
Reported by: asomers
Reviewed by: asomers, mfechner
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D14014
objdump is being removed from HEAD, make sure everything still works
when this happens.
PR: 229049
Reported by: emaste
Sponsored by: Absolight
Differential Revision: https://reviews.freebsd.org/D15904
From now on, ports that depend on Qt4 will have to set
USES= qt:4
USE_QT= foo bar
ports depending on Qt5 will use
USES= qt:5
USE_QT= foo bar
PR: 229225
Exp-run by: antoine
Reviewed by: mat
Approved by: portmgr (antoine)
Differential Revision: →https://reviews.freebsd.org/D15540
You have a single quoted string containing a backslash followed by a
linefeed (newline). Unlike double quotes or unquoted strings, this has
no special meaning. The string will contain a literal backslash and a
linefeed.
If you wanted to break the line but not add a linefeed to the string,
stop the single quote, break the line, and reopen it.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
Since files and arguments are strings passed the same way, programs
can't properly determine which is which, and rely on dashes to determine
what's what.
A file named -f (touch -- -f) will not be deleted by the problematic
code. It will instead be interpreted as a command line option, and rm
will even report success.
Using ./* will instead cause the glob to be expanded into ./-f, which no
program will treat as an option.
It is not possible to use `-f *` because -f only forces the next
argument to be a directory, a later directory named -delete would mess
things up.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
By default, read will interpret backslashes before spaces and line
feeds, and otherwise strip them. This is rarely expected or desired.
Normally you just want to read data, which is what read -r does. You
should always use -r unless you have a good reason not to.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
It's common to use A && B to run B when A is true, and A || C to run C
when A is false.
However, combining them into A && B || C is not the same as if A then B
else C.
In this case, if A is true but B is false, C will run.
If an if clause is used instead, this problem is avoided.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
When command expansions are unquoted, word splitting and globbing will
occur. This often manifests itself by breaking when filenames contain
spaces.
Trying to fix it by adding quotes or escapes to the data will not work.
Instead, quote the command substitution itself.
If the command substitution outputs multiple pieces of data, use a loop
instead.
Add an exception when using set -- where splitting is intended.
PR: 227109
Submitted by: mat
Exp-run by: antoine
Sponsored by: Absolight
Backtick command substitution `STATEMENT` is legacy syntax with several
issues.
- It has a series of undefined behaviors related to quoting in POSIX.
- It imposes a custom escaping mode with surprising results.
- It's exceptionally hard to nest.
$(STATEMENT) command substitution has none of these problems, and is
therefore strongly encouraged.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
In the original code, the return value of mycmd is ignored, and export
will instead always return true. This may prevent conditionals, set -e
and traps from working correctly.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
cd can fail for a variety of reasons: misspelled paths, missing
directories, missing permissions, broken symlinks and more.
If/when it does, the script will keep going and do all its operations in
the wrong directory. This can be messy, especially if the operations
involve creating or deleting a lot of files.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
ShellCheck has noticed that you reference a variable that is not
assigned in the script, which has a name remarkably similar to one that
is explicitly assigned. You should verify that the variable name is
spelled correctly.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
ShellCheck has detected that you have a command that just consists of a
command substitution.
This is typically done in order to try to get the shell to execute a
command, because $(..) does indeed execute commands. However, it's also
replaced by the output of that command.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
export takes a variable name, but shellcheck has noticed that you give
it an expanded variable instead. The problematic code does not export
MYVAR but a variable called foo if any.
Add exception when using indirections where the variable to extract is
actually the value of the variable.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
You have specified multiple patterns in a case statement, where one will
always override the other. The pattern being overridden is indicated
with a SC2222 warning.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
Double quotes around $@ prevents globbing and word splitting of
individual elements, while still expanding to multiple separate
arguments.
Add exceptions when splitting is the intended behavior.
PR: 227109
Submitted by: mat
Sponsored by: Absolight
The behavior when concatenating a string and array is rarely intended.
The preceeding string is prefixed to the first array element, while the
succeeding string is appended to the last one. The middle array elements
are unaffected.
For example, with the parameters foo,bar,baz, "--flag=$@" is equivalent
to the three arguments "--flag=foo" "bar" "baz".
PR: 227109
Submitted by: mat
Sponsored by: Absolight
'strip -x', and splitting out debug symbols with objcopy, will leave
a .symtab section but will still remove the .debug_info section. file(1)
shows this distinction as well after the use of 'strip -x':
work/tcl8.7a1/unix/libtcl8.7.so: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, with debug_info, not stripped
work/stage/usr/local/lib/libtcl8.7.so: ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), dynamically linked, not stripped
This fixes false-positives when using install-strip and symbol splitting.
With hat: portmgr
This only handles the default CC=cc but is enough to significantly improve
INDEX/Poudriere ports var gathering due to reducing around a dozen cc
fork+exec for every port that all have the same result. These values
are reused during the port build as well which reduces more fork+exec
contention there.
Approved by: portmgr (implicit)
This will avoid renamed/removed variables being orphaned, and allows for
exporting variables in ports_env that are not wanted to be exported in
sub-makes via _EXPORTED_VARS.
Approved by: portmgr (implicit)
Rather than replacing patches that are effectively the same but with
different timestamps, drop the new version and let the old version remain in
place. This yields a `make makepatch` that doesn't try and produce unwanted
churn.
Approved by: portmgr (mat)
Differential Revision: https://reviews.freebsd.org/D13960
This checks whether rubygem based ports have all of their dependencies
in Gemfile(s) satisfied by what's currently installed. Sample output:
====> Running Q/A tests (stage-qa)
Warning: Dependencies defined in /usr/ports/www/gitlab/work/stage/usr/local/www/gitlab/Gemfile are not satisfied
These ports could (!) be broken at runtime. Be aware: some projects
defines multiple Gemfiles and not all are used at runtime. For example
www/gitlab has two Gemfiles, but only one is used for testing and warnings
about it can be ignored.
Approved by: portmgr (mat), lifanov
Differential Revision: https://reviews.freebsd.org/D11865