Re: [gentoo-portage-dev] Normaliser function for distfiles

2022-05-17 Thread Michał Górny
you can do a `--fetchonly` with no extra packages necessary. The "normalizer" wouldn't be trivial either. In the end, we're talking about getting 100% consistent results on all platforms, over a reasonably long timeframe. -- Best regards, Michał Górny

Re: [gentoo-portage-dev] The build system (and install layout) of Portage

2022-03-17 Thread Michał Górny
On Thu, 2022-03-17 at 20:57 +, James Le Cuirot wrote: > On Thu, 2022-03-17 at 18:22 +0100, Michał Górny wrote: > > An alternative is to go back to using (at least partially) Makefiles or > > Meson. However, that would have the important drawback that we'd lose > > t

[gentoo-portage-dev] The build system (and install layout) of Portage

2022-03-17 Thread Michał Górny
.g. inside a virtualenv). At this point, I've pretty much lost all motivation to work on it. Nevertheless, it's something that needs to be done eventually. Does anyone have some idea, motivation and will to transition Portage to another build system? -- Best regards, Michał Górny

Re: [gentoo-portage-dev] [PATCH] portage.output: Replace darkblue colors with teal

2021-12-04 Thread Michał Górny
On Sat, 2021-12-04 at 10:15 +0100, Fabian Groffen wrote: > On 04-12-2021 10:13:09 +0100, Michał Górny wrote: > > On Sat, 2021-12-04 at 09:56 +0100, Fabian Groffen wrote: > > > Why don't you change your color.map instead of changing the default for > > > everyone?

Re: [gentoo-portage-dev] [PATCH] portage.output: Replace darkblue colors with teal

2021-12-04 Thread Michał Górny
On Sat, 2021-12-04 at 09:56 +0100, Fabian Groffen wrote: > Why don't you change your color.map instead of changing the default for > everyone? Why should we keep a stupid default? Should we optimize Gentoo for people who don't want to be able to read Portage's output? -- Best regards,

[gentoo-portage-dev] [PATCH] portage.output: Replace darkblue colors with teal

2021-12-03 Thread Michał Górny
The "darkblue" color is often barely visible on dark terminals which makes reading emerge output really hard (I basically have to copy-paste it a lot in order to be able to read it at all). Replace it with teal that does not seem to have any significant use in the output. Signed-off-

[gentoo-portage-dev] [PATCH] emerge: Do not resolve ambiguous package names via installed pkgs

2021-12-02 Thread Michał Górny
to install a missing package rather than rebuild or upgrade an individual package (though the latter can also happen). Rather than making assumptions that can go wrong, just display the ambiguity message as usual. Bug: https://bugs.gentoo.org/828059 Signed-off-by: Michał Górny --- lib/_emerge

Re: [gentoo-portage-dev] [RFC] LTS branch of Portage

2021-10-05 Thread Michał Górny
On Tue, 2021-10-05 at 13:16 -0400, Michael Orlitzky wrote: > On Tue, 2021-10-05 at 17:13 +0200, Michał Górny wrote: > > > > > 2. What happens to the LTS branch when the next EAPI is released? > > > > > > > I haven't really thought about it. Are you su

Re: [gentoo-portage-dev] [RFC] LTS branch of Portage

2021-10-05 Thread Michał Górny
On Tue, 2021-10-05 at 10:15 -0400, Michael Orlitzky wrote: > On Tue, 2021-10-05 at 10:31 +0200, Michał Górny wrote: > > Hi, everyone. > > > > I've been thinking about this for some time already, and the recent > > FILESDIR mess seems to confirm it: I'd like to start a

[gentoo-portage-dev] [RFC] LTS branch of Portage

2021-10-05 Thread Michał Górny
and only major bugfixes are backported there As things settle down in the future, master would become 3.2.x, 3.1.x would become LTS, 3.0.x will be discontinued and so on. WDYT? -- Best regards, Michał Górny

Re: [gentoo-portage-dev] [PATCH 0/4] Output rewrite for better clarify and greppability

2021-10-04 Thread Michał Górny
On Tue, 2021-09-28 at 16:20 +0200, Michał Górny wrote: > Hi, > > Ok, so it's more major than I originally intended but I think it's > a good direction (once you get used to it). Roughly: > I'm retracting this in favor of whatever gentoo-dev participants come up with. -- Best

Re: [gentoo-portage-dev] [PATCH 0/4] Output rewrite for better clarify and greppability

2021-09-28 Thread Michał Górny
On Tue, 2021-09-28 at 11:28 -0400, Mike Gilbert wrote: > On Tue, Sep 28, 2021 at 10:20 AM Michał Górny wrote: > > > > Hi, > > > > Ok, so it's more major than I originally intended but I think it's > > a good direction (once you get used to it). Roughly: > &

[gentoo-portage-dev] [PATCH 3/4] Use verbose prefixes for output messages

2021-09-28 Thread Michał Górny
]` for ewarn - `[QA]` for eqawarn - `[EE]` for eerror Signed-off-by: Michał Górny --- bin/isolated-functions.sh | 12 ++-- lib/portage/output.py | 12 ++-- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/bin/isolated-functions.sh b/bin/isolated-functions.sh index

[gentoo-portage-dev] [PATCH 2/4] Use distinct colors for output msg types

2021-09-28 Thread Michał Górny
Introduce distinct colors per output function. For elog and eerror the colors remain the same but the names change. For einfo and eqawarn, use darker colors to distinguish them. Signed-off-by: Michał Górny --- bin/isolated-functions.sh| 30 +++--- bin/save-ebuild-env.sh

[gentoo-portage-dev] [PATCH 1/4] Prefix color vars with "PORTAGE_COLOR_"

2021-09-28 Thread Michał Górny
it trivial to grep for all uses of color variables. Signed-off-by: Michał Górny --- bin/install-qa-check.d/10ignored-flags | 4 +-- bin/isolated-functions.sh | 42 +- bin/save-ebuild-env.sh | 16 +- lib/portage/output.py |

[gentoo-portage-dev] [PATCH 0/4] Output rewrite for better clarify and greppability

2021-09-28 Thread Michał Górny
cludes screenshot): https://github.com/gentoo/portage/pull/759 Michał Górny (4): Prefix color vars with "PORTAGE_COLOR_" Use distinct colors for output msg types Use verbose prefixes for output messages Use ">>>>" and "" for output prefixes bi

[gentoo-portage-dev] [PATCH v2] install-qa-check.d: Add a QA check for installing xattrs

2021-09-28 Thread Michał Górny
towards restoring PMS compliance and *not* preserving extended metadata. Signed-off-by: Michał Górny --- bin/install-qa-check.d/95xattr | 54 ++ 1 file changed, 54 insertions(+) create mode 100644 bin/install-qa-check.d/95xattr Changes in v2: - added a link

Re: [gentoo-portage-dev] [PATCH] install-qa-check.d: Add a QA check for installing xattrs

2021-09-28 Thread Michał Górny
On Mon, 2021-09-27 at 21:09 -0400, Mike Gilbert wrote: > On Mon, Sep 27, 2021 at 1:20 PM Michał Górny wrote: > > + eqawarn > > + eqawarn "It is impossible to reliably guarantee that the > > extended attributes" > > +

Re: [gentoo-portage-dev] [PATCH] install-qa-check.d: Add a QA check for installing xattrs

2021-09-28 Thread Michał Górny
On Mon, 2021-09-27 at 21:03 -0400, Mike Gilbert wrote: > On Mon, Sep 27, 2021 at 1:20 PM Michał Górny wrote: > > > > Warn the developers if ebuilds install files with xattrs to ${ED}. > > The xattrs may or may not be preserved when installing the package, > > making

[gentoo-portage-dev] [PATCH] install-qa-check.d: Add a QA check for installing xattrs

2021-09-27 Thread Michał Górny
towards restoring PMS compliance and *not* preserving extended metadata. Signed-off-by: Michał Górny --- bin/install-qa-check.d/95xattr | 54 ++ 1 file changed, 54 insertions(+) create mode 100644 bin/install-qa-check.d/95xattr diff --git a/bin/install-qa-check.d

Re: [gentoo-portage-dev] [PATCH v3] Copy files/* into the work tree instead of symlinking it

2021-09-27 Thread Michał Górny
On Mon, 2021-09-27 at 12:49 +0200, Ulrich Mueller wrote: > > > > > > On Sun, 26 Sep 2021, Michał Górny wrote: > > > Symlinking FILESDIR into the work tree has the unintended > > consequence > > of preserving all original file metadata, including system

[gentoo-portage-dev] [PATCH v3] Copy files/* into the work tree instead of symlinking it

2021-09-26 Thread Michał Górny
to DISTDIR. However, installing files from DISTDIR is rarer than from FILESDIR, so I guess we'll cross that bridge when we get to it. Bug: https://bugs.gentoo.org/814857 Signed-off-by: Michał Górny --- bin/phase-functions.sh| 2 +- .../package/ebuild/prepare_build_dirs.py

[gentoo-portage-dev] [PATCH v2] Copy files/* into the work tree instead of symlinking it

2021-09-26 Thread Michał Górny
to DISTDIR. However, installing files from DISTDIR is rarer than from FILESDIR, so I guess we'll cross that bridge when we get to it. Bug: https://bugs.gentoo.org/814857 Signed-off-by: Michał Górny --- bin/phase-functions.sh | 2 +- lib/portage/package/ebuild

[gentoo-portage-dev] [PATCH] Copy files/* into the work tree instead of symlinking it

2021-09-26 Thread Michał Górny
to DISTDIR. However, installing files from DISTDIR is rarer than from FILESDIR, so I guess we'll cross that bridge when we get to it. Bug: https://bugs.gentoo.org/814857 Signed-off-by: Michał Górny --- bin/phase-functions.sh | 2 +- lib/portage/package/ebuild

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

2021-09-03 Thread Michał Górny
@@ __eend() { > } > > eend() { > + [[ -n $1 ]] || eqawarn "QA Notice: eend called without return code" > local retval=${1:-0} > shift > I think the message could be a bit confusing. Maybe say explicitly that it's missing an argument. -- Best regards, Michał Górny

[gentoo-portage-dev] [PATCH 4/4] Include INHERIT value in generated cache

2021-09-03 Thread Michał Górny
PkgCore uses an additional md5-cache INHERIT key to indicate eclasses explicitly inherited in an ebuild. Update Portage to emit the same key to restore cache compatibility. Signed-off-by: Michał Górny --- bin/ebuild.sh | 8 +++- bin/phase

[gentoo-portage-dev] [PATCH 2/4] Switch internal metadata to key=value format

2021-09-03 Thread Michał Górny
Signed-off-by: Michał Górny --- bin/ebuild.sh | 13 +++-- lib/_emerge/EbuildMetadataPhase.py | 15 +-- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index 32995d95b..381bcb5c8 100755 --- a/bin/ebuild.sh

[gentoo-portage-dev] [PATCH 3/4] Remove UNUSED* auxdbkeys

2021-09-03 Thread Michał Górny
The UNUSED* auxdbkeys are a relict of old metadata cache format that required a fixed number of lines. This format is no longer supported by Portage, and all uses of auxdbkeys strip UNUSED values, so just remove them entirely. Signed-off-by: Michał Górny --- bin/portageq | 3

[gentoo-portage-dev] [PATCH 1/4] Remove deprecated dbkey support from doebuild/ebuild.sh

2021-09-03 Thread Michał Górny
change in metadata format. Signed-off-by: Michał Górny --- bin/ebuild.sh | 23 --- lib/portage/package/ebuild/doebuild.py | 22 +++--- 2 files changed, 7 insertions(+), 38 deletions(-) diff --git a/bin/ebuild.sh b/bin/ebuild.sh index

[gentoo-portage-dev] [PATCH 0/4] Modernize metadata passing & add INHERIT to md5-cache

2021-09-03 Thread Michał Górny
key to md5-cache for better compatibility with PkgCore. This key lists eclasses directly inherited by ebuild (vs _eclasses_ that lists indirect inherits as well). Michał Górny (4): Remove deprecated dbkey support from doebuild/ebuild.sh Switch internal metadata to key=value format Remove

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

2021-09-03 Thread Michał Górny
uot; > + eqawarn "For compatibility with <=portage-2.1.6.7, only > call EXPORT_FUNCTIONS" > + eqawarn "after inherit(s)." > + fi > fi > > local -x ECLASS Merged both. -- Best regards, Michał Górny

[gentoo-portage-dev] [PATCH] post_emerge: Display all preserved libs with --verbose

2021-08-31 Thread Michał Górny
--- lib/_emerge/post_emerge.py | 2 +- lib/portage/util/_dyn_libs/display_preserved_libs.py | 11 +++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/lib/_emerge/post_emerge.py b/lib/_emerge/post_emerge.py index 0c4df0d32..c540308d3 100644 ---

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

2021-08-29 Thread Michał Górny
On Mon, 2021-08-30 at 00:47 +0200, Ulrich Mueller wrote: > > > > > > On Sun, 29 Aug 2021, Michał Górny wrote: > > > On Sun, 2021-08-29 at 22:06 +0200, Ulrich Müller wrote: > > > - eqawarn "For compatibility with > >

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

2021-08-29 Thread Michał Górny
eqawarn "For compatibility with PMS, only call > EXPORT_FUNCTIONS after inherit(s)." > fi > fi > Could you add a sentence that the current Portage behavior is going to change in the future? -- Best regards, Michał Górny

Re: [gentoo-portage-dev] In what phase are file "merged"?

2021-06-23 Thread Michał Górny
status of the old > package in pkg_*inst (of the new package). I would even say that it can't rely on the particular status of the old package in any case, if it's meant to be removed. In particular, its dependencies can be unmerged before the package itself. -- Best regards, Michał Górny

[gentoo-portage-dev] [PATCH] Emit QA notices for setuptools warnings

2021-05-29 Thread Michał Górny
'description-file' will not be supported in future versions. Please use the underscore name 'description_file' instead * Usage of dash-separated 'upload-dir' will not be supported in future versions. Please use the underscore name 'upload_dir' instead Signed-off-by: Michał Górny --- lib

Re: [gentoo-portage-dev] [PATCH v2] emerge --search: auto-detect regular expressions (bug 737480)

2020-09-02 Thread Michał Górny
+766,14 @@ matching packages due to \fB\-\-rebuild\fR. > A space separated list of package names or slot atoms. Emerge will not > rebuild > packages that depend on matching packages due to \fB\-\-rebuild\fR. > .TP > +.BR "\-\-regex\-search\-auto < y | n >" > +Enable or disable automatic regular expression detection for search actions. > +If this option is enabled (the default), then regular expression search > +is automatically enabled when the search string is a valid regular expression > +which contains any of these commonly used regular expression characters or > +character sequences: > +^ $ * [ ] { } | ? .+ > +.TP > .BR \-\-oneshot ", " \-1 > Emerge as normal, but do not add the packages to the world file > for later updating. -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] profile masking

2020-08-14 Thread Michał Górny
This has to stop somehow, there need to be something that limits > the mask scope to the repo/overlay it is defined. > Why is that? I dare say the bigger picture needs to include different mask reasons. Sure, 'masked for testing' may or may not make little sense for live ebuilds. However, 'masked for security issues' may pretty apply to custom repo ebuilds as well. -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] [PATCH 1/3] Add cached portage.getpid() function

2020-08-07 Thread Michał Górny
+ """ > + Verify that portage.getpid() cache is updated correctly after > + two forks. > + """ > + loop = asyncio._wrap_loop() > + proc = AsyncFunction(scheduler=loop, > target=self._test_getpid_fork) > + proc.start() > + self.assertEqual(proc.wait(), 0) -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] [PATCH] lib/*: Fix useless-return

2020-08-07 Thread Michał Górny
> > def perform_post_sync_hook(self, reponame, dosyncuri='', > repolocation=''): > diff --git a/lib/portage/util/whirlpool.py b/lib/portage/util/whirlpool.py > index 1071d5155..857abf3ac 100644 > --- a/lib/portage/util/whirlpool.py > +++ b/lib/portage/util/whirlpool.py > @@ -634,7 +634,6 @@ class WhirlpoolStruct: > > def WhirlpoolInit(ctx): > ctx = WhirlpoolStruct() > -return > > def WhirlpoolAdd(source, sourceBits, ctx): > if not isinstance(source, bytes): > @@ -777,7 +776,6 @@ def processBuffer(ctx): > # apply the Miyaguchi-Preneel compression function > for i in range(8): > ctx.hash[i] ^= state[i] ^ block[i] > -return > > # > # Tests. > diff --git a/pylintrc b/pylintrc > index f2aadf14f..ce5dec11b 100644 > --- a/pylintrc > +++ b/pylintrc > @@ -33,6 +33,7 @@ enable= > unused-import, > useless-import-alias, > useless-object-inheritance, > +useless-return, > wildcard-import > > # A comma-separated list of package or module names from where C extensions > may -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

[gentoo-portage-dev] [PATCH] Remove py<3.4 import compatibility

2020-07-17 Thread Michał Górny
--- bin/binhost-snapshot | 5 +-- lib/_emerge/BinpkgFetcher.py | 5 +-- lib/_emerge/BlockerCache.py | 6 +--- lib/portage/cache/anydbm.py | 31 +--- lib/portage/dbapi/bintree.py | 5 +--

Re: [gentoo-portage-dev] [PATCH 2/3] Remove support code for Python < 3.3

2020-07-17 Thread Michał Górny
Dnia July 17, 2020 8:10:25 AM UTC, Ulrich Mueller napisał(a): >>>>>> On Fri, 17 Jul 2020, Michał Górny wrote: > >> --- a/lib/portage/util/_dyn_libs/PreservedLibsRegistry.py >> +++ b/lib/portage/util/_dyn_libs/PreservedLibsRegistry.py >> @@ -34,12 +34,

[gentoo-portage-dev] [PATCH 1/3] Remove support code for Python < 3.2

2020-07-16 Thread Michał Górny
Signed-off-by: Michał Górny --- lib/portage/tests/process/test_poll.py | 9 +++-- .../tests/util/futures/asyncio/test_pipe_closed.py | 7 ++- lib/portage/util/configparser.py| 13 +++-- 3 files changed, 8 insertions(+), 21 deletions(-) diff

[gentoo-portage-dev] [PATCH 2/3] Remove support code for Python < 3.3

2020-07-16 Thread Michał Górny
Signed-off-by: Michał Górny --- bin/chpathtool.py | 8 +-- bin/doins.py | 14 + lib/portage/_emirrordist/FetchTask.py | 13 ++-- lib/portage/dbapi/vartree.py | 25 ++-- lib/portage/util

[gentoo-portage-dev] [PATCH 3/3] Remove support code for Python < 3.4

2020-07-16 Thread Michał Górny
Signed-off-by: Michał Górny --- lib/_emerge/AsynchronousLock.py | 12 +--- lib/_emerge/EbuildMetadataPhase.py| 12 +--- lib/_emerge/FifoIpcDaemon.py | 30 +-- lib/_emerge/PipeReader.py | 12 +--- lib

[gentoo-portage-dev] [PATCH] Clean up more py2 conditional code

2020-07-16 Thread Michał Górny
Closes: https://github.com/gentoo/portage/pull/575 Signed-off-by: Michał Górny --- lib/portage/cache/anydbm.py | 4 +- lib/portage/cache/mappings.py | 45 +--- lib/portage/cache/sql_template.py | 5 +- lib/portage/cache/template.py

[gentoo-portage-dev] [PATCH] Eliminate the most of explicit py3 conditionals

2020-07-16 Thread Michał Górny
Eliminate the most of py2/py3 conditions in the code. Leave a few where the relevant code is unclear, they will be addressed later. Closes: https://github.com/gentoo/portage/pull/574 Signed-off-by: Michał Górny --- bin/check-implicit-pointer-usage.py | 25 ++ bin/chmod

[gentoo-portage-dev] [PATCH] Eliminate basestring/long/_unicode py3 compat

2020-07-15 Thread Michał Górny
Replace basestring and _unicode hacks with str, and long with int. Signed-off-by: Michał Górny --- bin/egencache | 7 +-- lib/_emerge/BinpkgFetcher.py | 5 +- lib/_emerge/BlockerCache.py | 19 ++- lib/_emerge/BlockerDB.py

[gentoo-portage-dev] [PATCH] Remove unnecessary time.monotonic() compat

2020-07-14 Thread Michał Górny
time.monotonic() is available since py3.3, so there's no need for the compat anymore. Signed-off-by: Michał Górny --- lib/portage/dbapi/vartree.py | 7 ++-- lib/portage/tests/util/futures/test_retry.py | 8 ++--- lib/portage/util/_eventloop/EventLoop.py | 6 ++-- lib

Re: [gentoo-portage-dev] [PATCH] travis.yml: drop python 2.7 (bug 731114)

2020-07-06 Thread Michał Górny
On Mon, 2020-07-06 at 11:42 -0700, Zac Medico wrote: > It should be pretty safe to drop support for python2.7 at this point. > We should probably also change the trove classifier to ... Python :: 3 :: Only -- Best regards, Michał Górny signature.asc Description: This is a digitally

Re: [gentoo-portage-dev] Speeding up Tree Verification

2020-07-01 Thread Michał Górny
On Tue, 2020-06-30 at 16:51 -0500, Sid Spry wrote: > On Tue, Jun 30, 2020, at 2:29 PM, Michał Górny wrote: > > On Tue, 2020-06-30 at 12:50 -0500, Sid Spry wrote: > > > On Tue, Jun 30, 2020, at 2:28 AM, Michał Górny wrote: > > > > Dnia June 30, 2020 2:1

Re: [gentoo-portage-dev] Speeding up Tree Verification

2020-06-30 Thread Michał Górny
On Tue, 2020-06-30 at 12:50 -0500, Sid Spry wrote: > On Tue, Jun 30, 2020, at 2:28 AM, Michał Górny wrote: > > Dnia June 30, 2020 2:13:43 AM UTC, Sid Spry napisał(a): > > > Hello, > > > > > > I have some runnable pseudocode outlining a faster tree verifica

Re: [gentoo-portage-dev] Speeding up Tree Verification

2020-06-30 Thread Michał Górny
#raise exc >> return False >> except AttributeError as exc: >> # Validation may have failed; DNSKEY missing signer >attribute. dig may report >> # domain as valid. >> # >> # TODO: Additional state where subdomain of valid domain may >fail with 3 nested >> # KeyErrors. Avoid temptation to wildcard catch. Safer to put >in process? >> #raise exc >> return False >> else: >> return True >> >> def hash_localpart(incoming: bytes) -> str: >> '''Z-base32 the localpart of an e-mail address >> >> >https://tools.ietf.org/html/draft-koch-openpgp-webkey-service-08#section-3.1 >> describes why this is needed. >> >> See https://tools.ietf.org/html/rfc6189#section-5.1.6 for a >> description of the z-base32 scheme. >> ''' >> zb32 = "ybndrfg8ejkmcpqxot1uwisza345h769" >> >> b = hashlib.sha1(incoming).digest() >> ret = "" >> assert(len(b) * 8 == 160) >> for i in range(0, 160, 5): >> byte = i // 8 >> offset = i - byte * 8 >> # offset | bits remaining in k+1 | right-shift k+1 >> # 3 | 0 | x >> # 4 | 1 | 7 >> # 5 | 2 | 6 >> # 6 | 3 | 5 >> # 7 | 4 | 4 >> if offset < 4: >> n = (b[byte] >> (3 - offset)) >> else: >> n = (b[byte] << (offset - 3)) + (b[byte + 1] >> (11 - >offset)) >> >> ret += zb32[n & 0b1] >> return ret >> >> def build_web_key_uri(address: str) -> str: >> local, remote = address.split('@') >> local = hash_localpart(local.encode('utf-8')) >> return 'https://' + remote + '/.well-known/openpgpkey/hu/' + \ >> local >> >> def stream_to_file(uri: str, fname: str) -> None: >> with requests.get(uri, verify=True, stream=True) as r: >> from pprint import pprint >> pprint(r.headers) >> with open(fname, 'wb') as f: >> shutil.copyfileobj(r.raw, f) >> ``` >> -- Best regards, Michał Górny

Re: [gentoo-portage-dev] Speeding up Tree Verification

2020-06-30 Thread Michał Górny
>b = hashlib.sha1(incoming).digest() >ret = "" >assert(len(b) * 8 == 160) >for i in range(0, 160, 5): >byte = i // 8 >offset = i - byte * 8 ># offset | bits remaining in k+1 | right-shift k+1 ># 3 | 0 | x ># 4 | 1 | 7 ># 5 | 2 | 6 ># 6 | 3 | 5 ># 7 | 4 | 4 >if offset < 4: >n = (b[byte] >> (3 - offset)) >else: > n = (b[byte] << (offset - 3)) + (b[byte + 1] >> (11 - offset)) > >ret += zb32[n & 0b1] >return ret > >def build_web_key_uri(address: str) -> str: >local, remote = address.split('@') >local = hash_localpart(local.encode('utf-8')) >return 'https://' + remote + '/.well-known/openpgpkey/hu/' + \ >local > >def stream_to_file(uri: str, fname: str) -> None: >with requests.get(uri, verify=True, stream=True) as r: >from pprint import pprint >pprint(r.headers) >with open(fname, 'wb') as f: >shutil.copyfileobj(r.raw, f) >``` -- Best regards, Michał Górny

Re: [gentoo-portage-dev] Add caching to a few commonly used functions

2020-06-27 Thread Michał Górny
Dnia June 28, 2020 3:42:33 AM UTC, Zac Medico napisał(a): >On 6/27/20 8:12 PM, Michał Górny wrote: >> Dnia June 28, 2020 3:00:00 AM UTC, Zac Medico >napisał(a): >>> On 6/26/20 11:34 PM, Chun-Yu Shei wrote: >>>> Hi, >>>> >>>> I was recentl

Re: [gentoo-portage-dev] Add caching to a few commonly used functions

2020-06-27 Thread Michał Górny
;can >be garbage collected along with the depgraph. > >2) Eliminate redundant calls. For example, redundant calls to >catpkgslit >can be avoided by constructing more _pkg_str instances, since >catpkgsplit is able to return early when its argument happens to be a >_pkg_str instance. I think the weak stuff from the standard library might also be helpful. -- Best regards, Michał Górny

Re: [gentoo-portage-dev] [PATCH 1/3] Add caching to catpkgsplit function

2020-06-27 Thread Michał Górny
plit: > return None > retval = (cat, p_split[0], p_split[1], p_split[2]) >+ _catpkgsplit_cache[mydata] = retval > return retval > > class _pkg_str(_unicode): -- Best regards, Michał Górny

Re: [gentoo-portage-dev] [PATCH] Use env to find python

2020-06-17 Thread Michał Górny
On Wed, 2020-06-17 at 10:18 +0200, Ulrich Mueller wrote: > > > > > > On Tue, 16 Jun 2020, Michał Górny wrote: > > '/usr/bin/env python' (with no extra options) is the portable shebang. > > I still think this is a gross hack. You want your script to use the > corr

Re: [gentoo-portage-dev] erroneous behavior in 2-style USE dependencies?

2020-06-17 Thread Michał Górny
libs(-)?' but that would be bad if the default was supposed to be '(+)'. > This is related to the tool I'm working on: should my tool allow this > behavior, or fail like it is currently doing (I guess the former)? > That depends on what the tool is doing. I suppose you probably don't nee

Re: [gentoo-portage-dev] [PATCH] Use env to find python

2020-06-16 Thread Michał Górny
flexible as possible? > > Yes, that makes sense. > > However, we should test to make sure that distutils is smart enough to > parse that "/usr/bin/env -S python" string and replace it with > version-specific python shebang. > '/usr/bin/env python' (with no extra options) is the portable shebang. -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] [PATCH] config.environ: delay export of A and AA (bug 720180)

2020-05-26 Thread Michał Górny
is will only hide the problem from developers who will unknowingly commit broken ebuilds and cause users of alternative package managers to suffer. -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

[gentoo-portage-dev] [PATCH] process: Provide libc fallback for sethostname() on PyPy

2020-05-17 Thread Michał Górny
Signed-off-by: Michał Górny --- lib/portage/process.py | 9 - 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/lib/portage/process.py b/lib/portage/process.py index 79052b608..ceb454030 100644 --- a/lib/portage/process.py +++ b/lib/portage/process.py @@ -715,7 +715,14 @@ def

Re: [gentoo-portage-dev] [PATCH] Enable FEATURES=parallel-install by default (bug 715110)

2020-05-13 Thread Michał Górny
On Tue, 2020-05-12 at 13:18 -0700, Zac Medico wrote: > On 5/12/20 12:28 PM, Michał Górny wrote: > > W dniu wto, 12.05.2020 o godzinie 10∶05 -0700, użytkownik Zac Medico > > napisał: > > > On 5/12/20 3:39 AM, Michał Górny wrote: > > > > I'm sorry but I was aski

Re: [gentoo-portage-dev] [PATCH] Enable FEATURES=parallel-install by default (bug 715110)

2020-05-12 Thread Michał Górny
W dniu wto, 12.05.2020 o godzinie 10∶05 -0700, użytkownik Zac Medico napisał: > On 5/12/20 3:39 AM, Michał Górny wrote: > > I'm sorry but I was asking of a more high-level implications. > > > > I presume that this means that more than files of more than one > >

Re: [gentoo-portage-dev] [PATCH] Enable FEATURES=parallel-install by default (bug 715110)

2020-05-12 Thread Michał Górny
W dniu wto, 12.05.2020 o godzinie 01∶40 -0700, użytkownik Zac Medico napisał: > On 5/11/20 10:54 PM, Michał Górny wrote: > > W dniu nie, 10.05.2020 o godzinie 21∶32 -0700, użytkownik Zac > > Medico > > napisał: > > > The feature enables finer graine

Re: [gentoo-portage-dev] [PATCH] Enable FEATURES=parallel-install by default (bug 715110)

2020-05-11 Thread Michał Górny
y help understand what this does, exactly. -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] [PATCH] Change BINPKG_COMPRESS default from bzip2 to xz

2020-04-27 Thread Michał Górny
be true. > It is true but nobody cares. People managed to shove a lot of unused code into the kernel and nobody cares. -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] [PATCH] Change BINPKG_COMPRESS default from bzip2 to xz

2020-04-26 Thread Michał Górny
std that scales better. -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] Need backup mentor for FUSE-based sandbox project

2020-04-26 Thread Michał Górny
On Sat, 2020-04-25 at 21:40 -0700, Alec Warner wrote: > On Thu, Apr 23, 2020 at 12:09 PM Michał Górny wrote: > > > Hi, everyone. > > > > It seems that we *urgently* (read: in 6 days) need to find backup > > mentors for this year's GSoC projects. I'm mentoring the

[gentoo-portage-dev] Need backup mentor for FUSE-based sandbox project

2020-04-23 Thread Michał Górny
to be the backup maintainer for this? [1] https://summerofcode.withgoogle.com/dashboard/organization/5749981018849280/proposal/5572241732927488/ -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] [PATCH v2] process: Unshare UTS namespace, and set hostname to 'localhost'

2020-03-28 Thread Michał Górny
On Sat, 2020-03-28 at 11:16 -0700, Zac Medico wrote: > On 3/28/20 12:13 AM, Michał Górny wrote: > > Use UTS namespace to override hostname when network-sandbox is enabled. > > Set it to 'localhost' as that has a better chance of being present > > in /etc/hosts. This fixes t

[gentoo-portage-dev] [PATCH v2] process: Unshare UTS namespace, and set hostname to 'localhost'

2020-03-28 Thread Michał Górny
Use UTS namespace to override hostname when network-sandbox is enabled. Set it to 'localhost' as that has a better chance of being present in /etc/hosts. This fixes tests in some packages that try to connect to localhost via hostname obtained using gethostname(), e.g. docker-py, and suffer

[gentoo-portage-dev] [PATCH] process: Unshare UTS namespace, and set hostname to 'localhost'

2020-03-27 Thread Michał Górny
Use UTS namespace to override hostname when network-sandbox is enabled. Set it to 'localhost' as that has a better chance of being present in /etc/hosts. This fixes tests in some packages that try to connect to localhost via hostname obtained using gethostname(), e.g. docker-py, and suffer

Re: [gentoo-portage-dev] [PATCH] repoman: remove check for addpredict

2020-03-05 Thread Michał Górny
by a developer who has since retired. > If you want to remove this class of warnings, I'd suggest removing the one for -j1 as well. Same argument. -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

[gentoo-portage-dev] [PATCH] repoman: Restore eclass deprecations lost in rewrite

2020-02-26 Thread Michał Górny
Signed-off-by: Michał Górny --- repoman/lib/repoman/modules/linechecks/deprecated/inherit.py | 5 + 1 file changed, 5 insertions(+) diff --git a/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py b/repoman/lib/repoman/modules/linechecks/deprecated/inherit.py index 9cef086da

[gentoo-portage-dev] [PATCH] Clean up remnants of eapi5-hdepend, HDEPEND and targetroot

2019-12-26 Thread Michał Górny
Signed-off-by: Michał Górny --- bin/eapi.sh | 46 +-- bin/ebuild.sh | 23 +++--- bin/phase-functions.sh| 4 +- doc/package/ebuild.docbook| 1 - doc/package/ebuild

Re: [gentoo-portage-dev] Re: RFC: [QA] notice with 'failed' seds [was PATCH: eapply drop -s option]

2019-12-16 Thread Michał Górny
On Sun, 2019-12-15 at 13:29 -0800, Zac Medico wrote: > On 12/13/19 2:12 PM, Michael 'veremitz' Everitt wrote: > > On 13/12/19 20:36, Michał Górny wrote [excerpted]: > > > Is this really an argument for or *against* it? Developers are entirely > > > capable of k

Re: [gentoo-portage-dev] [PATCH v2] eapply: Output verbosely only if patch fails to apply with -F0

2019-12-14 Thread Michał Górny
all_opts+=( -s -F0 ) > - else > - eqawarn "${f}: patch failed to apply > without a fuzz factor, please rebase" > fi > > ${patch_cmd} "${all_opts[@]}" < "${f}" Actually, I added that because of your comment that people should be rebasing patches rather than removing context. -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

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

2019-12-14 Thread Michał Górny
On Fri, 2019-12-13 at 17:15 -0500, Mike Gilbert wrote: > On Fri, Dec 13, 2019 at 4:42 PM Michał Górny wrote: > > On Fri, 2019-12-13 at 16:37 -0500, Mike Gilbert wrote: > > > On Fri, Dec 13, 2019 at 3:36 PM Michał Górny wrote: > > > > Just like 'many of the proposals

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

2019-12-13 Thread Michał Górny
On Fri, 2019-12-13 at 21:56 +, Michael 'veremitz' Everitt wrote: > On 13/12/19 21:42, Michał Górny wrote: > > On Fri, 2019-12-13 at 16:37 -0500, Mike Gilbert wrote: > > > On Fri, Dec 13, 2019 at 3:36 PM Michał Górny wrote: > > > > Just like 'many of the proposals

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

2019-12-13 Thread Michał Górny
On Fri, 2019-12-13 at 16:37 -0500, Mike Gilbert wrote: > On Fri, Dec 13, 2019 at 3:36 PM Michał Górny wrote: > > Just like 'many of the proposals lately', developers are going to be > > the ones disabling it (because they don't care), and users will be the > > ones enablin

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

2019-12-13 Thread Michał Górny
devs should enable, > but don't spit this in the user's face by default. > Just like 'many of the proposals lately', developers are going to be the ones disabling it (because they don't care), and users will be the ones enabling it (because they do care), just to learn that developers don't c

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

2019-12-13 Thread Michał Górny
On Fri, 2019-12-13 at 09:06 -0500, Mike Gilbert wrote: > On Fri, Dec 13, 2019 at 8:52 AM Michał Górny wrote: > > On Fri, 2019-12-13 at 08:47 -0500, Mike Gilbert wrote: > > > On Thu, Dec 12, 2019 at 3:15 PM Ulrich Mueller wrote: > > > > > > > >

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

2019-12-13 Thread Michał Górny
st pass -F and ignore all the context. Though I don't understand why include any context in the first place if you don't care about it matching. Sounds like a waste of space to me! -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] [PATCH v2] eapply: Output verbosely only if patch fails to apply with -F0

2019-11-27 Thread Michał Górny
within the spec. Maybe the extra verboseness would be enough, > but the eqawarn line should be omitted? It doesn't provide any info that > isn't already present in the output of patch itself. > It helps people understand why some patches throw a wall of text while others don't. -- B

[gentoo-portage-dev] [PATCH v2] eapply: Output verbosely only if patch fails to apply with -F0

2019-11-27 Thread Michał Górny
applies both to successful application with fuzz and to failure. Signed-off-by: Michał Górny --- bin/phase-helpers.sh | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) Changes in v2: - added original path to output diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh

Re: [gentoo-portage-dev] [PATCH] eapply: Output verbosely only if patch fails to apply with -F0

2019-11-27 Thread Michał Górny
On Wed, 2019-11-27 at 11:13 -0800, Zac Medico wrote: > On 11/27/19 10:54 AM, Michał Górny wrote: > > 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

[gentoo-portage-dev] [PATCH] eapply: Output verbosely only if patch fails to apply with -F0

2019-11-27 Thread Michał Górny
applies both to successful application with fuzz and to failure. Signed-off-by: Michał Górny --- bin/phase-helpers.sh | 16 ++-- 1 file changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/phase-helpers.sh b/bin/phase-helpers.sh index 60f8d3243..6f9b52678 100644 --- a/bin/phase

Re: [gentoo-portage-dev] SLOT move of sys-libs/ncurses-5.9-r5(0/5) to sys-libs/ncurses-compat-5.9-r5(5/5) ?

2019-11-14 Thread Michał Górny
On Thu, 2019-11-14 at 13:01 +, Joakim Tjernlund wrote: > Is there way to move the above with current portage ? > No. Slot moves work only within a package. -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] [r...@gentoo.org: Cron /usr/local/bin/pidlock -s sync-distfiles /usr/bin/timeout -k 2h 1h /usr/local/bin/mastermirror/sync-distfiles.sh]

2019-11-05 Thread Michał Górny
t either. I think it's fine to delete it now. -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] [PATCH] install-qa-check.d: remove check that bans libtool files and static libs from /

2019-11-04 Thread Michał Górny
e on stamping it because... why exactly? Because it's 'not an appropriate way', apparently. So what's the appropriate way? -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] [PATCH] install-qa-check.d: remove check that bans libtool files and static libs from /

2019-11-03 Thread Michał Górny
On Sun, 2019-11-03 at 15:26 -0600, William Hubbs wrote: > On Sun, Nov 03, 2019 at 12:18:40PM -0800, Zac Medico wrote: > > On 11/3/19 11:53 AM, Michał Górny wrote: > > > On Sun, 2019-11-03 at 11:49 -0800, Zac Medico wrote: > > > > On 10/27/19 10:40 AM, William Hubbs w

Re: [gentoo-portage-dev] [PATCH] install-qa-check.d: remove check that bans libtool files and static libs from /

2019-11-03 Thread Michał Górny
t that this has been vetoed by a QA member, and is currently subject to QA vote. Therefore, I believe you shouldn't be making rash decisions based on patches submitted by a single developer. Especially given that so far nobody else has voiced his opinion either way, so it's 1:1. -- Best regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] [PATCH] install-qa-check.d: remove check that bans libtool files and static libs from /

2019-10-27 Thread Michał Górny
On Sun, 2019-10-27 at 13:49 -0500, William Hubbs wrote: > On Sun, Oct 27, 2019 at 06:58:00PM +0100, Michał Górny wrote: > > On Sun, 2019-10-27 at 12:40 -0500, William Hubbs wrote: > > > Most upstreams and build systems do not make this distinction, so this > > > causes u

Re: [gentoo-portage-dev] [PATCH] install-qa-check.d: remove check that bans libtool files and static libs from /

2019-10-27 Thread Michał Górny
t regards, Michał Górny signature.asc Description: This is a digitally signed message part

Re: [gentoo-portage-dev] [PATCH] make.globals: Change FETCHCOMMAND_RSYNC to --copy-links

2019-10-21 Thread Michał Górny
On Mon, 2019-10-21 at 17:25 +0200, Ulrich Mueller wrote: > > > > > > On Mon, 21 Oct 2019, Michał Górny wrote: > > This also removes most of the other options that are irrelevant or even > > undesirable to distfile fetching, that is: > > - '-r' since we alwa

[gentoo-portage-dev] [PATCH] make.globals: Change FETCHCOMMAND_RSYNC to --copy-links

2019-10-21 Thread Michał Górny
from mirrors, - '-D' since we do not expect any devices or specials in distfiles. Copying timestamps is preserved in case it's helpful in determining whether files need to be refetched. Bug: https://bugs.gentoo.org/698046 Signed-off-by: Michał Górny --- cnf/make.globals | 4 ++-- 1 file changed

Re: [gentoo-portage-dev] [PATCH 1/2] fetch: Use real os.walk() to avoid unicode issues with Portage

2019-10-21 Thread Michał Górny
On Mon, 2019-10-21 at 02:10 -0700, Zac Medico wrote: > On 10/21/19 1:43 AM, Michał Górny wrote: > > Use real os.walk() when getting filenames for FlatLayout. Unlike > > the wrapped Portage module, it return str output for str path parameter, > > so we don't have to rec

[gentoo-portage-dev] [PATCH 2/2] emirrordist: Pass path from DeletionIterator to DeletionTask

2019-10-21 Thread Michał Górny
Since DeletionIterator needs to stat the distfile and therefore find one working path for it, pass it to DeletionTask instead of recomputing it there. This also fixes wrongly assuming that first layout will always be correct. Bug: https://bugs.gentoo.org/697890 Signed-off-by: Michał Górny

[gentoo-portage-dev] [PATCH 1/2] fetch: Use real os.walk() to avoid unicode issues with Portage

2019-10-21 Thread Michał Górny
Use real os.walk() when getting filenames for FlatLayout. Unlike the wrapped Portage module, it return str output for str path parameter, so we don't have to recode it back and forth. Signed-off-by: Michał Górny --- lib/portage/package/ebuild/fetch.py | 3 ++- 1 file changed, 2 insertions

  1   2   3   4   5   6   7   8   9   >