[gentoo-portage-dev] [PATCH 3/3] prepman: Deprecate it

2023-04-04 Thread Ulrich Müller
According to PMS, calling prepman from ebuilds was never allowed.
Last usage in Gentoo repository has been removed on 2019-04-14.

Signed-off-by: Ulrich Müller 
---
 bin/ebuild-helpers/prepman | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/bin/ebuild-helpers/prepman b/bin/ebuild-helpers/prepman
index 871fd589b..0c0a7e812 100755
--- a/bin/ebuild-helpers/prepman
+++ b/bin/ebuild-helpers/prepman
@@ -1,8 +1,12 @@
 #!/usr/bin/env bash
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # Note: this really does nothing these days. It's going to be banned
 # when the last consumers are gone.
 
+source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
+
+eqawarn "QA Notice: '${0##*/}' is not allowed in ebuild scope"
+
 exit 0
-- 
2.40.0




[gentoo-portage-dev] [PATCH 2/3] prepinfo: Deprecate it

2023-04-04 Thread Ulrich Müller
According to PMS, calling prepinfo from ebuilds was never allowed.
Last usage in Gentoo repository has been removed on 2018-11-22.

Bug: https://bugs.gentoo.org/899898
Signed-off-by: Ulrich Müller 
---
 bin/ebuild-helpers/prepinfo | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/bin/ebuild-helpers/prepinfo b/bin/ebuild-helpers/prepinfo
index 14fa38226..af5ae9f08 100755
--- a/bin/ebuild-helpers/prepinfo
+++ b/bin/ebuild-helpers/prepinfo
@@ -1,9 +1,11 @@
 #!/usr/bin/env bash
-# Copyright 1999-2022 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
 
+eqawarn "QA Notice: '${0##*/}' is not allowed in ebuild scope"
+
 if ! ___eapi_has_prefix_variables ; then
ED=${D}
 fi
-- 
2.40.0




[gentoo-portage-dev] [PATCH 1/3] misc-functions.sh: Inline prepinfo code in install_qa_check()

2023-04-04 Thread Ulrich Müller
Add a deprecation warning. Presumably, subdirs of /usr/share/info have
never been used by any package except app-editors/emacs.

Remove duplicate rm statement at the end of the function.

Bug: https://bugs.gentoo.org/899898
Signed-off-by: Ulrich Müller 
---
 bin/misc-functions.sh | 24 +++-
 1 file changed, 19 insertions(+), 5 deletions(-)

diff --git a/bin/misc-functions.sh b/bin/misc-functions.sh
index 55c4afe73..235823afc 100755
--- a/bin/misc-functions.sh
+++ b/bin/misc-functions.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# Copyright 1999-2018 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 #
 # Miscellaneous shell functions that make use of the ebuild env but don't need
@@ -143,7 +143,24 @@ install_qa_check() {
chflags -R nosunlnk,nouunlnk "${ED}" 2>/dev/null
fi
 
-   [[ -d ${ED%/}/usr/share/info ]] && prepinfo
+   if [[ -d ${ED%/}/usr/share/info ]]; then
+   # Portage regenerates this on the installed system.
+   rm -f 
"${ED%/}"/usr/share/info/dir{,.info}{,.Z,.gz,.bz2,.lzma,.lz,.xz,.zst} \
+   || die "rm failed"
+   # Recurse into subdirs. Remove this code after 2023-12-31. 
#899898
+   while read -r -d '' x; do
+   ( shopt -s failglob; : "${x}"/.keepinfodir* ) 
2>/dev/null \
+   && continue
+   for f in 
"${x}"/dir{,.info}{,.Z,.gz,.bz2,.lzma,.lz,.xz,.zst}; do
+   if [[ -e ${f} ]]; then
+   eqawarn "QA Notice: Removing Info 
directory file '${f}'."
+   eqawarn "Relying on this behavior is 
deprecated and may"
+   eqawarn "cause file collisions in 
future."
+   rm -f "${f}" || die "rm failed"
+   fi
+   done
+   done < <(find "${ED%/}"/usr/share/info -mindepth 1 -type d 
-print0)
+   fi
 
# If binpkg-docompress is enabled, apply compression before creating
# the binary package.
@@ -251,9 +268,6 @@ install_qa_check() {
prepallstrip
fi
fi
-
-   # Portage regenerates this on the installed system.
-   rm -f "${ED%/}"/usr/share/info/dir{,.Z,.gz,.bz2,.lzma,.lz,.xz,.zst} || 
die "rm failed!"
 }
 
 __dyn_instprep() {
-- 
2.40.0




[gentoo-portage-dev] [PATCH] Remove obsolete FEATURES=force-prefix

2023-01-22 Thread Ulrich Müller
Signed-off-by: Ulrich Müller 
---
 bin/dohtml.py|  6 ++
 bin/eapi.sh  |  4 ++--
 lib/portage/const.py |  3 +--
 lib/portage/package/ebuild/config.py | 11 +++
 man/make.conf.5  |  8 +---
 5 files changed, 9 insertions(+), 23 deletions(-)

diff --git a/bin/dohtml.py b/bin/dohtml.py
index 4ebee7779..d1f0e3140 100755
--- a/bin/dohtml.py
+++ b/bin/dohtml.py
@@ -1,5 +1,5 @@
 #!/usr/bin/env python
-# Copyright 1999-2020 Gentoo Authors
+# Copyright 1999-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 #
@@ -146,9 +146,7 @@ class OptionsClass:
 self.PF = os.environ["PF"]
 if self.PF:
 self.PF = normalize_path(self.PF)
-if "force-prefix" not in os.environ.get(
-"FEATURES", ""
-).split() and os.environ.get("EAPI", "0") in ("0", "1", "2"):
+if os.environ.get("EAPI", "0") in ("0", "1", "2"):
 self.ED = os.environ.get("D", "")
 else:
 self.ED = os.environ.get("ED", "")
diff --git a/bin/eapi.sh b/bin/eapi.sh
index d90c3cd2e..ae815f3a6 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -1,5 +1,5 @@
 #!/usr/bin/env bash
-# Copyright 2012-2022 Gentoo Authors
+# Copyright 2012-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 # PHASES
@@ -27,7 +27,7 @@ ___eapi_has_S_WORKDIR_fallback() {
 # VARIABLES
 
 ___eapi_has_prefix_variables() {
-   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2)$ || " ${FEATURES} " == *" force-prefix 
"* ]]
+   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2)$ ]]
 }
 
 ___eapi_has_BROOT() {
diff --git a/lib/portage/const.py b/lib/portage/const.py
index a6f7a2242..99206fe2c 100644
--- a/lib/portage/const.py
+++ b/lib/portage/const.py
@@ -1,5 +1,5 @@
 # portage: Constants
-# Copyright 1998-2021 Gentoo Authors
+# Copyright 1998-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 import os
@@ -156,7 +156,6 @@ SUPPORTED_FEATURES = frozenset(
 "fakeroot",
 "fixlafiles",
 "force-mirror",
-"force-prefix",
 "getbinpkg",
 "gpg-keepalive",
 "icecream",
diff --git a/lib/portage/package/ebuild/config.py 
b/lib/portage/package/ebuild/config.py
index 23b524235..f66bf6485 100644
--- a/lib/portage/package/ebuild/config.py
+++ b/lib/portage/package/ebuild/config.py
@@ -1,4 +1,4 @@
-# Copyright 2010-2021 Gentoo Authors
+# Copyright 2010-2023 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 __all__ = [
@@ -3347,14 +3347,9 @@ class config:
 if not (src_like_phase and eapi_attrs.broot):
 mydict.pop("BROOT", None)
 
-# Prefix variables are supported beginning with EAPI 3, or when
-# force-prefix is in FEATURES, since older EAPIs would otherwise be
-# useless with prefix configurations. This brings compatibility with
-# the prefix branch of portage, which also supports EPREFIX for all
-# EAPIs (for obvious reasons).
+# Prefix variables are supported beginning with EAPI 3.
 if phase == "depend" or (
-"force-prefix" not in self.features
-and eapi is not None
+eapi is not None
 and not eapi_supports_prefix(eapi)
 ):
 mydict.pop("ED", None)
diff --git a/man/make.conf.5 b/man/make.conf.5
index 34c3cd5b5..05832ce1c 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -1,4 +1,4 @@
-.TH "MAKE.CONF" "5" "Nov 2021" "Portage VERSION" "Portage"
+.TH "MAKE.CONF" "5" "Jan 2023" "Portage VERSION" "Portage"
 .SH "NAME"
 make.conf \- custom settings for Portage
 .SH "SYNOPSIS"
@@ -522,12 +522,6 @@ fixes (order of flags, duplicated entries, ...)
 Only fetch files from configured mirrors, ignoring \fBSRC_URI\fR,
 except when \fImirror\fR is in the \fBebuild\fR(5) \fBRESTRICT\fR variable.
 .TP
-.B force\-prefix
-Enable prefix support for all ebuilds, regardless of EAPI, since older EAPIs
-would otherwise be useless with prefix configurations. This brings
-compatibility with the prefix branch of portage, which also supports EPREFIX
-for all EAPIs (for obvious reasons).
-.TP
 .B getbinpkg
 Force emerges to always try to fetch files from the \fIPORTAGE_BINHOST\fR.  See
 \fBmake.conf\fR(5) for more information.
-- 
2.39.1




[gentoo-portage-dev] [PATCH] repoman: Remove http compatibility code for metadata DTD

2022-01-25 Thread Ulrich Müller
Commit 3950d76df says: "The http:// compat can be removed once the
Gentoo repository is updated to use https:// everywhere."

Bug: https://bugs.gentoo.org/552720
Signed-off-by: Ulrich Müller 
---
 repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py 
b/repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py
index b4e0ee933..0fb97a0df 100644
--- a/repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py
+++ b/repoman/lib/repoman/modules/scan/metadata/pkgmetadata.py
@@ -127,7 +127,7 @@ class PkgMetadata(ScanBase, USEFlagChecks):
 )
 else:
 doctype_system = _metadata_xml.docinfo.system_url
-if doctype_system.replace("http://;, "https://;) != 
metadata_dtd_uri:
+if doctype_system != metadata_dtd_uri:
 if doctype_system is None:
 system_problem = "but it is undefined"
 else:
-- 
2.34.1




[gentoo-portage-dev] [PATCH v2] eend: Output QA notice when called without argument

2021-09-04 Thread Ulrich Müller
PMS says about eend: "Takes one fixed argument, which is a numeric
return code, and an optional message in all subsequent arguments."

Bug: https://bugs.gentoo.org/703520
Signed-off-by: Ulrich Müller 
---
 bin/isolated-functions.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index b495ae6c7..5630dcf4c 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -364,6 +364,7 @@ __eend() {
 }
 
 eend() {
+   [[ -n $1 ]] || eqawarn "QA Notice: eend called without first argument"
local retval=${1:-0}
shift
 
-- 
2.33.0




[gentoo-portage-dev] [PATCH] eend: Output QA notice when called without argument

2021-09-03 Thread Ulrich Müller
PMS says about eend: "Takes one fixed argument, which is a numeric
return code, and an optional message in all subsequent arguments."

Bug: https://bugs.gentoo.org/703520
Signed-off-by: Ulrich Müller 
---
 bin/isolated-functions.sh | 1 +
 1 file changed, 1 insertion(+)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index b495ae6c7..5b1f372d2 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -364,6 +364,7 @@ __eend() {
 }
 
 eend() {
+   [[ -n $1 ]] || eqawarn "QA Notice: eend called without return code"
local retval=${1:-0}
shift
 
-- 
2.33.0




[gentoo-portage-dev] [PATCH v2 2/2] ebuild.sh: Update QA notice in inherit()

2021-08-30 Thread Ulrich Müller
Bug: https://bugs.gentoo.org/399039
Signed-off-by: Ulrich Müller 
---
 bin/ebuild.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 1bca2c965..3042e6c8c 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -248,8 +248,8 @@ inherit() {
# previous inherit call in the call stack.
if [[ -n ${ECLASS} && -n ${!__export_funcs_var} ]] ; then
eqawarn "QA Notice: EXPORT_FUNCTIONS is called before 
inherit in ${ECLASS}.eclass."
-   eqawarn "For compatibility with <=portage-2.1.6.7, only 
call EXPORT_FUNCTIONS"
-   eqawarn "after inherit(s)."
+   eqawarn "For compatibility with PMS and to avoid 
breakage with Pkgcore, only call"
+   eqawarn "EXPORT_FUNCTIONS after inherit(s). Portage 
behavior may change in future."
fi
fi
 
-- 
2.33.0




[gentoo-portage-dev] [PATCH v2 1/2] Revert "Revert "Generate a QA Notice when EXPORT_FUNCTIONS is called before inherit""

2021-08-30 Thread Ulrich Müller
Reinstate the QA notice, because Portage behavior deviates from PMS,
and breakage of eclasses with Pkgcore has been observed recently.

This reverts commit f44d32550861cb25c209ef61dcd7ae1aa230da1f.

Bug: https://bugs.gentoo.org/399039
Signed-off-by: Ulrich Müller 
---
 bin/ebuild.sh | 8 
 1 file changed, 8 insertions(+)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 5916bedfc..1bca2c965 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -243,6 +243,14 @@ inherit() {
ECLASS_DEPTH=$(($ECLASS_DEPTH + 1))
if [[ ${ECLASS_DEPTH} -gt 1 ]]; then
debug-print "*** Multiple Inheritence (Level: ${ECLASS_DEPTH})"
+
+   # Since ECLASS_DEPTH > 1, the following variables are locals 
from the
+   # previous inherit call in the call stack.
+   if [[ -n ${ECLASS} && -n ${!__export_funcs_var} ]] ; then
+   eqawarn "QA Notice: EXPORT_FUNCTIONS is called before 
inherit in ${ECLASS}.eclass."
+   eqawarn "For compatibility with <=portage-2.1.6.7, only 
call EXPORT_FUNCTIONS"
+   eqawarn "after inherit(s)."
+   fi
fi
 
local -x ECLASS
-- 
2.33.0




[gentoo-portage-dev] [PATCH 2/2] ebuild.sh: Update QA notice in inherit()

2021-08-29 Thread Ulrich Müller
Bug: https://bugs.gentoo.org/399039
Signed-off-by: Ulrich Müller 
---
 bin/ebuild.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 1bca2c965..f5f3d9eec 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -248,8 +248,7 @@ inherit() {
# previous inherit call in the call stack.
if [[ -n ${ECLASS} && -n ${!__export_funcs_var} ]] ; then
eqawarn "QA Notice: EXPORT_FUNCTIONS is called before 
inherit in ${ECLASS}.eclass."
-   eqawarn "For compatibility with <=portage-2.1.6.7, only 
call EXPORT_FUNCTIONS"
-   eqawarn "after inherit(s)."
+   eqawarn "For compatibility with PMS, only call 
EXPORT_FUNCTIONS after inherit(s)."
fi
fi
 
-- 
2.33.0




[gentoo-portage-dev] [PATCH 1/2] Revert "Revert "Generate a QA Notice when EXPORT_FUNCTIONS is called before inherit""

2021-08-29 Thread Ulrich Müller
Reinstate the QA notice, because Portage behavior deviates from PMS,
and breakage of eclasses with Pkgcore has been observed recently.

This reverts commit f44d32550861cb25c209ef61dcd7ae1aa230da1f.

Bug: https://bugs.gentoo.org/399039
Signed-off-by: Ulrich Müller 
---
 bin/ebuild.sh | 8 
 1 file changed, 8 insertions(+)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 5916bedfc..1bca2c965 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -243,6 +243,14 @@ inherit() {
ECLASS_DEPTH=$(($ECLASS_DEPTH + 1))
if [[ ${ECLASS_DEPTH} -gt 1 ]]; then
debug-print "*** Multiple Inheritence (Level: ${ECLASS_DEPTH})"
+
+   # Since ECLASS_DEPTH > 1, the following variables are locals 
from the
+   # previous inherit call in the call stack.
+   if [[ -n ${ECLASS} && -n ${!__export_funcs_var} ]] ; then
+   eqawarn "QA Notice: EXPORT_FUNCTIONS is called before 
inherit in ${ECLASS}.eclass."
+   eqawarn "For compatibility with <=portage-2.1.6.7, only 
call EXPORT_FUNCTIONS"
+   eqawarn "after inherit(s)."
+   fi
fi
 
local -x ECLASS
-- 
2.33.0




[gentoo-portage-dev] [PATCH] einstalldocs: Fix test for DOCS being unset.

2020-02-20 Thread Ulrich Müller
The current test does not exactly test for unset DOCS, because it also
evaluates as true if the variable has attributes. Such attributes can
be defined even for an unset variable.

Therefore test the output of declare -p for presence of an = sign
instead, which indicates that a value has been assigned to the
variable (bug 710076 comment #2).

PMS reference: Algorithm 12.4, line 7:
https://projects.gentoo.org/pms/7/pms.html#x1-135011r183

See also bash upstream discussion:
https://lists.gnu.org/archive/html/bug-bash/2020-02/msg00045.html

Closes: https://bugs.gentoo.org/710076
Signed-off-by: Ulrich Müller 
---
 bin/phase-helpers.sh | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 3deb28c68..9495465f9 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2019 Gentoo Authors
+# Copyright 1999-2020 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 if ___eapi_has_DESTTREE_INSDESTTREE; then
@@ -953,7 +953,7 @@ fi
 if ___eapi_has_einstalldocs; then
einstalldocs() {
(
-   if ! declare -p DOCS &>/dev/null ; then
+   if [[ $(declare -p DOCS 2>/dev/null) != *=* ]]; then
local d
for d in README* ChangeLog AUTHORS NEWS TODO 
CHANGES \
THANKS BUGS FAQ CREDITS 
CHANGELOG ; do
-- 
2.25.1


signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH] eapply: Drop -s option for patch.

2019-11-25 Thread Ulrich Müller
We generally try to have verbose build logs, e.g., by calling
configure with --disable-silent-rules. Silencing patch contradicts
this, and will suppress reporting of fuzz factors.

Note that the eapply specification in PMS calls patch without -s:
https://projects.gentoo.org/pms/7/pms.html#x1-127001r1
Traditionally, the -s option wasn't used by epatch either.

Bug: https://bugs.gentoo.org/674562
Signed-off-by: Ulrich Müller 
---
 bin/phase-helpers.sh | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index b53d39650..60f8d3243 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -993,10 +993,9 @@ if ___eapi_has_eapply; then
ebegin "${prefix:-Applying }${f##*/}"
# -p1 as a sane default
# -f to avoid interactivity
-   # -s to silence progress output
# -g0 to guarantee no VCS interaction
# --no-backup-if-mismatch not to pollute the sources
-   ${patch_cmd} -p1 -f -s -g0 --no-backup-if-mismatch \
+   ${patch_cmd} -p1 -f -g0 --no-backup-if-mismatch \
"${patch_options[@]}" < "${f}"
failed=${?}
if ! eend "${failed}"; then
-- 
2.24.0


signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH] doins: Fix directory install options when called as dodoc.

2019-10-02 Thread Ulrich Müller
PMS does not mention that diropts should be respected when dodoc -r
creates directories recursively. This is consistent with the behaviour
for regular files, where insopts isn't respected either.

A parallel patch for further clarification of the PMS wording has been
sent to the gentoo-pms mailing list for review.

Signed-off-by: Ulrich Müller 
---
 bin/ebuild-helpers/doins | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/bin/ebuild-helpers/doins b/bin/ebuild-helpers/doins
index fb5fc7c7c..24fe48121 100755
--- a/bin/ebuild-helpers/doins
+++ b/bin/ebuild-helpers/doins
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
@@ -15,6 +15,7 @@ if [[ ${helper} == dodoc ]] ; then
exit 0
fi
export INSOPTIONS=-m0644
+   export DIROPTIONS=""
export _E_INSDESTTREE_=usr/share/doc/${PF}/${_E_DOCDESTTREE_}
 else
if ! ___eapi_has_DESTTREE_INSDESTTREE; then
-- 
2.23.0


signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH 1/2] man/ebuild.5: Fix .nf macro usage.

2019-07-27 Thread Ulrich Müller
Several .nf (no-fill mode) blocks were not terminated by .fi, causing
broken formatting of the rest of the manpage.

Fixes: cdcf4a28409daa7c56a0c2c94054f48bd5e43c6d
Signed-off-by: Ulrich Müller 
---
 man/ebuild.5 | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 7742ffbce..31bd8f771 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -351,16 +351,18 @@ xfree\-4.2.1\-r2.ebuild \-\-> $PR=='r2'
 .B PVR
 Contains the version number with the revision (if non-zero).
 
-xfree\-4.2.1.ebuild \-\-> $PVR=='4.2.1'
 .nf
+xfree\-4.2.1.ebuild \-\-> $PVR=='4.2.1'
 xfree\-4.2.1\-r2.ebuild \-\-> $PVR=='4.2.1\-r2'
+.fi
 .TP
 .B PF
 Contains the full package name \fBPN\fR\-\fBPVR\fR
 
-xfree\-4.2.1.ebuild \-\-> $PF=='xfree\-4.2.1'
 .nf
+xfree\-4.2.1.ebuild \-\-> $PF=='xfree\-4.2.1'
 xfree\-4.2.1\-r2.ebuild \-\-> $PF=='xfree\-4.2.1\-r2'
+.fi
 .TP
 .B CATEGORY
 Contains the package category name.
-- 
2.22.0


signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH 2/2] man/ebuild.5: Document PROPERTIES="live".

2019-07-27 Thread Ulrich Müller
Signed-off-by: Ulrich Müller 
---
 man/ebuild.5 | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 31bd8f771..b002f3889 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1,4 +1,4 @@
-.TH "EBUILD" "5" "Apr 2019" "Portage VERSION" "Portage"
+.TH "EBUILD" "5" "Jul 2019" "Portage VERSION" "Portage"
 
 .SH "NAME"
 ebuild \- the internal format, variables, and functions in an ebuild script
@@ -708,13 +708,17 @@ Disables userpriv for specific packages.
 .RE
 .PD 1
 .TP
-.B PROPERTIES\fR = \fI[interactive]
+.B PROPERTIES\fR = \fI[interactive,live]
 A space delimited list of properties, with conditional syntax support.
 .PD 0
 .RS
 .TP
 .I interactive
 One or more ebuild phases will produce a prompt that requires user interaction.
+.TP
+.I live
+The package uses live source code that may vary each time that the package
+is installed.
 .RE
 .PD 1
 .TP
-- 
2.22.0


signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH] Drop removed git and tla from list of live eclasses.

2019-07-26 Thread Ulrich Müller
Signed-off-by: Ulrich Müller 
---
 cnf/sets/portage.conf | 2 +-
 lib/portage/const.py  | 4 +---
 2 files changed, 2 insertions(+), 4 deletions(-)

diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf
index ed4c6d9a7..38c50a647 100644
--- a/cnf/sets/portage.conf
+++ b/cnf/sets/portage.conf
@@ -65,7 +65,7 @@ includes = live
 [deprecated-live-rebuild]
 class = portage.sets.dbapi.VariableSet
 variable = INHERITED
-includes = bzr cvs darcs git git-2 git-r3 golang-vcs mercurial subversion tla
+includes = bzr cvs darcs git-2 git-r3 golang-vcs mercurial subversion
 
 # Installed packages that own files inside /lib/modules.
 [module-rebuild]
diff --git a/lib/portage/const.py b/lib/portage/const.py
index edbfb9f17..0ed64a742 100644
--- a/lib/portage/const.py
+++ b/lib/portage/const.py
@@ -1,5 +1,5 @@
 # portage: Constants
-# Copyright 1998-2018 Gentoo Authors
+# Copyright 1998-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import unicode_literals
@@ -240,13 +240,11 @@ LIVE_ECLASSES = frozenset([
"bzr",
"cvs",
"darcs",
-   "git",
"git-2",
"git-r3",
"golang-vcs",
"mercurial",
"subversion",
-   "tla",
 ])
 
 SUPPORTED_BINPKG_FORMATS = ("tar", "rpm")
-- 
2.22.0


signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH] Support PROPERTIES="live".

2019-07-26 Thread Ulrich Müller
Bug: https://bugs.gentoo.org/233589
Signed-off-by: Ulrich Müller 
---
 cnf/sets/portage.conf |  8 +++-
 lib/_emerge/EbuildExecuter.py |  4 ++--
 lib/portage/_sets/__init__.py | 12 +---
 repoman/lib/repoman/modules/scan/ebuild/ebuild.py |  3 +--
 4 files changed, 19 insertions(+), 8 deletions(-)

diff --git a/cnf/sets/portage.conf b/cnf/sets/portage.conf
index ac282d911..ed4c6d9a7 100644
--- a/cnf/sets/portage.conf
+++ b/cnf/sets/portage.conf
@@ -55,9 +55,15 @@ world-candidate = True
 [preserved-rebuild]
 class = portage.sets.libs.PreservedLibraryConsumerSet
 
-# Installed ebuilds that inherit from known live eclasses.
+# Installed ebuilds with "live" property.
 [live-rebuild]
 class = portage.sets.dbapi.VariableSet
+variable = PROPERTIES
+includes = live
+
+# Installed ebuilds that inherit from known live eclasses.
+[deprecated-live-rebuild]
+class = portage.sets.dbapi.VariableSet
 variable = INHERITED
 includes = bzr cvs darcs git git-2 git-r3 golang-vcs mercurial subversion tla
 
diff --git a/lib/_emerge/EbuildExecuter.py b/lib/_emerge/EbuildExecuter.py
index d387b42be..ca9859437 100644
--- a/lib/_emerge/EbuildExecuter.py
+++ b/lib/_emerge/EbuildExecuter.py
@@ -1,4 +1,4 @@
-# Copyright 1999-2018 Gentoo Foundation
+# Copyright 1999-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.EbuildPhase import EbuildPhase
@@ -49,7 +49,7 @@ class EbuildExecuter(CompositeTask):
phase="unpack", scheduler=self.scheduler,
settings=self.settings)
 
-   if self._live_eclasses.intersection(self.pkg.inherited):
+   if "live" in self.settings.get("PROPERTIES", "").split():
# Serialize $DISTDIR access for live ebuilds since
# otherwise they can interfere with eachother.
 
diff --git a/lib/portage/_sets/__init__.py b/lib/portage/_sets/__init__.py
index 2c9bf9715..7b81c55e2 100644
--- a/lib/portage/_sets/__init__.py
+++ b/lib/portage/_sets/__init__.py
@@ -1,4 +1,4 @@
-# Copyright 2007-2014 Gentoo Foundation
+# Copyright 2007-2019 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 from __future__ import print_function
@@ -121,8 +121,14 @@ class SetConfig(object):
parser.remove_section("live-rebuild")
parser.add_section("live-rebuild")
parser.set("live-rebuild", "class", 
"portage.sets.dbapi.VariableSet")
-   parser.set("live-rebuild", "variable", "INHERITED")
-   parser.set("live-rebuild", "includes", " 
".join(sorted(portage.const.LIVE_ECLASSES)))
+   parser.set("live-rebuild", "variable", "PROPERTIES")
+   parser.set("live-rebuild", "includes", "live")
+
+   parser.remove_section("deprecated-live-rebuild")
+   parser.add_section("deprecated-live-rebuild")
+   parser.set("deprecated-live-rebuild", "class", 
"portage.sets.dbapi.VariableSet")
+   parser.set("deprecated-live-rebuild", "variable", "INHERITED")
+   parser.set("deprecated-live-rebuild", "includes", " 
".join(sorted(portage.const.LIVE_ECLASSES)))
 
parser.remove_section("module-rebuild")
parser.add_section("module-rebuild")
diff --git a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py 
b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py
index d2715bc6e..70011e387 100644
--- a/repoman/lib/repoman/modules/scan/ebuild/ebuild.py
+++ b/repoman/lib/repoman/modules/scan/ebuild/ebuild.py
@@ -12,7 +12,6 @@ from repoman.modules.scan.scanbase import ScanBase
 # import our initialized portage instance
 from repoman._portage import portage
 from portage import os
-from portage.const import LIVE_ECLASSES
 from portage.exception import InvalidPackageName
 
 pv_toolong_re = re.compile(r'[0-9]{19,}')
@@ -110,7 +109,7 @@ class Ebuild(ScanBase):
self.metadata = self.pkg._metadata
self.eapi = self.metadata["EAPI"]
self.inherited = self.pkg.inherited
-   self.live_ebuild = LIVE_ECLASSES.intersection(self.inherited)
+   self.live_ebuild = "live" in self.metadata["PROPERTIES"].split()
self.keywords = self.metadata["KEYWORDS"].split()
self.archs = set(kw.lstrip("~") for kw in self.keywords if not 
kw.startswith("-"))
return False
-- 
2.22.0


signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH] __dyn_test: Make fallback to WORKDIR conditional.

2019-03-09 Thread Ulrich Müller
When the fallback from S to WORKDIR was made conditional in EAPI 4,
src_test() was originally omitted. This has been fixed retroactively
in PMS:
https://gitweb.gentoo.org/proj/pms.git/commit/?id=0038f90a942f0856ae2533b26f709002a3ec80ae

There should be no issues with backwards compatibility of existing
ebuilds. The feature is not used in the Gentoo repository. Plus, the
scenario is very unlikely, because in src_test the fallback to WORKDIR
could only happen for an ebuild that:
- Has no files in A to be unpacked.
- Doesn't define any of the unpack, prepare, configure, compile or
  install phases (otherwise it would die in one of these phases).

Signed-off-by: Ulrich Müller 
---
 bin/phase-functions.sh | 8 ++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/bin/phase-functions.sh b/bin/phase-functions.sh
index d8ebf3d3e..4c6420bfa 100644
--- a/bin/phase-functions.sh
+++ b/bin/phase-functions.sh
@@ -358,7 +358,7 @@ __abort_install() {
 
 __has_phase_defined_up_to() {
local phase
-   for phase in unpack prepare configure compile install; do
+   for phase in unpack prepare configure compile test install; do
has ${phase} ${DEFINED_PHASES} && return 0
[[ ${phase} == $1 ]] && return 1
done
@@ -497,8 +497,12 @@ __dyn_test() {
 
if [ -d "${S}" ]; then
cd "${S}"
-   else
+   elif ___eapi_has_S_WORKDIR_fallback; then
+   cd "${WORKDIR}"
+   elif [[ -z ${A} ]] && ! __has_phase_defined_up_to test; then
cd "${WORKDIR}"
+   else
+   die "The source directory '${S}' doesn't exist"
fi
 
if has test ${RESTRICT} ; then
-- 
2.20.1


signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH] isolated-functions.sh: Do not define any aliases.

2018-11-05 Thread Ulrich Müller
save_IFS and restore_IFS are the only aliases that Portage defines,
and they are used exactly once. Rewrite __source_all_bashrcs() not to
depend on them, and remove their definitions.

The intention is to drop the expand_aliases shell option at some time
in the future.

Signed-off-by: Ulrich Müller 
---
 bin/ebuild.sh | 8 ++--
 bin/isolated-functions.sh | 2 --
 2 files changed, 2 insertions(+), 8 deletions(-)

diff --git a/bin/ebuild.sh b/bin/ebuild.sh
index 5491c4f58..00524d019 100755
--- a/bin/ebuild.sh
+++ b/bin/ebuild.sh
@@ -421,13 +421,9 @@ __source_all_bashrcs() {
 
if [[ $EBUILD_PHASE != depend ]] ; then
# source the existing profile.bashrcs.
-   save_IFS
-   IFS=$'\n'
-   local bashenv_files=($PORTAGE_BASHRC_FILES)
-   restore_IFS
-   for x in "${bashenv_files[@]}" ; do
+   while read -r x; do
__try_source "${x}"
-   done
+   done <<<"${PORTAGE_BASHRC_FILES}"
fi
 
# The user's bashrc is the ONLY non-portage bit of code
diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 39b0ad344..22a6dbb0f 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -11,8 +11,6 @@ fi
 # We need this next line for "die" and "assert". It expands
 # It _must_ preceed all the calls to die and assert.
 shopt -s expand_aliases
-alias save_IFS='[ "${IFS:-unset}" != "unset" ] && old_IFS="${IFS}"'
-alias restore_IFS='if [ "${old_IFS:-unset}" != "unset" ]; then 
IFS="${old_IFS}"; unset old_IFS; else unset IFS; fi'
 
 assert() {
local x pipestatus=${PIPESTATUS[*]}
-- 
2.19.1



signature.asc
Description: PGP signature


[gentoo-portage-dev] [PATCH] man/ebuild.5: Do not document internal functions.

2017-10-24 Thread Ulrich Müller
Functions containing "hook" or "prep" in their name may not be used
or relied upon by ebuilds. Therefore they should not be documented
in ebuild(5) which describes the funtions available for ebuilds.

PMS reference: https://projects.gentoo.org/pms/6/pms.html#x1-14700011.3.3.16
---
 man/ebuild.5 | 76 +---
 1 file changed, 1 insertion(+), 75 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 43d12765d..42a0599fe 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -1,4 +1,4 @@
-.TH "EBUILD" "5" "Nov 2014" "Portage VERSION" "Portage"
+.TH "EBUILD" "5" "Oct 2017" "Portage VERSION" "Portage"
 
 .SH "NAME"
 ebuild \- the internal format, variables, and functions in an ebuild script
@@ -1104,16 +1104,6 @@ Example:
installed)
 .fi
 
-.SS "Hooks:"
-.TP
-.B register_die_hook\fR \fI[list of function names]
-Register one or more functions to call when the ebuild fails for any reason,
-including file collisions with other packages.
-.TP
-.B register_success_hook\fR \fI[list of function names]
-Register one or more functions to call when the ebuild builds and/or installs
-successfully.
-
 .SS "Output:"
 .TP
 .B einfo\fR \fI"disposable message"
@@ -1225,70 +1215,6 @@ Please do \fBnot\fR use this in place of 'emake install 
DESTDIR=${D}'.
 That is the preferred way of installing make\-based packages.  Also, do
 not utilize the \fIEXTRA_EINSTALL\fR variable since it is for users.
 
-.PD 0
-.TP
-.B prepall
-.TP
-.B prepalldocs
-.TP
-.B prepallinfo
-.TP
-.B prepallman
-.TP
-.B prepallstrip
-.PD 1
-Useful for when a package installs into \fB${D}\fR via scripts
-(i.e. makefiles).  If you want to be sure that libraries are executable,
-aclocal files are installed into the right place, doc/info/man files are
-all compressed, and that executables are all stripped of debugging symbols,
-then use these suite of functions.
-.RS
-.PD 0
-.TP
-.B prepall:
-Runs \fBprepallman\fR, \fBprepallinfo\fR, \fBprepallstrip\fR, sets
-libraries +x, and then checks aclocal directories.  Please note this
-does \fI*not*\fR run \fBprepalldocs\fR.
-.TP
-.B prepalldocs:
-Compresses all doc files in ${ED}/usr/share/doc.
-.TP
-.B prepallinfo:
-Compresses all info files in ${ED}/usr/share/info.
-.TP
-.B prepallman:
-Compresses all man files in ${ED}/usr/share/man.
-.TP
-.B prepallstrip:
-Strips all executable files of debugging symboles.  This includes libraries.
-.RE
-
-.TP
-.B prepinfo\fR \fI[dir]
-.TP
-.B prepman\fR \fI[dir]
-.TP
-.B prepstrip\fR \fI[dir]
-.PD 1
-Similar to the \fBprepall\fR functions, these are subtle in their differences.
-.RS
-.PD 0
-.TP
-.B prepinfo:
-If a \fIdir\fR is not specified, then \fBprepinfo\fR will assume the dir
-\fIusr\fR. \fBprepinfo\fR will then compress all the files in
-${ED}/\fIdir\fR/info.
-.TP
-.B prepman:
-If a \fIdir\fR is not specified, then \fBprepman\fR will assume the dir
-\fIusr\fR. \fBprepman\fR will then compress all the files in
-${ED}/\fIdir\fR/man/*/.
-.TP
-.B prepstrip:
-All the files found in ${ED}/\fIdir\fR will be stripped.  You may specify
-multiple directories.
-.RE
-.PD 1
 .TP
 .B docompress\fR \fI[\-x]  [list of more paths]
 .RS
-- 
2.14.2


pgpZ4C6XO5BRX.pgp
Description: PGP signature


[gentoo-portage-dev] [PATCH] man: Update URI of GLEP references.

2017-10-14 Thread Ulrich Müller
GLEPs have been moved to https://www.gentoo.org/glep/.
---
 man/ebuild.5| 2 +-
 man/emerge.1| 2 +-
 man/make.conf.5 | 4 ++--
 man/portage.5   | 4 ++--
 4 files changed, 6 insertions(+), 6 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index e4c866cd2..43d12765d 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -730,7 +730,7 @@ allows for packages to depend on \fIvirtual/jdk\fR rather 
than on blackdown
 or sun specifically.
 
 The \fBPROVIDE\fR variable has been deprecated. See
-\fIhttps://wiki.gentoo.org/wiki/GLEP:37\fR for details.
+\fIhttps://www.gentoo.org/glep/glep-0037.html\fR for details.
 
 .TP
 .B DOCS
diff --git a/man/emerge.1 b/man/emerge.1
index 12a0db166..3198ba028 100644
--- a/man/emerge.1
+++ b/man/emerge.1
@@ -108,7 +108,7 @@ later updating.
 .BR \-\-check\-news
 Scan all repositories for relevant unread GLEP 42 news items, and display
 how many are found. See
-\fIhttps://wiki.gentoo.org/wiki/GLEP:42\fR.
+\fIhttps://www.gentoo.org/glep/glep-0042.html\fR.
 .TP
 .BR \-\-clean
 Cleans up the system by examining the installed packages and removing older
diff --git a/man/make.conf.5 b/man/make.conf.5
index 65c18cc6d..a81b497bd 100644
--- a/man/make.conf.5
+++ b/man/make.conf.5
@@ -62,7 +62,7 @@ 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
 for further information:
-\fIhttps://wiki.gentoo.org/wiki/GLEP:23\fR.
+\fIhttps://www.gentoo.org/glep/glep-0023.html\fR.
 .br
 Defaults to the value of * -@EULA.
 .br
@@ -503,7 +503,7 @@ configures new enough distcc to use the proxy.
 .TP
 .B news
 Enable GLEP 42 news support. See
-\fIhttps://wiki.gentoo.org/wiki/GLEP:42\fR.
+\fIhttps://www.gentoo.org/glep/glep-0042.html\fR.
 .TP
 .B noauto
 When utilizing \fBebuild\fR(1), only run the function requested. Also, forces
diff --git a/man/portage.5 b/man/portage.5
index 5b1dfa838..89dc8ce44 100644
--- a/man/portage.5
+++ b/man/portage.5
@@ -1408,7 +1408,7 @@ A list of all the variables which will be displayed when 
you run `emerge info`.
 This contains groups of licenses that may be specifed in the
 \fBACCEPT_LICENSE\fR variable (see \fBmake.conf\fR(5)). Refer
 to GLEP 23 for further information:
-\fIhttps://wiki.gentoo.org/wiki/GLEP:23\fR.
+\fIhttps://www.gentoo.org/glep/glep-0023.html\fR.
 
 .I Format:
 .nf
@@ -1542,7 +1542,7 @@ 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:
-\fIhttps://wiki.gentoo.org/wiki/GLEP:56\fR.
+\fIhttps://www.gentoo.org/glep/glep-0056.html\fR.
 
 .nf
 .I Format:
-- 
2.14.2


pgpATU0G0BryM.pgp
Description: PGP signature


[gentoo-portage-dev] [PATCH] dosym: Make implicit basename a fatal error.

2017-04-17 Thread Ulrich Müller
The respective QA warning in the dosym helper is in place since 2011.
All known violations in the gentoo repository have been fixed.

Gentoo-Bug: 379899
---
 bin/ebuild-helpers/dosym | 7 +++
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/bin/ebuild-helpers/dosym b/bin/ebuild-helpers/dosym
index 0bc8cc7be..b9c70ce9c 100755
--- a/bin/ebuild-helpers/dosym
+++ b/bin/ebuild-helpers/dosym
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2012 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}"/isolated-functions.sh || exit 1
@@ -13,10 +13,9 @@ if ! ___eapi_has_prefix_variables; then
ED=${D}
 fi
 
-if [[ ${2} == */ ]] || \
-   [[ -d ${ED}${2} && ! -L ${ED}${2} ]] ; then
+if [[ ${2} == */ ]] || [[ -d ${ED}${2} && ! -L ${ED}${2} ]] ; then
# implicit basename not allowed by PMS (bug #379899)
-   eqawarn "QA Notice: dosym target omits basename: '${2}'"
+   __helpers_die "${0##*/}: dosym target omits basename: '${2}'"
 fi
 
 destdir=${2%/*}
-- 
2.12.2


pgpTL2tc7Xb51.pgp
Description: PGP signature


[gentoo-portage-dev] [PATCH] phase-helpers.sh: Loop over A rather than SRC_URI in __eapi0_pkg_nofetch.

2017-03-23 Thread Ulrich Müller
Looping over SRC_URI also outputs non-filename elements (e.g, use
conditionals) which is avoided when looping over A.

Gentoo-Bug: 613132
---
 bin/phase-helpers.sh | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh
index 9e4e6a2f8..e1dcfd5e8 100644
--- a/bin/phase-helpers.sh
+++ b/bin/phase-helpers.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2013 Gentoo Foundation
+# Copyright 1999-2017 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 export DESTTREE=/usr
@@ -726,11 +726,11 @@ einstall() {
 }
 
 __eapi0_pkg_nofetch() {
-   [ -z "${SRC_URI}" ] && return
+   [[ -z ${A} ]] && return
 
-   elog "The following are listed in SRC_URI for ${PN}:"
+   elog "The following files cannot be fetched for ${PN}:"
local x
-   for x in $(echo ${SRC_URI}); do
+   for x in ${A}; do
elog "   ${x}"
done
 }
-- 
2.12.1


pgp529zGwiQ94.pgp
Description: PGP signature


[gentoo-portage-dev] [PATCH] isolated-functions.sh: Output error message for nofatal die.

2016-01-27 Thread Ulrich Müller

X-Gentoo-Bug: 573056
---
 bin/isolated-functions.sh | 11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh
index 5766921..e320f71 100644
--- a/bin/isolated-functions.sh
+++ b/bin/isolated-functions.sh
@@ -1,5 +1,5 @@
 #!/bin/bash
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2016 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 source "${PORTAGE_BIN_PATH}/eapi.sh" || exit 1
@@ -124,10 +124,11 @@ die() {
set +x # tracing only produces useless noise here
local IFS=$' \t\n'
 
-   if ___eapi_die_can_respect_nonfatal; then
-   if [[ ${1} == -n ]]; then
-   [[ ${PORTAGE_NONFATAL} == 1 ]] && return 1
-   shift
+   if ___eapi_die_can_respect_nonfatal && [[ $1 == -n ]]; then
+   shift
+   if [[ ${PORTAGE_NONFATAL} == 1 ]]; then
+   [[ $# -gt 0 ]] && eerror "$*"
+   return 1
fi
fi
 
-- 
2.7.0




[gentoo-portage-dev] [PATCH] repoman: Do not check for PATCHES array in EAPI 6 and later.

2015-12-20 Thread Ulrich Müller
EAPI 6 explicitly added support for non-array PATCHES in its
default_src_prepare, therefore remove this warning.

X-Gentoo-Bug: 568054
---
 pym/repoman/checks/ebuilds/checks.py | 4 
 1 file changed, 4 insertions(+)

diff --git a/pym/repoman/checks/ebuilds/checks.py 
b/pym/repoman/checks/ebuilds/checks.py
index e23fcfe..6d562de 100644
--- a/pym/repoman/checks/ebuilds/checks.py
+++ b/pym/repoman/checks/ebuilds/checks.py
@@ -337,6 +337,10 @@ class EbuildPatches(LineCheck):
re = re.compile(r'^\s*PATCHES=[^\(]')
error = errors.PATCHES_ERROR
 
+   def check_eapi(self, eapi):
+   return eapi in ("0", "1", "2", "3", "4", "4-python",
+   "4-slot-abi", "5", "5-hdepend", "5-progress")
+
 
 class EbuildQuotedA(LineCheck):
"""Ensure ebuilds have no quoting around ${A}"""
-- 
2.6.4




[gentoo-portage-dev] [PATCH] man/ebuild.5: Update description of =* operator.

2015-09-22 Thread Ulrich Müller
After commit d4966a381ee4577818bd972946647338046715b1
"match_from_list: restrict =* to match only on version part
boundaries" the description of the =* operator in ebuild(5) was
no longer accurate.

This reverts commit 2b1eceaf79ac667eecdf1ef9585592a235c8d93f.
---
 man/ebuild.5 | 9 +++--
 1 file changed, 3 insertions(+), 6 deletions(-)

diff --git a/man/ebuild.5 b/man/ebuild.5
index 6a27cc5..e60eee1 100644
--- a/man/ebuild.5
+++ b/man/ebuild.5
@@ -96,12 +96,9 @@ Example:
 .fi
 .TP
 .I *
-means match any version of the package so long
-as the specified string prefix is matched. So with a
-version of '2*', we can match '2.1', '2.2', '2.2.1',
-etc... and not match version '1.0', '3.0', '4.1', etc...
-Beware that, due to the string matching nature, '20'
-will also be matched by '2*'. The version part
+means match any version of the package so long as the specified base
+is matched.  So with a version of '2*', we can match '2.1', '2.2', '2.2.1',
+etc... and not match version '1.0', '3.0', '4.1', etc... The version part
 that comes before the '*' must be a valid version in the absence of the '*'.
 For example, '2' is a valid version and '2.' is not. Therefore, '2*' is
 allowed and '2.*' is not.
-- 
2.5.3




[gentoo-portage-dev] [PATCH] Use consistent rules for filenames of ebuils and misc files.

2015-05-05 Thread Ulrich Müller
So far non-ebuild filenames were allowed to contain a colon character.
This is a problematic character as it is illegal in MS-Windows (and
there is a Prefix x86-interix profile) and has special meaning as
remote host indicator in scp and other programs.

This limits the allowed characters in filenames to [A-Za-z0-9._+-]
which is the same as IEEE Std 1003.1-2013, section 3.278, with the
addition of the plus character. See also bug 411127.
---
 bin/repoman  | 4 ++--
 pym/portage/repository/config.py | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/bin/repoman b/bin/repoman
index e9c89c2..37e11b2 100755
--- a/bin/repoman
+++ b/bin/repoman
@@ -1,5 +1,5 @@
 #!/usr/bin/python -bO
-# Copyright 1999-2014 Gentoo Foundation
+# Copyright 1999-2015 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 # Next to do: dep syntax checking in mask files
@@ -88,7 +88,7 @@ util.initialize_logger()
 
 # 14 is the length of DESCRIPTION=
 max_desc_len = 100
-allowed_filename_chars=a-zA-Z0-9._-+:
+allowed_filename_chars=a-zA-Z0-9._+-
 pv_toolong_re = re.compile(r'[0-9]{19,}')
 GPG_KEY_ID_REGEX = 
r'(0x)?([0-9a-fA-F]{8}|[0-9a-fA-F]{16}|[0-9a-fA-F]{24}|[0-9a-fA-F]{32}|[0-9a-fA-F]{40})!?'
 bad = create_color_func(BAD)
diff --git a/pym/portage/repository/config.py b/pym/portage/repository/config.py
index 5da1810..e44b619 100644
--- a/pym/portage/repository/config.py
+++ b/pym/portage/repository/config.py
@@ -38,7 +38,7 @@ if sys.hexversion = 0x300:
basestring = str
 
 # Characters prohibited by repoman's file.name check.
-_invalid_path_char_re = re.compile(r'[^a-zA-Z0-9._\-+:/]')
+_invalid_path_char_re = re.compile(r'[^a-zA-Z0-9._\-+/]')
 
 _valid_profile_formats = frozenset(
['pms', 'portage-1', 'portage-2', 'profile-bashrcs', 'profile-set',
-- 
2.4.0




[gentoo-portage-dev] [PATCH] bin/eapi.sh: Invert condition in ___eapi_unpack_supports_absolute_paths().

2015-02-16 Thread Ulrich Müller
This should return true starting with EAPI 6, and false for EAPI 5 and earlier.
---
 bin/eapi.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/bin/eapi.sh b/bin/eapi.sh
index f1c677e..528e6f2 100644
--- a/bin/eapi.sh
+++ b/bin/eapi.sh
@@ -175,7 +175,7 @@ ___eapi_unpack_is_case_sensitive() {
 }
 
 ___eapi_unpack_supports_absolute_paths() {
-   [[ ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
+   [[ ! ${1-${EAPI-0}} =~ ^(0|1|2|3|4|4-python|4-slot-abi|5|5-hdepend)$ ]]
 }
 
 ___eapi_die_can_respect_nonfatal() {
-- 
2.3.0