Skip to content


Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
branch: user/dougb/por…
Commits on Oct 1, 2012
  1. Due to improvements in the efficiency of portmaster's method of killing

    dougb authored
    background processes when trap'ing, plus the declining quality of ports
    generally, when the background process that reads the distinfo files
    encountered a fatal error (which they have been doing more frequently of
    late), the resulting call to fail() would end up neatly killing all of
    that parent's background fetch processes as well.
    Fix that problem by not making the disruption in read_distinfos() fatal
    unless it's being used for --clean-distfiles. All the other calls to this
    function are run in the background for the distfile gathering process, and
    a missing file in that list is an inconvenience at worst.
Commits on Jul 24, 2012
Commits on Jul 23, 2012
  1. When -r, print a clearer message for term-title about what we're doing

    dougb authored
    when we are going through the ports that depend on the -r port(s)
    If there is an installed version, always print that message, not just
    when we're in the parent
Commits on Jul 22, 2012
  1. In check_dependency_files() unset the grep_deps var if we unlink the …

    dougb authored
    In find_dl_distfiles() we only need to test -s $dist_list if we're looking
    at the old file, since the test for the new file already does this.
    Optimize determination of $new_port:
     * When first set, let it be global
     * Use a function to incorporate/optimize the various tests from the
       2 different places that it was being set
  2. Simplify update_build_l(). Nowadays when we call it we always know the

    dougb authored
    origin, and if the port is installed we don't need to search for either
  3. More minor code cleanups

    dougb authored
Commits on Jul 20, 2012
  1. Bug fix: Do read_distinfos() in the background for multiport() too, oops

    dougb authored
    Update the comment re read_distinfos() in the single port code to reflect
    current reality
  2. Use a more robust method of determining portdir from $PWD. This also …

    dougb authored
    for bare 'portmaster' with no arguments now, if you're in a port directory.
Commits on Jul 19, 2012
  1. Removing $ALL_FETCH was a mistake because the reason it existed previ…

    dougb authored
    is that $UPDATE_ALL cannot be exported to the children. So bring it back
    as $PM_ALL_FETCH.
    This is basically a cosmetic bug which will only show up when using -Faf
Commits on Jul 16, 2012
  1. Turns out there are a non-zero number of distinfo files that have SIZE

    dougb authored
    listed first, so in the code that parses them for the data to put into
    /var/db/pkg/$port/distfiles, handle this situation gracefully.
  2. Minor tweaks/fixes

    dougb authored
    * Do not use variables where they are not needed
    * Do not duplicate the same test
    * Unset multiple variables with the same command instead of 2
    * When deleting empty DISTDIR subdirs use -mindepth 1 so that it will not
      error out if the directory is totally empty.
    * Unset more stuff after it is no longer needed
    * Update some comments to match the current state of the code
    * Remove some stuff that cannot be reached any longer
    Performance enhancement
    * In read_distinfos*() use while read instead of grep. Avoids the fork
      and cuts the total time for that feature 25%
Commits on Jul 9, 2012
  1. Minor bug fix

    dougb authored
    * If we trap while working on a child port don't remove that child from
      the PM_NEEDS_UPDATE list so that when it gets printed in the parent
      that child is still on the list. While I'm here, tidy up the code that
      prints the list.
    Cosmetic changes
    * Add -e to the pm_v echo as well, to allow easier printing of ws without
      using multiple commands.
    * Move the counting of categories and total ports to ports_by_category()
      so that it can be used in other places besides -[lL]
    * Use the count of total ports as $num_of_deps for -Faf
    * In multiport(), decrement the number of ports to work on and print a -v
      message if we have already encountered a port in the worklist as a dependency
      of another port in the list. This is not only better cosmetically, it means
      we don't have to reset it after the first pass.
    * For -a, remove the old, unnecessary test for FIRST_PASS, and re-indent that
      code. Also, add the num_{roots|trunks|branches|leaves} values to the headers
    * The ALL_FETCH var was only used in one place anymore, so use the values
      behind it instead.
Commits on Jul 7, 2012
  1. For --features:

    dougb authored
    * Most don't create $IPC_SAVE, so don't try to source it in a trap if it
      doesn't exist
    * $grep_deps may exist for some features, like --check-depends, so always
      delete it in safe_exit if it exists
    * Don't try to clean out WRKDIRPREFIX if we're not actually building
    * In update_contents() streamline the code that handles replacing the file
      if necessary
    * Simplify the whitespace in the code that updates dependencies after an
      install, there will always be at least one pm_v printed, so no need to
      be coy about it
Commits on Jul 6, 2012
  1. 2 more small ws twiddles

    dougb authored
  2. * More whitespace twiddles

    dougb authored
    * If using -i and there is an +IGNORME file, the default should be no
Commits on Jul 5, 2012
  1. One more tiny whitespace tweak

    dougb authored
  2. Major updates/fixes to the distfile handling code

    dougb authored
    * Make all parts of the code SUBDIR-safe (most were already)
      - This involves using $port_subdir globally to refer to just the
        directory name under DISTDIR, and add a $full_port_subdir to contain
        the full path to the file for the places where that was used.
        This also allows simplifying a few places where both were needed.
      - Fix a few places where the relativity of the cwd was not respected,
        most often resulting in files not being deleted that should be
    * When checking DI_FILES, anchor the grep pattern with a ^ to
      avoid false positives
    * Move the storage of the distfile info back to /var/db/pkg where it
      should have been all along. Mostly for correctness, but also to deal
      with the problem of non-UNIQUENAMEs causing the wrong files to be
      deleted with -d.
    * Clean up the old /var/db/ports/*/distfiles files after reading them,
      and delete the directory if it's empty. Since we are doing this
      unconditionally now, there is no longer a need for delete_dist_list().
      The new ones will live and die with the rest of the package directory.
    * Update some of the messages printed out for distfile-related things
      to make it more clear what's going on.
    * Check DI_FILES to see if the distfile could be valid for another port
      in more places, so add a function to deal with the common ones.
    * Add 2 more functions, make_distfiles() and make_port_subdir() to bring
      that common code (3 places each, ugh) under the same umbrella. Improve
      both implementations to use fewer forks.
    Other changes
    * Add -e to the echo for pm_sv so that we can easily add a newline
    * Take advantage of the above, and other adjustments to the whitespace
      to try to fit with the general theme of ws after a section
    * Change the last 'find -d foo' to 'find foo -depth'
    * Use 'while read' for the installed distfiles file, less forks
Commits on Jun 26, 2012
  1. Finally remembered why the line from r237475 was too verbose, -Fa. So…

    dougb authored
    … only
    print it if we're not -F.
    Also for -F, print a line saying that we're skipping a file if we've
    already started a background fetch/checksum process for the same file.
Commits on Jun 23, 2012
  1. Restore the line from -av that prints each port as we work on it.

    dougb authored
    This was removed in r236996 because at that point in the development
    of the new term_printf() code it was indeed too verbose. But subsequent
    changes to that code made this no-longer redundant, and I forgot to
    put it back.
  2. Various fixes to IPC_SAVE:

    dougb authored
    1. In safe_exit() always zero out the file before writing. This is probably
       redundant now given the following change, but I'll leave it in to be
       safe for now.
    2. Zero out the file after reading it. The change in r236996 could lead
       to the parent process reading a stale file under certain circumstances.
       The combination of things that need to happen for this to occur are
       complex, but not impossible.
    3. Move the writing of $PM_BUILD_ONLY_LIST - related variables into
       safe_exit(). When originally put in the previous location it saved
       what could have been a spurious test, but that test was long ago
       added to safe_exit(). Also, by not writing it there it could be
       missed in certain circumstances where the exit happened without
       reaching that code in the main script.
       This brings all the code that writes to the file into safe_exit()
    4. NB_DELETE can only be set while building, so move writing it to that
    When -F, and the port has no distfiles, report that explicitly
Commits on Jun 15, 2012
Commits on Jun 13, 2012
  1. Revert r237003 since it is needed to restore the terminal title during a

    dougb authored
    long delay between -a ports to update. Add a comment so I don't forget.
    Also restore part of r236996, match >> for the in-line term_printf()
    code, and add that pattern in post_first_pass() where it's needed to match.
    Adjust the summary message in multiport() to suit. Arguably this is a more
    elegant way to present the information anyway.
    Don't bother trying to delete empty directories in WRKDIRPREFIX if we
    are exiting abnormally, chances are there will be a work directory
    from the failed port.
  2. Add code to detect dependency loops created by moving part of a port

    dougb authored
    into another port, and CONFLICT'ing on previous versions of that port
    (ala textproc/p5-XML-SAX -> p5-XML-SAX-Base). When a loop is detected
    suggest that the user try pkg_updating.
  3. When calling trap_exit() in a child process we need to signal the

    dougb authored
    parent(s) that we trap'ed so that the various post-run cleanups and
    updates can still happen properly.
    In a related change, in safe_exit() remove a shortcut from r214541 that
    was safe at the time, but isn't any longer because we now have more
    stuff happening after a run so we still need to update the parent even
    if the child fail'ed or trap'ed.
    When we're run by script(1) the parent process is going to be [sh], not
    $0, so go back to the less efficient but safer method of safeguarding
    the parent in kill_bad_children().
    For -a remove a -v line that is redundant now with the new in-line
    term_printf() code.
    In the new in-line printing code for term_printf() use a simpler
    pattern to match $1 that also catches the following ...
    In multiport(), update the total number of ports after the first pass
    to account for ports given on the command line that turn out to be
    dependencies of other ports given on the command line, and print a
    summary with the number of parent ports and dependencies prior to the
    confirmation prompt.
Commits on Jun 11, 2012
  1. In multiport(), count the number of ports in worklist_tmp, then use that

    dougb authored
    for the first progress update. The number might get revised due to the
    user opting out of an update that matches a glob pattern, but it's better
    than doing 1/1, 2/2, etc. in the first pass.
  2. Give a better error message if pm_mktemp() fails

    dougb authored
    Add some whitespace after the message about removing empty directories
  3. Move the test for installed ports on the build-only dep list to a better

    dougb authored
    location, after the code that checks to see if any ports on the list are
    depended on. Also, we only want to disqualify an installed port if we're
    doing --delete-build-only. If the port is already installed and needs an
    update, --packages-build still applies.
  4. In iport_from_origin() work around pkg_info returning 0 even if there is

    dougb authored
    no match
    In clean_build_only_list() remove ports that are already installed to
    prevent them from being spuriously removed. [1]
    Reported by:	avilla [1]
Commits on Jun 10, 2012
  1. Remove the misguided r236841

    dougb authored
  2. Give the (verbose) messages about cleaning up a little whitespace,

    dougb authored
    and clarify what we are waiting for.
  3. If the second argument to -o is something that is completely non-exis…

    dougb authored
    properly report what the user typed in the error message.
    Reported by:	avilla
Something went wrong with that request. Please try again.