aboutsummaryrefslogtreecommitdiff
path: root/bin
Commit message (Collapse)AuthorAgeFilesLines
* Use cached portage.getpid() function (bug 739540)Zac Medico2020-08-301-1/+1
| | | | | | | | | Use the cached portage.getpid() function to avoid unnecessary syscalls, and update the cache after each call to os.fork() where the fork may invoke portage APIs. Bug: https://bugs.gentoo.org/739540 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* *: drop all import __future__ statementsAaron Bauman2020-08-0616-45/+15
| | | | | | | * We only support Py3 now. Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* bin/doins.py: drop unused-importAaron Bauman2020-08-031-3/+1
| | | | | | | | * Drop unused-import * Update copyright Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Fix R0205 across all of repo.Aaron Bauman2020-07-316-13/+13
| | | | | | | | | Do not need to inherit object in py3. All tests passed. Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Remove py<3.4 import compatibilityMichał Górny2020-07-181-4/+1
| | | | | | Closes: https://github.com/gentoo/portage/pull/577 Reviewed-by: Zac Medico <zmedico@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* Remove support code for Python < 3.3Michał Górny2020-07-172-19/+3
| | | | Signed-off-by: Michał Górny <mgorny@gentoo.org>
* Eliminate the most of explicit py3 conditionalsMichał Górny2020-07-169-96/+45
| | | | | | | | | Eliminate the most of py2/py3 conditions in the code. Leave a few where the relevant code is unclear, they will be addressed later. Reviewed-by: Zac Medico <zmedico@gentoo.org> Closes: https://github.com/gentoo/portage/pull/574 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* Eliminate basestring/long/_unicode py3 compatMichał Górny2020-07-161-5/+2
| | | | | | | | Replace basestring and _unicode hacks with str, and long with int. Reviewed-by: Zac Medico <zmedico@gentoo.org> Closes: https://github.com/gentoo/portage/pull/570 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* Remove from __future__ import unicode_literalsZac Medico2020-07-155-5/+5
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* quickpkg: split tokens in BINPKG_COMPRESS_FLAGSZac Medico2020-07-121-1/+1
| | | | Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ecompress: optimize docompress -x precompressed comparisonZac Medico2020-07-021-13/+14
| | | | | | | | | | | Use sort and comm with temporary files in order to compare lists of docompress -x and precompressed files, since the file lists can be extremely large. Also strip ${D%/} from paths in order to reduce length. Bug: https://bugs.gentoo.org/721516 Suggested-by: Robin H. Johnson <robbat2@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ecompress: fix precompressed false positive for docompress -x <directory>Zac Medico2020-06-241-1/+1
| | | | | | | | Use ${REPLY%.ecompress} to correctly strip the .ecompress suffix. Fixes: 5508bf7a6db5 ("ecompress: ignore docompress -x files in precompressed QA check (bug 721516)") Bug: https://bugs.gentoo.org/721516 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ecompress: fix "Argument list too long" for sed (bug 727522)Patrick McLean2020-06-231-2/+3
| | | | | | | | | Use sed -f to feed commands to sed via stdin, in order to avoid the "Argument list too long" error reported in bug 727522. Fixes: 5508bf7a6db5 ("ecompress: ignore docompress -x files in precompressed QA check (bug 721516)") Bug: https://bugs.gentoo.org/727522 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ecompress: prefix eqawarn messages with QA Notice (bug 728046)Zac Medico2020-06-141-5/+5
| | | | | | Reported-by: Agostino Sarubbo <ago@gentoo.org> Bug: https://bugs.gentoo.org/728046 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* ecompress: ignore docompress -x files in precompressed QA check (bug 721516)Zac Medico2020-05-241-2/+14
| | | | | | | | Ignore files passed to docompress -x in the QA check for precompressed files. Bug: https://bugs.gentoo.org/721516 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* NeededEntry: don't use scanelf -q (bug 721336)Zac Medico2020-05-241-1/+5
| | | | | | | | | | | We don't use scanelf -q, since that would omit libraries like musl's /usr/lib/libc.so which do not have any DT_NEEDED or DT_SONAME settings. Since we don't use scanelf -q, we have to handle the special rpath value " - ". Bug: https://bugs.gentoo.org/721336 Fixes: 25fbe7bc1a92 ("NeededEntry: infer implicit soname from file basename (bug 715162)") Signed-off-by: Zac Medico <zmedico@gentoo.org>
* phase-functions.sh: do not set PKG_CONFIG_PATHMike Gilbert2020-05-031-4/+0
| | | | | | | | Recent pkg-config should have the correct path built in by default. Bug: https://bugs.gentoo.org/720866 Signed-off-by: Mike Gilbert <floppym@gentoo.org> Reviewed-by: Zac Medico <zmedico@gentoo.org>
* NeededEntry: infer implicit soname from file basename (bug 715162)Zac Medico2020-04-071-0/+6
| | | | | | | | | | For dynamic libraries, infer an implicit DT_SONAME setting from the file basename, which is consistent with dynamic linking behavior in practice. This makes it possible to resolve soname dependencies for musl's libc.so which lacks a DT_SONAME setting. Bug: https://bugs.gentoo.org/715162 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* eqawarn: output to build log regardless of --quiet (bug 713818)Zac Medico2020-03-211-2/+2
| | | | | | | | | | | Make eqwarn output to the build log regardless of --quiet, via echo to stderr instead of __vecho. This __vecho usage was originally introduced in commit c53f52941c88, which was during the time when build output went to the tty regardless of --quiet mode (that changed in commit 0398470e5029). Bug: https://bugs.gentoo.org/713818 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* bin/socks5-server.py: PEP 492 coroutines with async and await syntaxZac Medico2020-03-011-19/+17
| | | | | https://bugs.gentoo.org/709334 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* einstalldocs: Fix test for DOCS being unset.Ulrich Müller2020-02-201-2/+2
| | | | | | | | | | | | | | | | | | | 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 <ulm@gentoo.org>
* phase-helpers.sh: avoid passing an empty root value to portageqMike Gilbert2020-02-081-3/+3
| | | | | | Bug: https://bugs.gentoo.org/708660 Signed-off-by: Mike Gilbert <floppym@gentoo.org> Reviewed-by: Zac Medico <zmedico@gentoo.org>
* dosym: revert deprecated prefix compat (bug 615594)Zac Medico2020-01-221-11/+2
| | | | | | | | According to PMS, dosym callers need to explicitly prefix the first argument with ${EPREFIX} if that's desired. https://bugs.gentoo.org/615594 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge-webrsync: chmod 755 temp dir (bug 704256)Zac Medico2019-12-301-0/+1
| | | | | | | | | Before the rsync call, chmod 755 the temporary directory so that the root directory of the repository will have appropriate permissions. Fixes: 92f4b283c86a ("emerge-webrsync: handle gentoo-YYYYMMDD directory name") Bug: https://bugs.gentoo.org/704256 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* eapply: Drop QA warning for fuzz factor.Ulrich Müller2019-12-261-2/+0
| | | | | | | | This didn't add any information beyond what is already present in the output of patch. Developers will know how to interpret its output, and users won't see the warning anyway with the standard configuration. Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* Clean up remnants of eapi5-hdepend, HDEPEND and targetrootMichał Górny2019-12-263-44/+29
| | | | | | Reviewed-by: Zac Medico <zmedico@gentoo.org> Closes: https://github.com/gentoo/portage/pull/490 Signed-off-by: Michał Górny <mgorny@gentoo.org>
* emerge-webrsync: support gentoo-YYYYMMDD snapshotsZac Medico2019-12-151-5/+7
| | | | | | | | Support gentoo-YYYYMMDD snapshots for forward compatibility, and portage-YYYYMMDD snapshots for backward compatibility. Bug: https://bugs.gentoo.org/693454 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge-webrsync: enable xz snapshots for tarsyncZac Medico2019-12-141-5/+1
| | | | | | | There's xz support in current versions of diffball. Bug: https://bugs.gentoo.org/702970 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge-webrsync: handle gentoo-YYYYMMDD directory nameZac Medico2019-12-091-8/+4
| | | | | Bug: https://bugs.gentoo.org/693454 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* emerge: drop FEATURES=distcc-pump support, bug #702146Sergei Trofimovich2019-12-081-17/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 'distcc' distributes code generation for preprocessed files. 'pump' distributes preprocessing and code generation of files and imposes very strict requirement: """ Note that distcc's pump-mode assumes that sources files will not be modified during the lifetime of the include server, so modifying source files during a build may cause inconsistent results. """ `src_configure()` (where we used to start include server before this change) almost always violates that requirement. It is not uncommon to generate more intermediate source files as a package builds (`bison`, `flex`, child `./configure` calls from `make`) and thus quite unsafe to use `pump`. This change drops `FEATURES=distcc-pump` and leaves only FEATURES=distcc. This way all the proprocessing happens as expected and only code generation is offloaded. Bug: https://bugs.gentoo.org/702146 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* eapply: Output verbosely only if patch fails to apply with -F0Michał Górny2019-11-271-2/+14
| | | | | | | | | | | | | | | | | | 12d0c48ad disabled silent output for eapply, in order to obtain fuzz factors in build logs. However, this also causes eapply to report all patched files which can make logs unreadable when there are no fuzz factors to be reported. Instead, use verbose output only when applying the patch with -F0 fails. To achieve that, attempt to apply each patch with -F0 --dry-run first. If this succeeds, just silently apply the patch for real. If it doesn't, output an explicit eqawarn that the patch does not apply cleanly and retry with the default fuzz factor and verbose output. Non-silenced output applies both to successful application with fuzz and to failure. Reviewed-by: Zac Medico <zmedico@gentoo.org> Signed-off-by: Michał Górny <mgorny@gentoo.org>
* eapply: Drop -s option for patch.Ulrich Müller2019-11-251-2/+1
| | | | | | | | | | | | | 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 <ulm@gentoo.org>
* dblink: add quickpkg methodZac Medico2019-11-171-30/+4
| | | | | Bug: https://bugs.gentoo.org/699986 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* helper-functions.sh: __multijob_init: handle errorsZac Medico2019-11-172-5/+7
| | | | | | | Also add mkfifo to ResolverPlayground essential_binaries, since it's required by __multijob_init. Signed-off-by: Zac Medico <zmedico@gentoo.org>
* install.py: ignore -Z / --contextMike Gilbert2019-11-081-10/+14
| | | | | | | | | | | | | | The --context option accepts an optional argument, but only if it is passed via --context=arg. The argparse module does not deal with this properly. To work around this, have argparse ignore this option, and filter out any remaining arguments that start with a hyphen and do not occur after a "--" delimiter. Bug: https://bugs.gentoo.org/699548 Signed-off-by: Mike Gilbert <floppym@gentoo.org> Reviewed-by: Zec Medico <zmedico@gentoo.org>
* Revert "install-qa-check.d: remove check that bans libtool files and static ↵Zac Medico2019-11-031-0/+10
| | | | | | | | | | | libs from /" This reverts commit 498900e5e51460502d8271f409a4c614a021613b. This change is still being discussed. See: https://archives.gentoo.org/gentoo-portage-dev/message/6e4cfbb0ef9c36dc6511d4f2003cc458 Bug: https://bugs.gentoo.org/699252 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* Revert "install-qa-check.d: handle libtool files and static libs from /"Zac Medico2019-11-031-2/+2
| | | | | | This reverts commit a2506e4ebd47781eb81b7d13b0a1a376ed028c77. Signed-off-by: Zac Medico <zmedico@gentoo.org>
* install-qa-check.d: handle libtool files and static libs from /Zac Medico2019-11-031-2/+2
| | | | | | Fixes: 498900e5e514 ("install-qa-check.d: remove check that bans libtool files and static libs from /") Bug: https://bugs.gentoo.org/699252 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* install-qa-check.d: remove check that bans libtool files and static libs from /William Hubbs2019-11-031-10/+0
| | | | | | | | | Most upstreams and build systems do not make this distinction, so this causes unnecessary hacks in ebuilds. Bug: https://bugs.gentoo.org/699252 Signed-off-by: William Hubbs <williamh@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* asyncio.start_unix_server: suppress DeprecationWarning for loop argumentZac Medico2019-10-171-1/+1
| | | | | See: https://bugs.python.org/issue36373 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* doins: Fix directory install options when called as dodoc.Ulrich Müller2019-10-031-1/+2
| | | | | | | | | | | | 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. Acked-by: Zac Medico <zmedico@gentoo.org> Signed-off-by: Ulrich Müller <ulm@gentoo.org>
* __ebuild_main: Rename phase_func variable to ___phase_func.Arfrever Frehtes Taifersar Arahesis2019-09-141-3/+2
| | | | | | | | | ___* variables are now automatically filtered by __filter_readonly_variables(). `unset` does not actually remove local variables, it only removes their values. Previously phase_func variable was stored (without value) in environment.bz2 files in VDB. Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* __filter_readonly_variables: Filter ___* variables.Arfrever Frehtes Taifersar Arahesis2019-09-141-1/+1
| | | | | Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* pid-ns-init: Fix typo in comment.Arfrever Frehtes Taifersar Arahesis2019-09-141-1/+1
| | | | | Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* _eapply_patch: Delete no longer used variable.Arfrever Frehtes Taifersar Arahesis2019-09-141-1/+0
| | | | | | Fixes: e3386ff407d0e6df8e3bdc15ed42f9373b88cddb Signed-off-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* glsa-check: add --reverse option (bug 235970)Zac Medico2019-09-011-2/+3
| | | | | | | | | Add --reverse option which causes GLSAs to be listed in reverse order, so that the most recent GLSAs are listed earlier. Suggested-by: Pavel Sanda <ps@twin.jikos.cz> Bug: https://bugs.gentoo.org/235970 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* glsa-check: fix truncated CVE ids in listmode (bug 692134)Zac Medico2019-09-011-2/+9
| | | | | | | | | | Use a regular expression to search for CVE ids in GLSA references. Import unicode_literals from __future__ since portage's Glsa class returns unicode strings for all python versions. Reported-by: Georg Weiss <gentoo@georgweiss.de> Bug: https://bugs.gentoo.org/692134 Signed-off-by: Zac Medico <zmedico@gentoo.org>
* glsa-check: add exit code for affected GLSAsAaron Bauman2019-08-301-0/+1
| | | | | | | | Bug: https://bugs.gentoo.org/587930 Reported-by: Bandie Yip Kojote <bandie@ttygap.net> Signed-off-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* glsa-check: Remove 'new' target from glsa-listZac Medico2019-08-301-5/+6
| | | | | | | | | | | | | | | | | | | | | | | This patch is a forward port of the following commit: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=8190a7299a618e0ce120fe1c894b944075576342 commit 8190a7299a618e0ce120fe1c894b944075576342 Author: rbu <rbu@gentoo.org> AuthorDate: 2009-08-18 18:25:59 +0000 Commit: rbu <rbu@gentoo.org> CommitDate: 2009-08-18 18:25:59 +0000 Remove 'new' target from glsa-list Everyone should use 'affected' or 'all' Update man page and changelog svn path=/trunk/gentoolkit/; revision=672 Bug: https://bugs.gentoo.org/693088 Acked-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>
* glsa-check: Make --pretend output nicerZac Medico2019-08-301-5/+15
| | | | | | | | | | | | | | | | | | | | This patch is a forward port of the following commit: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=72ba7b1274faf37451b1641ee51140f53f4b7098 commit 72ba7b1274faf37451b1641ee51140f53f4b7098 Author: rbu <rbu@gentoo.org> AuthorDate: 2009-08-18 17:47:20 +0000 Commit: rbu <rbu@gentoo.org> CommitDate: 2009-08-18 17:47:20 +0000 Make --pretend output in glsa-check nicer. Add colors and fix linebreaks. svn path=/trunk/gentoolkit/; revision=670 Bug: https://bugs.gentoo.org/693088 Acked-by: Aaron Bauman <bman@gentoo.org> Signed-off-by: Zac Medico <zmedico@gentoo.org>