================================
1. Adjust whitespace at the end of the run
2. In a couple places where default value setting is overly complex
(including a couple of the places related to the recent ro_upg_port
changes) simplify the code.
3. When checking stat(1) for the INDEX updates we really want to check
the time when the file was last modified for pedantic value, although
in this scenario the practical effect was the same.
4. In --check-port-dbdir we now need to check if the values in the loop
are directories, since origin_from_pdb() now emits an error if it can't
find ORIGIN.
============
Expand on an idea provided by mandree@ to use 'pkg_version -I' to quickly
check what ports are out of date, and incorporate that check into the
--index option. Feedback from users seems to indicate that this is what
they expected the option to do anyway, so the minor change to the feature
does not seem to be a POLA violation, especially since INDEX support is
still relatively new. Add the --index-first option to do what --index used
to do in case anyone cares.
Bug Fixes
=========
1. Add more error checking for incompatible command line options.
Add a new cross_idx() to handle checking the 3 --index* options, and
consolidate some of the old tests that were all relative to -G.
2. We want to test the .bz2 version of INDEX to see if it's newer, and
unzip it if it is.
3. For -o mode:
Going back a long ways upg_port was (ab)used to indicate the currently
installed version of the old port for -o. Originally this was safe since
it's very rare to have the new port installed already, and it saved a
little bit of code complexity. However, as more and more features were
added that utilized the value of upg_port it became increasingly
unsafe. Particularly, at this time there are 2 related bugs manifest.
First the wrong information appears in the confirm list (upgrade of
the old port vs. install of the new) and parsing the old port
directory. The latter was (mostly) harmless, although in the case of
an old port directory being DEPRECATED this resulted in a fatal error
when trying to upgrade.
So, make the following changes:
a. Make upg_port an installed version of the new port, if it exists.
b. Introduce ro_upg_port for the existing version of the old port.
c. Factor out some code that was related to how to handle lack of an
installed version of the old port (since now that's done higher up).
d. In the stage after the build of the new port and before pkg_delete
of the old port test for upg_port OR ro_upg_port and run the various
features (lib backup for -w, pkg_delete, etc.) as needed for both.
e. In install_failed() notify the user about the backup port for the old
version.
f. I discovered in regression testing that invoking -o for MOVED
ports that we get to as dependencies was working, but the code to
automatically invoke -o for a parent port was broken. The problem is
that we can't just exec a new version if we're the parent, we have to
cleanly shut down background fetches and other processes, delete temp
files, etc. So split the parts of safe_exit() that relate to these
elements into their own function, parent_exit(), and call it both
from safe_exit() and when exec'ing a new version for -o in this case.
4. Add error checking to pm_mktemp, and the stray mktemp call. According
to a private report from a user it can actually fail.
5. Add error-checking to parse_index() so that if we don't find a line for
the port we return an error code; check for the error in the callers.
6. Improve the handling of various situations where there is no ORIGIN
recorded in the +CONTENTS file. This is almost always an error in the
package building process, and therefore usually needs to be flagged and
handled as an error. There are (at least) 2 situations where it may not
be an error; bsdpan ports, and when the user has added an +IGNOREME file
(usually for 3rd party packages).
a. Add code to origin_from_pdb() that tests to see that grep returned
something, echos the result as before, then also returns successfully
* If the port is a bsdpan port, return with an error code but let the
caller handle the reporting as appropriate.
* If there is no ORIGIN but there is an +IGNOREME file don't report
the error unless we're using -v, then also report that the
+IGNOREME file is there. Either way, return with an error code.
* If there is no ORIGIN, and no +IGNOREME file, report the error and
return with an error code.
b. In several places this allows several lines of code where the
function is called to be collapsed into:
origin=`origin_from_pdb $iport` || continue
c. In the main body where we parse the command line for what to work on
convert the code that was individually testing the various conditions
that are now handled in origin_from_pdb() to simply parse the return
codes with a case statement.
In the common case (there is an ORIGIN in +CONTENTS) this is almost
certainly a minor optimization since the error handling code in
origin_from_pdb() is never reached, and several places where things
like "is it a bsdpan port?" and other error handling have been removed.
7. In check_for move some local variables down into the block where they
are used.
old way. So only add spaces to the list if we're generating it from the
INDEX, and let the case statement match with or without spaces.
Reported by: avilla
Improve markup slightly for --packages options
Document --index and --index-only
Reflect that -e now takes a glob
Add a note about the nature of glob patterns
============
1. Introducing the new options --index and --index-only. The first
will use the INDEX file to check if a port is up to date. The
second allows the use of portmaster with no /usr/ports directory.
2. The second argument to -o and the port name for -e can now be globs
3. For the -d|-D and -b|-B options allow the command line to override
any values that might be set in .portmasterrc
Internals
=========
1. Add a pm_sv() function to handle verbose messages for PM_SU_CMD
2. Add a find_glob_dirs() function, and use it instead of custom
versions each place this is needed.
3. For -o, add -DDISABLE_CONFLICTS
Bug Fixes
=========
1. If running as root, unset PM_SU_VERBOSE
2. Minor tweaks to improve usage()
===========
Add a --delete-packages option so that after a package is installed
it will be deleted.
User-Visible Change
===================
Warn the user if they have an /etc/portmaster.rc file. This location
is deprecated in favor of PREFIX/etc.
Minor Updates
=============
1. Add -m1 to grep lines that can only have one match
2. Additional debugging help and error checking
3. Introduce init_packages_var() to initialize the PACKAGES variable,
and use it in some places where init_packages() was being overloaded.
4. Improve the logic of when, and when not to initialize the
packages directories.
5. Bring in some internal changes from the latest svn version for
diff reduction.
6. Add $PM_SU_CMD to a few places where it's needed
Bug Fixes
=========
1. In pm_cd_pd() the error message should reference $1, not $origin
2. The -r option should take a glob as input
============
1. Add a --no-term-title option to avoid updating the xterm title bar
Bug Fixes
=========
1. Add code to prevent duplicate entries in the list of things to be
done for the user to confirm after config is done.
2. Add code so that if a user has an +IGNOREME file for a port that
is a dependency and chooses not to update it we will not falsely claim
that it will be udpated in post_config().
3. If we are running on a cons25 terminal let term_printf() return
instead of trying to printf the escapes which won't work and will
annoy users.
4. Fix 2 places where sudo privileges might be needed but the non-sudo
version of the command was called. [1]
5. If a user chose -G don't print the (${dep_of_deps}/${num_of_deps})
in the xterm title since the latter will not be incremented. This has
the pleasant side effect of allowing better indenting of the code.
Submitted by: N.J. Mann <njm@njm.me.uk> [1] (for pkg_delete)
New Features:
=============
1. When running through the config phase a list of things to be installed
and/or upgraded will be generated. This list will then be presented to
the user for confirmation before proceeding.
2. Add a --no-confirm option to suppress this new feature.
3. When using portmaster in an X terminal window that supports updating
the title you will now see a status update for what port is being
built, and as appropriate what dependency of that port and an (N/M)
counter. Thanks to ehaupt for the push on this, as well as some testing
and sample code.
4. Make the "yes or no" prompts (hopefully) more clear by adding "y/n"
to the text of the message, e.g., "===>>> Do you want to live? y/n [y] "
Feature expansion:
==================
Do a more thorough job of tracking things that should fall into the
--packages-build/--delete-build-only category. I.e., if something is
a run dependency of a port or ports that themselves are only build
dependencies, add it to the build_only_dl_g anyway.
New internals:
=============
1. Add a uniquify_list function so that internal lists of variables
can be made unique. Start using it for some of the new stuff, and
in clean_build_only_list().
2. Add a pm_cd_pd() which will cd into the port directory or error out
with an appropriate message.
3. Start using pm_cd_pd() where appropriate, including in a couple of
new places where we have to go back to the port directory after cd'ing
around elsewhere due to the new update_build_l().
4. Make some other cd/pm_cd invocations consistent
Cleanups:
=========
1. Instead of saving some of the new variables unconditionally in
safe_exit() move the things that are only done in the config phase
to that section, and move build_deps_il to the !config section.
2. Since $new_port may be set as a side effect of the new "Terminal
title" feature, conditionalize it for the "main" process.
3. Remove the old RCS Id stuff since I'm not using it
Bug fix:
========
In safe_exit() when doing multiports and we interrupt the process
the attempt to print the INSTALLED_LIST was not successful. So move
all of the related code into a test for INSTALLED_LIST's existence,
and just print the whole list (even if it has only one item) in both
the -a (as it was already) and multiport cases.
1. Versions of pkg_add in FreeBSD older than 6.4-RELEASE will not have
the proper options available, so warn the user if they try to use
package-related code.[1]
2. Highlight some different features
Reported by: Miroslav Lachman <000.fbsd@quip.cz>[1]
====================
1. We only want to set PM_BUILD_ONLY_LIST=pm_bol in the command line
parser if we are the parent port. Otherwise proper build dep detection
will not occur.
2. Versions of pkg_add in FreeBSD older than 6.4-RELEASE will not have
the proper options available, so warn the user if they try to use
package-related code.[1]
Reported by: Miroslav Lachman <000.fbsd@quip.cz>[1]
Feature Update
==============
1. Further update the --packages-build and --delete-build-only options
to work with -a:
a. Create a new function clean_build_only_list() from code that
was already in dependency_check() and use it both there and at
the end of the config mode in -a.
b. Properly initialize the variables related to these two features
in the same spot as all the other global vars are initialized rather
than doing it in different locations.
Major Cleanups
==============
1. 9-CURRENT has its own package repo now, hurray!
2. Instead of having a pca() to describe the post-config action
collect the stuff that always runs after config is done into a
function, and use the pca() logic to determine what to print. This
also restores the whitespace to consistency between the modes
(one port, multiport, -a).
3. Instead of fetching the directory listing for each port category
(devel, ports-mgmt, etc.) every time we need to check a port, fetch
it once and save it to a temporary file. This lets us do several
cool things:
a. Save a lot of time not having to re-fetch each iteration
b. Run the sed code to fix %2c -> , up front
c. Add a sed pattern to fix %2b -> +
d. Run a variety of different patterns to try and find the
latest_pv
4. We only want to run the logic tree on whether $latest_pv is up to
date or not if that variable has a value, so add appropriate tests.
Minor Cleanups
==============
1. Make it easier to include the --packages-build and --delete-build-only
options in a portmaster rc file by setting the PM_BUILD_ONLY_LIST variable
(which is used by both options) in the script if either of the two
options is detected.
2. More robust error-handling for package directory creation in
pm_pkg_create().
3. Move the error message for "no package in -PP mode" to a variable
for both reuse and code readability.
Bug Fixes
=========
1. Not finding a package (or even a package repo) should only fail()
if we are using -PP, not if we're just using -P.
=========
1. In the test for -PP being alone on the command line I forgot the
-dash at the beginning of the second test so it was falsely picking
up ports with names like p5-Devel-PPPort.
2. If you are building more than one port on the command line, and you
use --packages-build and/or --delete-build-only, and one of the ports
on the command line would otherwise qualfiy as a build-only dep, it was
falsely being treated as such. Solve this problem by adding all ports
on the command line to the run_dl_g list in multiport().
3. With the new parser if you use -v with --check-port-dbdir it's going
to be $1, not $2.
4. Don't unset the packages_init function till we're actually done using it
5. If you are using -g plus one of the --packages* options then creation
of the new package will fail since there is nothing for 'make package'
to work with. So change backup_package() to a more generic form called
pm_pkg_create and use that for both making backup packages and making
a new local package from an installed package.
6. In order to facilitate 5, update the dependency information in an
installed package's +CONTENTS file before creating the new package.
Minor Tweaks
============
1. Include the [-v] in the detailed usage() for --check-port-dbdir too
2. Make the output of --version more clear to everyone who isn't me :)
3. If DISTDIR is its own zfs filesystem then the code to delete empty
DIST_SUBDIRs can cause problems, so special case it in its own function.
4. Remove some white space
2. In the procedure for using portmaster to re-install after a major
version upgrade, list "re-install portmaster" as an actual step. [1]
Submitted by: Kevin Oberman <oberman@es.net> [1]
1. Document the new package-related features for version 2.13
2. Remove the requirement that --options be first on the command line
3. Deprecate the -p option
4. Improve the prose in a few sections, mostly removing commas and
simplifying sentences.
5. Small markup tweaks
6. Clearly indicate that +IGNOREME files only work on installed ports
7. Document that -x will work on the origin directory if there is
no installed version.
8. In the example .portmasterrc file the verbose variable needed a value
This is svn version r200206.
New Features
============
1. Support for the following new options:
a. --packages|-P and --packages-only|-PP
b. --packages-build
c. --packages-if-newer
d. --delete-build-only
e. --always-fetch
f. --local-packagedir
In addition to the new code this also involved making some existing
messages more generic, and customizing some others to be aware of
whether packages are in use or not.
2. New command line parser allows placement of --long-options
anywhere in the command line
Minor Tweaks and Fixes
======================
1. Make fail() less finicky about how the message is input
2. Start the process of deprecating -p since it isn't useful
any longer
3. Fix parsing of PKG_DBDIR so that we don't depend on it having
exactly 3 components. This also saves 2 external calls to cut.
4. For the --clean-distfiles[-all] options sort the list before
printing to make it easier to see when files are related.
5. Instead of repeating the tests on when to run read_distinfos()
do them once in the initialization phase then rely on whether or
not DI_FILES is set.
6. Improve some messages to make their meaning more clear
Excellent beta testing and feedback by: Christer Solskogen
Major funding for the package code, including the --packages-build
and --packages-if-newer options was provided by Modirum MDpay.
Additional funding provided by (in no particular order):
Jan Hornyak
Christer Solskogen
R Koole
Michael Proto
Bard Skaflestad
Paul Lambert
Societe ToDoo
Andrew Belashov
Yoriyuki Sakai
Flemming Jacobsen
Julian Stecklina
Douglas Berry
Beat Gatzi
Christopher Dawkins
Mark Boolootian
Soeren Schroeder
Christoph Sold
More information on sponsorship is available at:
http://dougbarton.us/portmaster-proposal.html
My deepest appreciation to the FreeBSD community for the outpouring
of support that allowed me to complete this portion of the project.
Add OPTIONS to install programmable completion files for Bash and zsh.
The Bash file is mine, the zsh file and installation suggestions are
from the PR. Additional testing for the zsh completions from garga.
PR: ports/127319
Submitted by: Shota Iwazaki <iwazaki8@yahoo.co.jp>
============
1. The -x option can now be specified more than once.
2. The --list-origins option will list origins from root and leaf ports
for use in rebuilding all ports (for example after a major version upgrade).
This requires moving ports_by_category() up into the --features section
Improvements
============
1. Error checking for -f and -i now fails instead of silently unsetting -i
2. In dependency_check():
a. Switch to $origin instead of $d_port in several places to make the
messages to the user more clear and consistent
b. $origin is also better for check_interactive()
c. Move check_exclude down to after CONFLICTS check, and use $iport
if it exists. This is more consistent with how check_exclude() usually
works
3. Prefix DEPTH, PARENT_PID and EXCL environment variables with PM_
4. Tighten up multiport by saving confirmed directories into a temporary
list, then running check_exclude() and check_interactive() against
each item of the temporary list, then adding to the final list
5. Execute make in a subshell and unset some of the more unwieldy
environment variables in that shell. (Suggestions and testing by avg)
Details for -x:
===============
1. Since there may be multiple arguments for PM_EXCL, use export not $ARGS
2. Move the error checking into getopts
3. In check_exclude() go through each pattern in turn
users to the EXAMPLES section.
2. Expand the EXAMPLES with some more commonly used features.
3. Minor tweaks to other texts.
This version will go out with portmaster version 2.11 but the changes
are not specific to that version.
to make the code match the equivalent code in the main command line
parser, but I missed one which meant that if you specified multiple
glob patterns on the command line it no longer matched anything.
"Hey this doesn't work anymore" by: Florian Smeets <flo@smeets.im>
"I will do global searches for even small variable changes" x 1000: me
=========
1. Rework the NO_DEP_UPDATES feature which is an optimization when you
are updating or installing a port whose dependencies are all up to date.
a. Stop using a temporary file for this feature, and instead utilize the
existing IPC_SAVE mechanism
b. Focus the toggling of this flag in update_port() so that it will always
be unset when it needs to be (and not when it doesn't)
[This is the actual bug fix]
c. Add a flag that is global but not exported in dependency_check() so
that the toggle in update_port() will know when (and when not) to fire
2. Set PM_BUILDING when it needs to be set in multiport()
Enhancements
============
1. Use globstrip() in multiport(), change the variable to match the parser,
and add notes in the parser and multiport() to keep the code in synch
(it's _just_ different enough so that a function doesn't make sense atm)
2. Replace globstrip sed kludge with more effcient shell pattern
3. Make the PM_BUILDING values more explicit to aid in debugging
when using the -i option. This is a minor inconvenience for those users
that give a list of specific ports on the command line, but a huge
benefit for users who use a glob pattern that can easily match things
that don't need to be rebuilt.
===============
1. For the -[rf] and -R options:
a. Do not delete the flag files that indicate a port has been updated
until the -[rf] process is successful.
b. Update the wording in usage() to be more clear about what -R does
c. If a user starts -[rf] without -R, and there are flag files present,
ask if they would like to delete them, or enable -R mode.
2. Add a globstrip() function and use it to clean up inputs to -x
(and in the input parser where the idea originated)
3. Improve the wording of the message in -s mode about what to do if
they choose not to remove a port with an empty +REQUIRED_BY file
4. Tell the user how many fetches we are waiting for in -F
Removed Feature
===============
Remove the -u option. It did very little, and not what users expected.