signal.signal(signal.SIGINT, exithandler)
signal.signal(signal.SIGTERM, exithandler)
- # Quiet killing of subprocesses by SIGPIPE (see bug #309001).
+ # Prevent "[Errno 32] Broken pipe" exceptions when
+ # writing to a pipe.
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
except KeyboardInterrupt:
fi
if [[ $EBUILD_PHASE = depend ]] ; then
- # Skip this for older EAPIs since lots of ebuilds/eclasses
- # have stuff in global scope that really belongs somewhere
- # like pkg_setup or src_configure.
- if [[ -n $EAPI ]] && ! hasq "$EAPI" 0 1 2 3 3_pre2 ; then
- die "use() called during invalid phase: $EBUILD_PHASE"
- fi
+ # TODO: Add a registration interface for eclasses to register
+ # any number of phase hooks, so that global scope eclass
+ # initialization can by migrated to phase hooks in new EAPIs.
+ # Example: add_phase_hook before pkg_setup $ECLASS_pre_pkg_setup
+ #if [[ -n $EAPI ]] && ! hasq "$EAPI" 0 1 2 3 ; then
+ # die "use() called during invalid phase: $EBUILD_PHASE"
+ #fi
+ true
# Make sure we have this USE flag in IUSE
elif [[ -n $PORTAGE_IUSE && -n $EBUILD_PHASE ]] ; then
_unpack_tar() {
if [ "${y}" == "tar" ]; then
- $1 -dc "$srcdir$x" | tar xof - || die "$myfail"
+ $1 -dc "$srcdir$x" | tar xof -
+ assert "$myfail"
else
$1 -dc "${srcdir}${x}" > ${x%.*} || die "$myfail"
fi
tar xozf "$srcdir$x" || die "$myfail"
;;
tbz|tbz2)
- bzip2 -dc "$srcdir$x" | tar xof - || die "$myfail"
+ bzip2 -dc "$srcdir$x" | tar xof -
+ assert "$myfail"
;;
ZIP|zip|jar)
unzip -qo "${srcdir}${x}" || die "$myfail"
signal.signal(signal.SIGINT, exithandler)
signal.signal(signal.SIGTERM, exithandler)
- # Quiet killing of subprocesses by SIGPIPE (see bug #309001).
+ # Prevent "[Errno 32] Broken pipe" exceptions when
+ # writing to a pipe.
signal.signal(signal.SIGPIPE, signal.SIG_DFL)
except KeyboardInterrupt:
elif os.path.isdir(os.path.join(portdir_overlay, ".hg")):
vcs = "hg"
+# Note: We don't use ChangeLogs in distributed SCMs.
+# It will be generated on server side from scm log,
+# before package moves to the rsync server.
+# This is needed because we try to avoid merge collisions.
+check_changelog = vcs in ('CVS', 'SVN')
+
vcs_local_opts = repoman_settings.get("REPOMAN_VCS_LOCAL_OPTS", "").split()
vcs_global_opts = repoman_settings.get("REPOMAN_VCS_GLOBAL_OPTS")
if vcs_global_opts is None:
relative_path + ': %s' % error_match.group(1))
del mydigests
- # Note: We don't use ChangeLogs in distributed SCMs.
- # It will be generated on server side from scm log,
- # before package moves to the rsync server.
- # This is needed because we try to avoid merge collisions.
- if vcs not in ("git", "hg") and "ChangeLog" not in checkdirlist:
+
+ if check_changelog and "ChangeLog" not in checkdirlist:
stats["changelog.missing"]+=1
fails["changelog.missing"].append(x+"/ChangeLog")
if repolevel < 2:
ebuild_path = os.path.join(catdir, ebuild_path)
ebuild_path = os.path.join(".", ebuild_path)
- if not changelog_modified and ebuild_path in new_ebuilds:
+ if check_changelog and not changelog_modified \
+ and ebuild_path in new_ebuilds:
stats['changelog.ebuildadded'] += 1
fails['changelog.ebuildadded'].append(relative_path)
from portage.util import write_atomic
cvs_header = re.compile(r'^#\s*\$Header.*\$$')
for x in myheaders:
- f = open(x)
+ f = codecs.open(_unicode_encode(x,
+ encoding=_encodings['fs'], errors='strict'),
+ mode='r', encoding=_encodings['repo.content'], errors='strict')
mylines = f.readlines()
f.close()
modified = False
mylines[i] = line.replace("/Attic/", "/")
modified = True
if modified:
- write_atomic(x, "".join(mylines))
+ write_atomic(x, "".join(mylines),
+ encoding=_encodings['repo.content'], errors='strict')
manifest_commit_required = True
if vcs in ('cvs', 'svn') and (myupdates or myremoved):
required.
.TP
.BR "\-\-emptytree " (\fB\-e\fR)
-Reinstalls all world packages and their dependencies to the current USE
-specifications while differing from the installed set of packages as
-little as possible. You should run with \fB\-\-pretend\fR first to make
-sure the result is what you expect.
+Reinstalls target atoms and their entire deep
+dependency tree, as though no packages are currently
+installed. You should run this with \fB\-\-pretend\fR
+first to make sure the result is what you expect.
.TP
.BR "\-\-fail\-clean[=n]"
Clean up temporary files after a build failure. This is
.TP
\fBACCEPT_LICENSE\fR = \fI[space delimited list of licenses or groups]\fR
This variable is used to mask packages based on licensing restrictions. It
-make contain both license and group names, where group names are prefixed
+may contain both license and group names, where group names are prefixed
with the '@' symbol. License groups are defined in the \fIlicense_groups\fR
file (see \fBportage\fR(5)). In addition to license and group names, the
\fI*\fR and \fI-*\fR wildcard tokens are also supported. Refer to GLEP 23
.fi
.TP
.BR use.local.desc
-All local USE flags must be listed here along with the package and a
-description.
+All local USE flags are listed here along with the package and a
+description. This file is automatically generated from the
+metadata.xml files that are included with each individual package.
+Refer to GLEP 56 for further information:
+\fIhttp://www.gentoo.org/proj/en/glep/glep-0056.html\fR.
.nf
.I Format:
def _start(self):
self.args = [self._shell_binary, "-c",
- ("bzip2 -dqc -- %s | tar -xp -C %s -f -") % \
+ ("bzip2 -dqc -- %s | tar -xp -C %s -f - ; " + \
+ "p=(${PIPESTATUS[@]}) ; " + \
+ "if [ ${p[0]} != 0 ] ; then " + \
+ "echo bzip2 failed with status ${p[0]} ; exit ${p[0]} ; fi ; " + \
+ "if [ ${p[1]} != 0 ] ; then " + \
+ "echo tar failed with status ${p[1]} ; exit ${p[1]} ; fi ; " + \
+ "exit 0 ;") % \
(portage._shell_quote(self.pkg_path),
portage._shell_quote(self.image_dir))]
print(" dependencies that are not strictly required.")
print()
print(" "+green("--emptytree")+" ("+green("-e")+" short option)")
- print(" Virtually tweaks the tree of installed packages to contain")
- print(" nothing. This is great to use together with --pretend. This makes")
- print(" it possible for developers to get a complete overview of the")
- print(" complete dependency tree of a certain package.")
+ desc = "Reinstalls target atoms and their entire deep " + \
+ "dependency tree, as though no packages are currently " + \
+ "installed. You should run this with --pretend " + \
+ "first to make sure the result is what you expect."
+ for line in wrap(desc, desc_width):
+ print(desc_indent + line)
print()
print(" "+green("--fail-clean[=n]"))
desc = "Clean up temporary files after a build failure. This is " + \
update_files = {}
file_contents = {}
myxfiles = ["package.mask", "package.unmask", \
- "package.keywords", "package.use"]
+ "package.keywords", "package.license", "package.use"]
myxfiles += [os.path.join("profile", x) for x in myxfiles]
abs_user_config = os.path.join(config_root, USER_CONFIG_PATH)
recursivefiles = []