In shuffling around the updating of +REQUIRED_BY I forgot to delete
empty grep_deps files. [1]

While I'm looking at unlink'ing files, bring some sanity to the various
places that it's done which haven't been reviewed in a while.
* Fix the pm_unlink* functions to use the builtin test
* Only/always call the function when we're not sure if the file exists
* Just use /bin/unlink when we're sure it does

Submitted by:	olgeni [1]
Small refinement for unlink'ing, in parent_exit the glob pattern in the
for loop will return 'pattern-*' if there are no matches, so test for
that specifically rather than returning to the conditional version.
The mere presence of IS_INTERACTIVE in the Makefile is not enough, the
condition needs to be verified in case it is conditional

PR:		ports/157481
Submitted by:	Carl <k0802647@telus.net>
We want to make sure that $TMPDIR exists before trying to use it. The
cheapest way to do this is to just call mkdir -p. Move the umask call
before this to be safe.

Split the test for the existence of /usr/X11R6 and whether or not it's
a link for one more micro-optimization.
If a user has non-standard FETCH_ARGS it could circumvent the intent
of --always-fetch, so forcibly unlink the file before proceeding to
the fetch routine.
Avoid duplicate word in a composite sentence

Submitted by:	Dan Allen <danallen46@airwired.net>
For --clean-packages if a package is up to date but not installed
it should still be deleted if -y is in use.
Add support for multiple -r options on the same command line.

Take the opportunity to make names of -r related internal variables
shorter, consistent, and prefixed with PM_.
Document that -r can be specified more than once.
The -a option needs the same check as -r
In find_and_delete_distfiles() (run after a successful install) change
the default pattern to be foo-[0-9]* instead of foo* [1]

This matches 19,305 out of 25,106 unique distfiles, and dramatically
reduces false positives for files like foo-1.23 vs. foo-bar-2.34. Of the
ones that this pattern misses, 4,713 don't match the traditional distfile
format anyway, so it's a huge net win; and should make running without -D
much less annoying.

When the new pattern doesn't match any existing distfiles, fall back to
the old one. Do this by calling with the pattern, not the file name. This
simplifies processing in the function a bit.

Also in find_and_delete_distfiles(), cache matches to $DI_FILES so that
we don't have to re-test that same file again.

Change the method used to print the prompt in get_answer_g() to echo -e
so that I can be more flexible in formatting prompt messages.

Suggested by:	Lapo Luchini <lapo@lapo.it> [1]
Add a more-or-less painless test to deal with the issue of the current
working directory no longer existing. This problem usually manifests as
a "The value of DISTDIR cannot be empty" error because 'make -f' does
not handle this condition gracefully.
Add the ability to retry package creation. This is mostly useful for
PM_SU_CMD after a build that took so long that your sudo ticket has
expired.

While I'm at it, apply the benefits of looking at old code with fresh
eyes to the other place where there are 3 options in the menu (and thus
neither of the get_answer*() variants are appropriate.
In the code that derives the proper value of PACKAGESITE remove 6.x and
add 9.x. Also add a 10-current entry.
s/printf/echo -e/ for consistency, and use it to full advantage
Use pkg query in portmaster
Upgrade the portmaster patch to 3.10

While here make multiport working
Merge tag '3.10' into integrate-pkgng

Conflicts:
	portmaster
Fix a couple of issues with pkg invocation
Spell "use_pkgng" correctly