Add a script to check the CONFLICTS and CONFLICTS_INSTALL parameters
of ports for completeness and correctness.
This script uses the "hidden" LUA interpreter in the FreeBSD base
system and the pkg-provides extension of the pkg command to check
for conflicting files in all packages available for the architecture
and version of the base system this command is run on.
It generates output in the following format:
portedit merge -ie 'CONFLICTS_INSTALL=kicad-library-footprints-devel \
# share/kicad/template/fp-lib-table' \
/usr/ports/cad/kicad-library-footprints
(The last line is shown wrapped for the text of this commit message.)
The portedit command is provided by the port-fmt package. It takes
care of placing the CONFLICTS_ENTRY into the correct position of the
port's Makefile (and removes prior definitions).
The files listed with each result are examples of files that are in
conflict between the port and the packages in the list after ">".
The main purpose of the files list is to help distinguish between
conflicts that affect all flavors or versions of a port, or whether
the files are placed in version specific sub-directories or use other
mechanisms to allow e.g. multiple Python versions to co-exist.
(In the latter case ${PYTHON_PKGNAMEPREFIX} can be used to limit
the CONFLICTS_INSTALL entry to conflicting packages using the same
Python interpreter version, for example, else a prefix like py*- might
be required for a version independent pattern).
Users of this feature are highly advised to check each Makefile by
comparing it with pre-edit version before the changes are committed!
There are several limitations that can cause incorrect or undesirable
changes:
- The list of files installed by each port is only available for the
officially built packages (and the flavors selected from the set of
available flavors). It does not include ports that may not be
packaged or that are broken or ignored due to a dependency on a
broken port (or for other reasons). As a result, there may be
undected conflicts with ports for which no official package is
available.
- The CONFLICTS_INSTALL line is not always inserted into the correct
position in the Makefile, typically due to out-of-order entries used
by portedit to locate the desired position.
- Complex ports may have conditional CONFLICTS_INSTALL entries,
depending on port options or flavors that are in effect. It is not
possible to deal with that kind of Makefiles in an automated way.
- The union of all CONFLICTS and CONFLICTS_INSTALL entries is used as
the list of install conflicts of a port. But only CONFLICTS_INSTALL
entries are generated by this tool. Quite a lot of ports have
CONFLICTS entries where CONFLICTS_INSTALL would suffice (i.e. there
is no build conflict, actually), but there are ports that need to
keep the conflicts listed as CONFLICTS. Such issues can be found by
comparing the before and after versions of the edited Makefiles.
- Conflicting ports that have been removed from the ports system will
only be found as long as their official package files are still
available. (There is a recommendation that conflicts with removed
ports are kept for a few months.)
- If all packages conflicting with a given port have been removed
from the ports system and the official packages repository, the
now superfluous CONFLICTS_INSTALL definition will not be detected.
This is due to only Makefiles of ports being parsed that install
files in the same place as some other port. Parsing all Makefiles
instead would increase the run-time of this script by more than a
factor of 10.
Add zstd (faster to decompress) and xz (smaller) compression for INDEX
Results are the following:
39552 INDEX-14
2366 INDEX-14.bz2
1625 INDEX-14.xz
1672 INDEX-14.zst
Simple shell script to help updating Makefile CARGO_CRATES variable
returned by make cargo-crates.
simplest way to use it :
make cargo-crates | update_crates Makefile > NewMakefile
LEGAL is badly maintained, LEGALlint notices quite a number of ports
which mismatch their line in LEGAL. The port itself is always leading.
* math/giacxcas: restrict RESTRICTED_FILES to giac_* only
Differential Revision: https://reviews.freebsd.org/D30061
Reviewed by: portmgr (mat), dch, eadler, marcus
When you run `git log foo` foo can be, from git-log(1),
`[<revision range>] [[--] <path>...]`, so, may things.
- A "revision range" described by gitrevision(7) (don't got there unless
you have a few hours, or already lost your sanity), which can be :
* a commit hash,
* a tag
* a branch,
* a ref name
* a "describe output"
* and many other ways to describe revisions
* a range made by any of the above
- An existing path.
When it can't find any of those, git figures out that you meant
something else and made a typo, and exits.
If you really meant a path, you have to run `git log -- foo`. Then git
knows that you meant a path and only a path, it will then assume that
you knew what you meant, and will go look in the history.
`git log' cannot get the log of a non-existent file, which the script uses
to obtain the last person who touched a port, so check if the file exists
before getting its log. This is similar to the Subversion case, which only
inspected changed files. The Git version still also checks added ports.
While here, call git in blame() using the predefined global variable.
Reported by: antoine
- do not remove ports immediately but store them in a temporary file
and remove them once the script has iterated over all ports to be
removed. This prevents failed searches. The Subversion version
used a temporary worktree so the main tree was unaffected.
- remove a "merge" from a question, we use rebase now.
- check if INDEX is readable and exit if not
- gather information about the deleted port for the commit message
before removing the port. I somehow missed that when testing the
script.
- Instead of a temporary branch, just operate on the current branch
and incorporate upstream changes with git pull --rebase. This
prevents one from being stranded on a temporary branch if the
script crashes and oblivates the need for a squash merge [1]
Suggested by: mat [1]
Do not push the final result automatically yet, unlike its previous
Subversion version.
Reviewed by: emaste, mat, uqs
Approved by: crees (maintainer, implicit)
Differential Revision: https://reviews.freebsd.org/D29451
- mfh: this is replaced by 'git cherry-pick -x HASH'
- psvn: unlike svn, git has no per-file properties
Adjust README accordingly.
Differential Revision: https://reviews.freebsd.org/D29451
With hat: portmgr
Git support is enabled by setting BLAME=yes (the SVN-specific
SVNBLAME=yes will be retired after transition). Mark all SVN
blocks to facilitate that eventuality.
chkversion.pl was broken in a number of ways, including looking for CVS-style Id
lines in svn headers, not being updated for pkgng, etc.
This commit fixes those, and adopts some modern Perl practices.
NOTE: The $PKG_VERSION env var is renamed to $PKG. This should be a no-op for most
people (in the sense of it didn't work before, and the default should work for
pretty much everybody).
There are a few places where undefined values can creep in. While
reinforcing defined values, use the defined-or (//) operator for
some visual simplification.
Currently, when running mfh with a flag like --help the user gets
a confusing error message from expr(1) like the following:
> expr: illegal option -- -
> expr: usage: expr [-e] expression
>
> revision "--help" should be a number
This is not helpful. Instead, make sure that any arguments specified by the
user are handled properly by expr(1). This results in a much cleaner error
message:
> revision "--help" should be a number
Reviewed by: mat
Approved by: portmgr (mat)
Differential Revision: https://reviews.freebsd.org/D25958
- remove unused clean() function, trap does it
- fix race around mktemp/setting up rm trap
- rename filelist to dirlist so it matches its purpose
- move defaults up front to the script
- misc. minor edits
PR: 246336
Approved by: portmgr (mat@)
Differential Revision: https://reviews.freebsd.org/D24789
- use env -S to split the shebang line (RhToad@#bsdports)
- launder -p PORTSDIR argument and chdir to it so it doesn't matter
which cwd bump_revision.pl is executed from
- if INDEX not found, hint the user that also his -p option might be off,
because the -i INDEX option defaults to a file relative to -p PORTSDIR.
The original wording was misleading and might have mistaken for
identical file names, but what is meant is that the sed run did not
introduce changes to the file's __content__. Reword accordingly.
- When using a non-default ports tree (-p PATH),
strip that from the requisite origins, too.
- Fix the counters when multiple ports are given on the command line,
i. e. we are bumping depends if more requisites are updated at once.