===========
--clean-distfiles[-all] options to check /usr/ports/distfiles for
stale stuff, and either offer to delete them or delete them all
without prompting.
Bug Fix
=======
Fix brain-o that broke the -o option.
Usability Improvements
======================
1. If a port skeleton is missing, but the pkg db has an +IGNOREME
file, skip the update check, but issue a warning for it.
2. If there is no +IGNOREME file, and no version information is
present, fail with a helpful error message.
3. Clean up any trailing / character on directory names input
at the command line.
4. Allow user to specify just category/portname on the command
line without -p.
5. Work around a missing +REQUIRED_BY file for a -r port.
Minor cleanup
=============
Make case consistent for all usage() items
============
1. Add -t mode to "thoroughly" recurse dependencies, using the
all-depends-list target instead of the combination of the
build-depends-list and run-depends-list targets. This is useful
when the dependencies of a dependency need to be updated, but
the dependency itself doesn't; and -a mode is impractical for
whatever reason.
2. If pkg_create fails, give the user the option of how to handle
it: fail, or ignore the error.
Improvements
============
1. If we are trying to delete distfiles, but a dist subdir has
gone missing, assume that the files are safely deleted (and
inform the user) rather than error'ing out.
2. Search for BROKEN state before FORBIDDEN state, since if
the former is set, the latter is implied, which made the error
message confusing. While I'm here, trim the error message by
removing some redundant information.
3. After successful install, before the dependencies are updated,
apply the same search pattern whether we're updating an existing
port, or installing from scratch using -p /usr/ports/foo/bar.
Otherwise, existing dependencies for a port that was forcibly
pkg_delete'd won't be updated, nor will the newly installed
port's +REQUIRED_BY file be up to date.
Fix
===
1. The file that contains the checksums is not always spelled
"distinfo," so use the MD5_FILE variable to find it
Cleanups
========
1. Further local'ize variables in functions, and factor in some
variables there were used only once. Add more comments that
describe usage of variables with global scope used in a function.
2. Twiddle white space a little more to help key messages stand
out better, and change wording on one message to (hopefully) make
it more clear.
3. Bump copyright
============
1. Attempt to avoid the problem of multiple background checksum
processes stepping on each other trying to download the same sets of
distfiles. The most pathological case for this is trying to portmaster
the xorg port on a clean box with no distfiles downloaded. (Brought to
my attention by George Hartzell <hartzell@alerce.com>.)
2. In cooperation with sem and skv, add three new environment
variables that can potentially be used by port authors, etc.
UPGRADE_TOOL contains the name of the tool being used, in this case
'portmaster'. UPGRADE_PORT is the full string for the port that we are
currently upgrading, and UPGRADE_PORT_VER is just the version string
part of that.
3. Collect a list of any pkg-message files that we "saw" while doing
the installs, and display them all at the end when everything is done
installing. (Old idea of mine, and others, most recently prompted by
kris.)
4. You can now do 'portmaster .' if you are in a port directory you
want to install.
5. If there is no DISTFILE information in the +CONTENTS file after
an installation, add it in the manner worked out on freebsd-ports@,
and documented in http://www.freebsd.org/cgi/query-pr.cgi?pr=106483.
If that information is present, use it to delete the last known set
of distfiles with certainty, but continue searching the "old" way
until the DISTFILE stuff has been around for a while.
Major Fixes
===========
1. Change the code that reads the MOVED file to recurse through the
whole file. This fixes the problem of getting an "answer" to a
find_moved_port() call only to find out that the "new" port has itself
been moved, or deleted. This is not a major problem, but when it
happens it's ugly. The fix slows down the function by about 1/2 second
on my (fairly fast) box, but that function isn't called often, and
it's better to be thorough. (Brought to my attention by erwin.)
2. Remove a change from the last version that caused way too many
false positives from the MOVED file when there was no installed
version of the port.
3. When running -e, warn the user if there are dependencies on the
port, and improve the error message both here and in the same code
for -s.
Minor Cleanups
==============
1. Assign TMPDIR early in the script, and export it to be safe. Change
occurrences of this variable to use the short form.
2. Factor some code that had been moved to a function back in line
since we're down to just one caller.
3. Only print the verbose message about keeping the current version
of a distfile if we're not in fact deleting all distfiles.
4. Make distfile listing more efficient by using the ALLFILES target
instead of the combination of DISTFILES and PATCHFILES.
=============
1. You can now specify multiple ports to upgrade on the command line,
such as 'portmaster foo-1.23 bar-4.56 baz-7.98'. [1] Pass -n argument
to child processes (as needed) to handle this case.
2. Handle an alternate port that can satisfy a build requirement by
reading the CONFLICTS for the "standard" port, and seeing if we have
one of those installed. [1]
3. Unless the user specifies the new -B option, always build a backup
package when updating an existing port. Unless the user has specified
the -b option, delete the package on successful installation of the
new port, or print a helpful message telling the user where they can
find the package if install fails.
4. Don't only test a port for IGNORE, also test FORBIDDEN and BROKEN
to avoid doing a lot of work on dependencies for a port that we aren't
going to install.
Big Improvements:
=================
1. Significantly enhance the -r option by tracking what ports should
be rebuilt as a result of it, and rebuilding them "in line" if they
are dependencies of other ports that should also be rebuilt. Thus,
make sure that these ports get rebuilt once, and only once. Also,
don't rely on just the installed port's +REQUIRED_BY file to get the
list of dependencies, since it may be out of date. Search the pkg tree
for that port's DEPORIGIN to make sure that we get them all.
2. Track answers to ports that have +IGNOREME files, so the user is
not asked twice.
3. Rather than use all-depends-list to handle dependencies, use a
combination of build-depends and run-depends. This seems to get
everything we actually need, without sucking in a lot of stuff we don't.
4. Stop abusing the config_only mode, and make a clear separation
between first run (if any) and build run that does not depend on it.
This makes -G mode work as intended, with no bad side effects. [1]
Small Improvements:
===================
1. Add PREFIX/sbin to the PATH [1]
2. Cache "no" answers when using -i ("yes" was already cached).
3. If pkg_version thinks that two versions are the same even though
they have different pkg names, don't warn the user.
4. Clean up package code a little.
5. Twiddle the "waiting on" message for fetch & checksum.
6. If a user has a stale +REQUIRED_BY file in a pkg directory, print a
helpful message that suggests how to fix it. [2]
7. Don't tell a user about a -r port to rebuild if we're not going to
rebuild it for whatever reason.
Bug Fixes:
==========
1. Clean up trailing white space.
2. If the pkg data is corrupt, a search for installed port by ORIGIN
could return more than one answer. So, use only the first answer.
3. In dependency_check(), if a port has moved, check the new location
to see if it needs updating.
4. If there are no valid ports to build based on the command line
args, don't try to build /usr/ports/ [3]
[1] Suggested, debugged, and generally helped greatly by mezz
[2] Wondered about by yar
[3] Reminded by Bill Blue
===========
If a port is marked IGNORE, don't do all the dependency/checksum work,
instead bomb out with a helpful message
Minor Fixes
===========
1. Add some whitespace to make the "dependency check complete" message
stand out better
2. Tell the user when we start pkg_delete in -s mode, just like in -e
Bug Fixes
=========
1. Export MAKE_ARGS so that the child checksum processes can see them
2. Move the "just in case" cd back to $portdir up one line so it's
before 'make clean', just in case
============
1. -e mode to expunge a port via pkg_delete, and optionally
remove its distfiles
2. -s and -e modes now respect -b (backup) and -d|D options
regarding always deleting (or not deleting) distfiles
General
=======
1. Re-factor more code out into functions, and move them earlier in the
script so that they are available to the new features.
2. Clean up the code in a few places to make it slightly more efficient,
and a lot more readable.
Bug Fixes
=========
1. Fix exit status of various code paths to be more in keeping
with Unix tradition [1]
2. Be a lot more thorough about killing off errant children when
the user hits ^C [1]
3. If the directory referred to by PKGREPOSITORY exists, use it
to store packages built for -b and -g instead of HOME [2]
My thanks to both Darren and James for their patience and testing
of several development versions to nail down bugs 2 and 3.
Brought to my attention by: Darren Pilgrim <darren.pilgrim@bitfreak.org> [1]
Brought to my attention by: James O'Gorman <james@netinertia.co.uk> [2]
============
1. -L mode to list all installed ports, and search for updates.
2. Trap SIGINT, and use the opportunity to reap all the child processes
we can find.
3. Warn the user during config mode if a port sets IS_INTERACTIVE
4. Support +IGNOREME files in /var/db/pkg/<portname>, ala portupgrade
5. Store the results of the user's choices for -i during config, so they
don't have to enter it again during build
6. When deleting stale distfiles, recurse through successively shorter
versions of file-name-* till we find something to delete, or run out
of dashes. This means a lot fewer false positives, although the
algorithm is still aggressive.
Performance Optimizations
=========================
1. Skip dependency check prior to build if the 'make config' recursion
does not find any ports that need updating.
2. Cache the dependency list for the parent port.
3. -s mode is now recursive, so if a removed port has dependencies,
they are checked too. Remember what ports the user does not want to
delete so they don't have to keep saying "no."
4. Much better support for failed downloads in the background, and the
'make checksum' process is only run once for each port.
5. Switch to using variables and case rather then grep to maintain state
for current dependencies, answers for -i, etc.
6. Re-order some tests to micro-optimize do_update, etc.
7. Handle regular files in /var/db/pkg more efficiently
8. Track the pid of the parent process, and use that to manage state
more efficiently. Also makes for more readable code.
9. Don't clean dependencies, since we don't recurse through them using
the ports tree, we'll let each portmaster process handle it.
10. Cache information about dependencies that are already up to date
to avoid having to do this check when not necessary. This dramatically
improves performance for building/updating large ports (especially
meta-ports like gnome or kde) with a lot of dependencies.
Bug Fixes
=========
1. Add -f to pkg_delete in -s case
2. Reverse the "is required by" statements to make more sense for -r
3. Add PATCHFILES to the list of distfiles to delete when looking for
stale distfiles
4. Minor cleanups, and better code consistency
5. usage() already exits, so clean up h) getopt
6. Add a catchall getopt so user will get usage() for an invalid option
7. Update some messages to make them more meaningful and simplify code
8. Fix specifying second option to -o in <category/portname> format
9. Properly handle the case where the second argument to -o is a port
that is already installed
10. Don't mention the 'make config' step if -G
Security Enhancement
====================
1. Be more careful to only delete temp files if they haven't already been
deleted or moved
=============
1. Add -b option to make a backup package of the installed port
2. Add -g option to make a package of the new port
3. Add -o option to replace an installed port with a new port from a
different location (e.g., portmaster -o emulators/linux_base-fc4 linux_base)
The second argument can also be specified as the name of the installed port
(e.g., linux_base-8-8.0_15)
4. Add -s option to detect no-longer-needed dependencies, and offer the user
a choice to delete them.
General improvements:
=====================
1. Update usage() to reflect reality, and organize it better
2. Switch to using DEPORIGIN to detect missing dependency tracking, which
provides dramatically fewer false positives, and more useful tools to fix
actual problems
3. Factor out more common code into functions
4. Only pay attention to +REQUIRED_BY files for dependency tracking if they
are > 0 bytes
5. Simplify option parsing
6. Make whitespace more consistent in -a message
7. Only grep for dependencies if we're upgrading an installed port
8. If using -o, or a port moved, try to find the names of the old distfiles,
and offer the user the choice to remove all of the, or prune the stale ones.
Bug fixes:
==========
1. Fix the PATH if a user is using ccache
2. Handle the case where there is no ORIGIN in a +CONTENTS file
3. Ignore errors in the tail of fetchlog, since if the file is gone we'll
exit the loop anyway
1. Update DEPORIGIN in addition to @pkgdep entries in +CONTENTS
2. Give more details about why a port moved
3. grep for the old port name in existing +CONTENTS files, since the
new name will not appear at all
Also, stretch the window to wait for a background 'make checksum' to
complete to 5 seconds instead of 3
easier to leave it running unattended for large updates. (This can be
toggled off.)
2. Implemented a completely unattended mode which accepts the defaults for
all portmaster dialogues. (Note, this does not help with ports that have
interaction other than 'make config', such as ghostscript, etc.)
3. Added -u to sort(1) calls to try and address a bug report about duplicate
lines in +REQUIRED_BY files. I was not able to reproduce this bug, but
better safe than sorry.
4. Verbose mode is now slightly more informative about what's happening.
5. More common code factored out into functions.
6. The -n flag now cancels the build of the port called on the command line too.
7. Improved (?) the stale distfile deletion routine to better handle ports
that have multiple distfiles.
8. We now launch 'make checksum' (which performs a fetch if needed) in the
background while recursing through dependencies.
9. Various code cleanups, such as adding -t to a mktemp invocation that was
missing it, more local variables in functions, more consistent flag variable
values, etc.