Commit graph

76 commits

Author SHA1 Message Date
Doug Barton
825c979ac5 Update for version 2.7 2009-02-05 23:16:06 +00:00
Doug Barton
782ca5da36 Update for version 2.7:
1. Document the --check-port-dbdir

2. Add a paragraph about why it's not possible for portmaster to continue
when there is an error.

3. Update the suggested alias for portmaster -L

4. Update the process of deleting and reinstalling ports to include the
new --check-port-dbdir option, and to check /var/db/pkg
2009-02-05 23:15:21 +00:00
Doug Barton
e06a996271 New Feature
===========
1. Add --check-port-dbdir to clean stale entries from /var/db/ports [1]
Since the definition of PORT_DBDIR is now used in more than one place,
add it to the initialization routine at the top.

General Improvements
====================
1. Add a 'nonfatal' option to find_moved_port() so that when it's
called in a context where we don't care about a port that has been
deleted (such as distfile listing) it doesn't exit. Add some code to
that function to tell -L that the port has been deleted.

2. Deal with ports that require user interaction to fetch by checking
first whether MASTER_SITES is empty before running 'make checksum'.
This should solve the problem of portmaster unintentionally deleting
the distfiles for java ports, inter alia. [2]

3. Improve kill_bad_children() by using process group id [3]

4. Don't call kill_bad_children() in safe_exit() without reason.

a. Implement this for the distinfo child process by flagging the first
line of the file and checking for a file with -s instead of just -e.
b. Implement this for -F mode by flagging when all the background
processes have finished.

This should result in less of those annoying 'Terminated' messages

5. Move the start of read_distinfos() until after we are sure that we
are going to try building the port.

Small Fixups
============
1. When update_contents() finds something odd when updating a port
suggest using --check-depends to clean it up.

2. In check_for_update() avoid having variables that differ only by case

3. In update_port() recurse with just the port to update [3]

4. In dependency_check() run check_interactive() for installed
versions that need updating.

5. Update copyright

Concept by:             RW <fbsd06@mlists.homeunix.com> [1]
Fix Suggested by:       ale [2]
Suggested by:           Geraint Edwards <gedge@yadn.org> [3]
2009-02-05 23:11:23 +00:00
Doug Barton
c93d20bde6 Update for version 2.6 2008-07-28 21:26:19 +00:00
Doug Barton
09e773a456 Update to reflect the ability to specify multiple glob patterns
added in version 2.6.
2008-07-28 21:25:48 +00:00
Doug Barton
62ccec52c0 New Features
============
1. You can now specify multiple globs for directories in /var/db/pkg on the
command line (along with full names of directories/paths from /usr/ports
and/or /var/db/pkg, as before)
2. When calling check_interactive or update_port from check_for_updates
tell the user what updated version is available. [1]

Bug Fixes
=========
1. Don't set show_list to "all" for -a unless there is somthing to show
2. Add K (don't postclean) to getopts [2]

Other Improvements
==================
1. In check_dependency_files() don't let ro_opd be empty for the purpose
of the egrep expression. It works now, but it apparently violates the
spec and could case problems down the road (e.g., for bsdgrep).
2. Since the BSDPAN pseudo-ports do not exist in the ports tree there
is nothing for portmaster to do with them. Therefore ignore them when
appropriate, notifying the user when necessary. [3]

Submitted by:	Geraint Edwards <gedge@yadn.org> [1]

PR:		ports/126006 [2]
Submitted by:	ahze [2]
Pointy hat:	moi [2]

Problem pointed out by:	Bapt <baptiste.daroussin@gmail.com> [3]
PR:			ports/125428 [3]
2008-07-28 21:24:53 +00:00
Doug Barton
230aa2029d Update for version 2.5 2008-06-12 20:33:32 +00:00
Doug Barton
0eab31bb77 Bug Fixes
=========
1. Fix -a mode by moving the update of CONFIG_SEEN_LIST to after the port
has been checked for available updates. The old way worked as a side
effect to one of the things I fixed in version 2.4. This is probably
how it should have been done all along, but since the old way worked
I was hesitant to change it.

2. Now that we are using a different format for the INSTALLED_LIST,
fix the bit that always displays the list if we are using -a.
2008-06-12 20:33:04 +00:00
Doug Barton
28f12ee959 Document the potentially useful variables for rc files 2008-06-12 20:27:05 +00:00
Doug Barton
3ed25b7d18 Add "rm -rf /usr/local/lib/compat/pkg" to the list of steps to
update your ports tree after a major version upgrade
2008-06-11 20:08:16 +00:00
Doug Barton
b4445975fb Update for version 2.4 2008-06-11 19:39:29 +00:00
Doug Barton
cb20064d5b Minor New Feature
=================
Print a list of ports that will be worked on when doing multiple
ports, either from a glob or listed on the command line.

Bug Fixes
=========
1. When working multiple ports, if a port that is specified on the
command line is reached as a dependency for another port that is on
the command line (either specifically or from a glob) that port
should be rebuilt the first time through, even if it is up to date.
2. By the same token, only rebuild that dependent port once if it
was not up to date. Implement these features by keeping lists of
what needs to be, and has been built specific to the multiport
context.
3. In multiport() declare local variables to be local
4. When reading a glob pattern from the command line do not run
the multiport feature if there is only one match, just pass it on.

Minor Enhancements
==================
1. Save the list of work done using \t and \n and print with echo -e
2. Now that we are properly updating CONFIG_SEEN_LIST at the end of
the config run remove the old update to that list from
dependency_check()
2008-06-11 19:38:54 +00:00
Doug Barton
9e206425c4 Update for version 2.3 2008-06-04 21:18:18 +00:00
Doug Barton
6269d5f21c Update for version 2.3:
1. A glob pattern on the command line now updates all ports that match
2. Clarify that we rebuild the port(s) on the command line by default
3. Document -K option
4. Note the move of /etc/portmaster.rc -> /usr/local/etc/portmaster.rc
5. Document that you need to look in the script to find values to place
in the *rc files. TODO: List potentially useful variables
5. Fix the Xr for sudo
2008-06-04 21:17:48 +00:00
Doug Barton
1e374ac146 New Features
===========
1. By popular demand, change the command line behavior of 'portmaster blah*'
to update all ports in /var/db/pkg which match the glob.
2. Add the -K flag to avoid cleaning the work directory after the build.[1]

Bug Fixes
=========
1. Instead of /etc/portmaster.rc we should be reading
/usr/local/etc/portmaster.rc.[2] Begin introducing support for that.
2. If using the -n option, don't try to fetch the distfiles.[3]
3. When I added the optimization to only run 'make -V CONFLICTS' if
it existed in the Makefile I neglected to unset the value of $conflicts
in the script between ports.[4]
4. I ran into a port which set VERBOSE to a value that it needed to use
in its build process, and since I was using the -v option for portmaster
(which sets VERBOSE=yes) the build failed. To work around this, prefix
the variable names for common English words (VERBOSE, FORCE, BUILDING)
with PM_.
5. To aid future debugging (as in 4. above) change the values of flag
variables to something meaningful instead of just "yes."
6. Automatically handle the case where the parent port has MOVED instead
of asking the user to re-run portmaster with the right options.

Submitted by:	pav [1]
Submitted by:	Miroslav Lachman 000.fbsd@quip.cz [2]
Submitted by:	Jiawei Ye <leafy7382@gmail.com> [3]

PR:		ports/124271 [4]
Submitted by:	James Kelly <jjk@tilted.net> [4]
2008-06-04 21:17:30 +00:00
Doug Barton
f50961d10a Update for version 2.2 2008-03-19 21:47:36 +00:00
Doug Barton
8bc50bccf4 New Implementation
==================
The previous code tried to handle moved ports in much the same way
as it handled replacing a port with the -o option, but this would
sometimes create problems if we are deep in a dependency graph.
So rather than re-implement only a portion of the -o code, use the
whole thing instead.

We accomplish this by either exec'ing ourselves with the proper -o
options if we are in the dependency tree, or by asking the user to
restart with the proper -o options if they specified the moved port
on the command line. The latter is necessary to avoid having to
duplicate all the "initialize the parent process" code.  This allows
me to simplify the code in a few places since -o is now the only
special case.

Bug Fixes
=========
1. Don't try to derive $portdir from $upg_port if using -o
2. Don't try to build a port with an +IGNOREME file if we are doing
the dependent ports in -r mode

Minor tweak: Add some whitespace after a warning message
2008-03-19 21:47:16 +00:00
Doug Barton
8a0263d32e In the example about using portmaster to do a complete re-install of
your ports, I had:
pkg_delete *
which works for me because of a local bash completion, but doesn't
work for most users. So, correct that to be:
pkg_delete '*'
instead.
2008-03-19 20:25:01 +00:00
Doug Barton
fe9e95088f Update for the 2.1 version 2008-01-30 02:59:18 +00:00
Doug Barton
0d1c021fbe 1. Add explanatory text about some issues that have caused confusion:
a. If you specify a glob pattern in /var/db/pkg, there will always
be a prompt, even with the -u flag.
b. Try to discourage people from using -u, it doesn't seem to do what
people expect it to do.
c. You cannot upgrade sudo with PM_SU_CMD if sudo is your PM_SU_CMD

2. s/Dq/Qq/

3. Add .Ev tags to environment variables
2008-01-30 02:58:37 +00:00
Doug Barton
eabb62a9b0 Cosmetic fix for the code: Only expand the $FreeBSD tag once
Bug fix: If using the combination -aiG, don't run the interactive mode
test in the build phase, use the one that's already in check_for_updates()
2008-01-30 01:48:10 +00:00
Doug Barton
d86e68157a Update for version 2.0 2008-01-24 02:38:29 +00:00
Doug Barton
2815d6f989 The code for this 2.0 version has been totally reorganized, and
in several cases totally rewritten. I am also glad to say that
all of the advertised features now work as advertised.  :)

The most exciting new feature is the completely new dependency
updater. I finally took the time to write the line-oriented version
of update_contents() that I wanted to write in the first place, so
no more sed, and no more warnings sent to $PAGER. This version relies
entirely on exact matches to DEPORIGIN to do its work, so it's 100%
reliable.

So what else is new? A lot of micro-optimizations have been done to
eliminate duplicated work, avoid using external commands when not
necessary, etc. There are also some not-so-micro optimizations, which
means that this version is noticably faster.

Totally new features:
1. --check-depends, which as described above calls the new functions
to parse existing +CONTENTS files for dependency data, uses that data
to update +REQUIRED_BY, and updates the +CONTENTS files.  These same
routines are also used for updating ports.

2. A "fetch only" feature (-F) that will go get distfiles for new
versions of installed ports by default, and can also be used to get
the files for all of your installed ports, or certain branches by
using the -aft options.

3. An option to hide the build and install process by saving it to a
log (-H). These logs are deleted on successful install, and saved if
the update process aborts.

4. We now keep track of all the ports that get updated or installed in
a given invocation, and print the list at the very end of the process.

5. There is now a little "map" to show you where you are in the
process of the form "parent >> child >> grandchild >> etc."

6. Support for running as an unprivileged user (via sudo) has been
added. See the man page for details on how to configure this.

Improved features:
1. When showing the pkg-message/+DISPLAY files at the end of the
process, all files are grouped together and spit out to $PAGER (or
just cat if -u). If there is an error, there is a pause first
(unless -u).

2. There is now much more sanity checking on user input so that we can
bail out early if there is a problem.

3. The error messages have been completely re-done to be more
informative, and many of them include helpful suggestions on how to
fix the problems.

4. In the expunge (-e) feature, if there is dependency data for the
port you want to delete we now offer you the chance to delete that
instead of just aborting. (Use at your own risk!)

5. The "save old shared libs" feature (-w) is now a lot more
efficient, only runs ldconfig when it has to, and uses
/etc/rc.d/ldconfig.

6. The /var/db/pkg/*/+IGNOREME file now has more functions associated
with it. See the man page for details.

7. When using the -L feature, there is a warning printed if the port
has been set to FORBIDDEN, DEPRECATED, BROKEN, or IGNORE.

8. If you have a real /usr/X11R6 directory (not a symlink) this is
added to the PATH. Otherwise it's assumed that LOCALBASE == X11BASE.

9. Backup packages of existing ports are now saved to
/usr/ports/packages/portmaster-backup, and left there if -b is used.
This way you can create backup packages of a port without disturbing
existing packages with the same version.

There are numerous other things that are not user-visible which have
been cleaned, polished, made more efficient, etc.
2008-01-24 02:36:58 +00:00
Doug Barton
efb105439f Update for version 1.27 2008-01-04 10:30:29 +00:00
Doug Barton
35c962ef45 Restore the canonical order of installing run-depends before the parent 2008-01-04 10:29:57 +00:00
Doug Barton
393f7dcb86 Update for version 1.26 2007-12-12 21:51:32 +00:00
Doug Barton
5be76771c0 New Features
===========+
1. If an +IGNOREME file is present for a package that has a new
version, let the user know.
2. Use printf to display BROKEN/FORBIDDEN/IGNORE messages so that
multi-line messages with embedded newlines will display properly.

Typo Fix
========
Fix two typos in the "it's interactive" message
... on the same line
... in two consecutive words. A new personal record.

I did run through the rest of the script with aspell and didn't
notice anything else, but who knows?
2007-12-12 21:50:59 +00:00
Doug Barton
64cd4a7231 Update for version 1.25
Approved by:	portmgr (marcus)
2007-10-31 08:57:40 +00:00
Doug Barton
fada3faae4 Small bug fixes
===============
1. In delete_all_distfiles(), $distdir already contains a trailing slash
2. Only print the "no new versions" message for -L, not -l

Big bug fix
===========
1. cd back to the port directory before trying to run 'make install'

pointy_hat_supply++

Approved by:	portmgr (marcus)
2007-10-31 08:57:03 +00:00
Doug Barton
aa26dde9e5 Update for version 1.24 2007-10-30 07:26:57 +00:00
Doug Barton
994d7737f1 These changes are the result of some regression testing, plus a top
to bottom read through prompted by a user reporting bug #1 below.
Fortunately I only found that one additional instance of forgetting
to virtualize a value we derive from bsd.port.mk, but I did find and
fix a few more things as well.

Bug Fixes
=========
1. Virtualize an occurrence of $distdir instead of using $pd/distfiles
2. Make all variables in read_distinfos() local
3. When specifying multiple ports on the command line, the test for
PARENT_PID to start read_distinfos() would always fail, so start it
in the initial PARENT_PID block instead. This also implies pulling the
DI_FILES creation up into that same block.

Non-Functional Changes
======================
1. Adjust whitespace in the code, and the script output in a few places
2. Use a shell expansion instead of sed to trim multiple results
3. Remove one redundant error check
4. Replace the name find_contents_distfiles() with find_dl_distfiles()
since the info is not in +CONTENTS anymore
5. Add/update comments to the existing code

Small changes to actual behavior
================================
1. When dealing with unrecorded dependencies pipe the results to
'less -F'
2. Minor optimization: In read_distinfos(), check to see if we're
upgrading an existing port, and if so do that port first so we're
sure the right distfiles will be in DI_FILES even if the function
doesn't complete before the port is done building/installling
3. Add a message to -L to indicate when there are no new versions
4. Move the checks for run-depends after installation of the parent
port so that if a run-depends port has a build-depends on the parent,
it will work. This is a supported, but apparently not recommended
configuration. To make this work do the install with -DNO_DEPENDS so
that we can take charge of the run-depends installs.
2007-10-30 07:18:50 +00:00
Doug Barton
60319e71da Update for version 1.23 2007-10-21 05:33:30 +00:00
Doug Barton
4611f3a852 Two small bug fixes
===================
1. When I changed how the MOVED file was treated in version 1.19
I accidentally typed a literal /usr/ports/. Change that to the
variable for PORTSDIR as it should be. [1]

2. When using the --show-work feature and the port has no dependencies,
exit immediately instead of recursing.

Submitted by:	Jason C. Wells <jcw@highperformance.net> [1]
2007-10-21 05:33:07 +00:00
Doug Barton
ca59df258b Update for version 1.22 2007-10-15 04:56:04 +00:00
Doug Barton
9f930e9dba Bug Fixes
=========
1. For all values derived from bsd.port.mk, assert that they are not empty.
This helps prevent problems when running 'find $value ...'
2. Don't try to append to the master list of distfiles if we're using -D

Refinements for /var/db/ports/$name/distfiles
=============================================
1. Only create a distfiles file if the port has distfiles
2. Delete the distfiles list and try to delete PORT_DBDIR when we pkg_delete.
(The latter will fail if there is an options file present.)
3. Define the distfiles list even if we are using -D
2007-10-15 04:55:42 +00:00
Doug Barton
9638e8c753 Update for version 1.21 2007-10-02 04:50:34 +00:00
Doug Barton
4aabf74f14 New Features
============
1. Switch to saving distfile info in /var/db/ports/$name/distfiles
ala PR http://www.freebsd.org/cgi/query-pr.cgi?pr=106483
2. Keep track of distfiles we've already examined so we won't have to
do them again (or print the "keeping" message for -v more than once).
This has more benefit the more distfiles a port has.
3. Add all distfiles for the new port to DI_FILES after install.
This only makes a difference in a few cases, but it's easy to do.

Bug Fixes
=========
1. Make sure that $distdir always has a trailing slash in case it
is a symlink. [1]
2. In delete_stale(), test whether or not a file is in the _current_
distfile list to make sure that it is not auto_deleted by mistake. [1]
3. When building DI_FILES, only use lines starting with MD5 to avoid
adding every file > 1 time.
4. Only run read_distinfos() when we really need it.

[1] Inspired by ...
PR:		ports/116298
Submitted by:	NIIMI Satoshi <sa2c@sa2c.net>
2007-10-02 04:49:46 +00:00
Doug Barton
bbdb8e2a32 Update for version 1.20 2007-08-27 22:48:55 +00:00
Doug Barton
f2dbeb52f9 Improvement
===========
1. Before calling pkg_create for the installed version of the port,
cd into the PKGREPOSITORY directory. This not only simplifies the code,
it helps handle the problems of ports trees mounted read-only. [1]
2. Factor out initialization of the $pkgrep directory into a function.

Bug fixes
=========
1. Before calling 'find ${pkgrep}/ ... -delete' assert that $pkgrep is
not empty.
2. Make sure that $pkgrep is initialized everywhere it's needed.

Suggested by:	Hans Lambermont <hans@lambermont.dyndns.org> [1]
2007-08-27 22:48:24 +00:00
Doug Barton
f7d72531d7 Update for version 1.19 2007-08-05 05:04:58 +00:00
Doug Barton
096b99a715 1. Change to 'make -f/usr/share/mk/bsd.port.mk' in several places due to
the DESTDIR changes today.
2. Export pd, pdb, and distdir to avoid having to look them up each time
3. Streamline find_moved() by grepping for lines, and then recursing
4. Further streamline by using variable stripping instead of cut
2007-08-05 05:04:14 +00:00
Doug Barton
40fcd6e83d 1. Update for version 1.18
2. I'm told if DISTFILES is empty, the fake do-fetch target is not needed
2007-07-08 06:37:42 +00:00
Doug Barton
60536b36b2 Bug Fixes
=========
1. If we are doing --show-work, don't launch background processes
that are only useful for real builds.
2. Fix a rather obscure bug that can only happen:
IFF you are doing an install of a new port, and
IFF you have a dependency "early" in the list with an +IGNOREME file, and
IFF you have one or more dependencies "late" in the list that are not
installed. The bug is a false positive on the +IGNOREME for the uninstalled
ports. The solution is to reset the "port to test for +IGNOREME file"
variable each time through the loop. This will usually be a noop, but it
costs almost nothing in any case.
2007-07-08 06:35:35 +00:00
Doug Barton
c0f32886e4 Update for version 1.17 2007-05-27 08:10:54 +00:00
Doug Barton
5b10dfb3b9 New Features
============
1. Keep a temporary flag that indicates a port has already been upgraded
during a -r or -f update, and add a -R (retry) option to let the user
skip those ports on subsequent attempts if the first update is interrupted.
2. Change the default behavior to use 'make config-conditional' to
take advantage of the recent enhancements to the OPTIONS functionality.
3. Add a new --force-config flag to use the old behavior of doing
'make config' for every port.
4. Don't delete backup packages until the original (parent) portmaster
process has finished successfully. That way if an update fails, the user
can back out the whole thing.
5. Add -w option to save old shared libraries from an installed port.
6. Add -x option to avoid building ports that match the glob pattern.
7. Split tracking of build and run depends to before and after the
port build respectively.

Enhancements
============
1. If the user interrupts the update, search for errant dialog
processes as well as errant portmaster child processes.
2. Avoid invoking pkg_version in check_for_updates() if the installed
version is already up to date.
3. Call pkg_info for seemingly stale dependencies (-s) so user has
a better idea what he's being asked to delete.
4. Use -DBATCH when calling 'make checksum' in the background so that
ports that have pre-everything dialogs no longer cause runaway dialog
processes.
5. Add BEFOREPORTMK=yes where it can be used to speed things up.
Thanks to Stephen Montgomery-Smith <stephen@math.missouri.edu>
6. Be smarter about not starting read_distinfos in the background if
there is no need to, and be more aggressive in killing it off when
we're done.
7. Make read_distinfos quieter to avoid printing confusing messages
out of synch with the foreground process.

Changes
=======
1. Use the PKGREPOSITORY directory for all packages, create it if it
doesn't already exist.
2. If we fail(), call one of {trap|safe}_exit to do a better job of
cleaning up after ourselves.
3. Make failures of various commands silent when we provide our own
error message.
4. Make killing background processes generally much quieter.

Bug Fixes
=========
1. In check_for_updates(), when FORCE is on, don't skip an up to date
port.
2. Change MAKE_ARGS to PM_MAKE_ARGS to avoid collisions with ports that
use the former already.
3. Fix grammar in a usage() line, add details for --show-work, and
other various improvements.
4. Move the clean target to after (optional) 'make package' to avoid
having to rebuild the port.
5. Only try to update the +CONTENTS file if it exists.
2007-05-27 08:10:33 +00:00
Doug Barton
1b6e514311 Fix a test in find_and_delete_distfiles() introduced in the last
commit that I forgot to merge from my devel version.

PR:		ports/110125
Submitted by:	Simon Phoenix<phoenix.lists@gmail.com>
2007-03-09 17:22:51 +00:00
Doug Barton
de95d33a96 Update for version 1.15 2007-03-08 23:48:51 +00:00
Doug Barton
ae707d21f2 Document --show-work option for 1.15
Various small markup fixes and improvements
2007-03-08 23:48:22 +00:00
Doug Barton
d3a1d8fc2d New Features
============
1. --show-work option which will recurse through all-depends-list
and show what dependencies are, and are not installed.
2. Dramatically reduce false positives for per-port distfile cleaning
by creating a list of valid distfiles for all ports. Use this new
method for the --clean-distfiles* options as well.

Bug Fix
=======
Honor DISTDIR if set for --clean-distfiles*
2007-03-08 23:47:44 +00:00
Doug Barton
e06c42072e Minor Bugfix
============
If a user were to specify /var/db/pkg/foo-1.2/ on the command line,
the old code already failed, but by telling people that it's ok to
do that now, I exposed one more place this needed to be fixed. Take
the opportunity to fix this in a more thorough way.
2007-02-25 08:05:22 +00:00