History log of /haikuporter/HaikuPorter/PackageInfo.py
Revision Date Author Comments
# f197120d 18-Sep-2023 jurgenwigg <53076001+jurgenwigg@users.noreply.github.com>

Import statements sorted with isort and fixed MockBuilder.py (#266)

* Fixed missing closing bracket in the MockBuilder.py

* Import statements sorted with isort


# 61901115 31-Jan-2020 Alexander von Gluck IV <kallisti5@unixzen.com>

python3: Fix missed itervalues -> values


# 8d5c14b6 31-Jan-2020 Michael Lotz <mmlr@mlotz.ch>

python3: Finish python3 change. python2 breaking

* Based on mmlr's 2017 work to use Python3 with
changes and adjustments for the current codebase


# 3d118f80 17-Mar-2018 Michael Lotz <mmlr@mlotz.ch>

Introduce TEST_REQUIRES for test-only requires.

This lets recipes specify dependencies that are only needed for the test
phase. Separating them out from BUILD_[PRE]REQUIRES allows for
situations that could otherwise result in cyclic dependencies.

Note that this bumps the repository format version, causing a repository
rebuild (re-parsing of all recipes, flushing of all caches). This is
required because the dependency info files and various caches need to be
regenerated to cope with the added test requires keys.

Fixes #151.


# 269954fb 10-Dec-2017 Michael Lotz <mmlr@mlotz.ch>

Cleanup: Make some constructs more idiomatic.

* Change 'not x in y' to 'x not in y'.
* Use 'is' to compare None singleton.
* Use 'instanceof(x, y)' instead of 'type(x) == y'.
* Replace map builtin with list comprehension.
* Rename self argument to cls for static method.


# 04a81d33 10-Dec-2017 Michael Lotz <mmlr@mlotz.ch>

Cleanup: Add missing raw string prefix to regex patterns.


# 14652091 10-Dec-2017 Michael Lotz <mmlr@mlotz.ch>

Cleanup: Remove trailing semicolons and a unneeded pass.


# 9836ce60 10-Dec-2017 Michael Lotz <mmlr@mlotz.ch>

Cleanup: Whitespace and line length cleanup.


# 77a47288 28-Nov-2017 Michael Lotz <mmlr@mlotz.ch>

PackageInfo: Create directory for HPKG info cache if needed.


# 32b91930 26-Nov-2017 Michael Lotz <mmlr@mlotz.ch>

PackageInfo: Simplify parsing resolvable expressions.

Use optional groups in the regular expression instead of conditional.


# ddd2e5fe 26-Nov-2017 Michael Lotz <mmlr@mlotz.ch>

PackageInfo: Fix resolvable compat parsing for recipe format.

The manual parsing of the compatibility version did only take the format
used in HPKGs into account, i.e. "(compatible >= version)". It is
however also used on the expressions from recipe files, which use the
format "compat >= version". This lead to the compat version being
ignored and therefore possibly wrong dependencies to be used.

Remove the manual parsing and put it into the regular expression. Also
simplify the logic by using optional groups in the regular expression
so that the match result can be used regardless of what parts exist in
the string.


# d65d3e2f 26-Nov-2017 Michael Lotz <mmlr@mlotz.ch>

PackageInfo: Compile regular expression for version/expression.

And do it only once via class variable.


# 7004cf83 24-Nov-2017 Michael Lotz <mmlr@mlotz.ch>

PackageInfo: Persist the HPKG info cache to a file.

This dramatically reduces the time spent on reading package infos. Using
pickle instead of JSON allows to write the cache incrementally.


# 1f6bfefd 08-Nov-2017 Michael Lotz <mmlr@mlotz.ch>

PackageInfo: Make ResolvableExpression aware of 'base'.

It was previously ignored in all cases, now it is only ignored when
parsing expressions from HPKG files. Expressions coming from recipes
can now have the base modifier.

Note that apparently 'base' is never output by package list -i, which
means that 'base' was already ignored without explicitly ignoring it.


# 71a83f90 18-Dec-2016 Jessica Hamilton <jessica.l.hamilton@gmail.com>

Use Unicode strings for warn() & sysExit().


# 276e9bcb 07-Feb-2016 Adrien Destugues <pulkomandy@pulkomandy.tk>

Allow utf-8 in recipe files.

This is 2015, no need to stick with 1960s encodingsā€¦


# 66b58482 02-Jul-2015 Augustin Cavalier <waddlesplash@gmail.com>

Remove local check_output, we're now using Python 2.7.


# 797d2b92 21-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Cleanup imports.


# 6ba98e53 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

PackageInfo: implement caching for .hpkg files.

* Extracting .PackageInfo files from a package is quite slow, so cache
the result such that each package file is only parsed once per
haikuporter run.


# 05a8f635 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Add support to PackageInfo for reading .DependencyInfo files.

* Similar to a .PackageInfo file, a .DependencyInfo file stores
information about a package in a format that is easily parsable (in
this case: JSON). In contrast to .PackageInfo, a .DependencyInfo file
is not constrained to the use within a hpkg and contains all
different types of dependencies (i.e. requires, build-requires and
build-prerequires).


# 5f0ace09 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Refactoring: Prepare PackageInfo for changes to come.

* Move parsing of .hpkg/.PackageInfo files from constructor into a
method of its own.


# 476dbcbe 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Refactoring: use properties where it seems fit.

* Trying to be somewhat more Pythonic.


# fc1d58c6 29-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Revert to tab spacing for Pe's sake.


# a5f922e3 27-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Try again with whitespace.


# 558fbdb0 27-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Second attempt to fix whitespace. Options are different on OS X.


# 429ec015 27-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Convert tabs to spaces.


# 8874fa94 21-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Resolvable: fix __str__()

The compatible version wasn't printed correctly.


# 9c1b0385 21-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageInfo: improve field extraction

Explicitly match the beginning of the line to make it less likely to
get erroneous matches in multi-line description fields. It's still
possible though.


# 4f75ade5 21-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

Fix import-related warnings and errors.


# 99a61dae 19-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Unifiy the Options and GlobalConfig somewhat

* Module GlobalConfig is replaced with new module Configuration. The
global variable globalConfiguration is gone. Instead Configuration
provides getter methods.
* For several of the (newer) command line options there are now optional
configuration file entries. If given the command line values override
the configuration file values. Configuration also provides getter
methods for these options, which should be used instead of
getOption().


# c9504717 14-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageInfo: parse more package attributes

Namely the package name, the install path, the provides and requires.


# 2b8a58d5 13-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Start with a build platform abstraction

* Add '--cross-devel-package' option to specify the path to the cross
development package. Can be used for cross-compiling.
* Add module BuildPlatform which exports a buildPlatform variable, which
is initialized to an instance of BuildPlatformHaiku or
BuildPlatformUnix as appropriate.
* Move findDirectory() to BuildPlatformHaiku. BuildPlatformUnix has a
version with some hard-coded mappings.
* Add PackageInfo class. Very simple ATM. It only extracts the version
and the architecture from a package file.
* Rework Main._initGlobalShellVariables() somewhat: Extracting the Haiku
version from the build platform's system haiku package is obviously
not correct when cross-building. Also add support for non-Haiku build
platforms.
* Remove no longer needed MachineArchitecture.getBuildTripleFor().


# 797d2b925aa61ce548f35f9d3b255356c83f5936 21-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Cleanup imports.


# 6ba98e5397359d36fbac06dec43ed01cab19ab50 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

PackageInfo: implement caching for .hpkg files.

* Extracting .PackageInfo files from a package is quite slow, so cache
the result such that each package file is only parsed once per
haikuporter run.


# 05a8f635dd2380d0693876bcfe5903c574ef61ec 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Add support to PackageInfo for reading .DependencyInfo files.

* Similar to a .PackageInfo file, a .DependencyInfo file stores
information about a package in a format that is easily parsable (in
this case: JSON). In contrast to .PackageInfo, a .DependencyInfo file
is not constrained to the use within a hpkg and contains all
different types of dependencies (i.e. requires, build-requires and
build-prerequires).


# 5f0ace0974e0fffd6e58b47b672bbcd9696edc07 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Refactoring: Prepare PackageInfo for changes to come.

* Move parsing of .hpkg/.PackageInfo files from constructor into a
method of its own.


# 476dbcbe3fe6d63d35a2ac5db1b789f2434e04a4 20-Nov-2014 Oliver Tappe <zooey@hirschkaefer.de>

Refactoring: use properties where it seems fit.

* Trying to be somewhat more Pythonic.


# fc1d58c6abe57c99c11ec02b27be40844fb53572 29-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Revert to tab spacing for Pe's sake.


# a5f922e3fded4460be5a3c717862e7e588772487 27-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Try again with whitespace.


# 558fbdb04ff6cb063a4afba7f15b6f1bd0343af2 27-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Second attempt to fix whitespace. Options are different on OS X.


# 429ec015d0c47da50e302537ed33bc3f80d035a8 27-Oct-2014 Charlie Clark <charlie.clark@clark-consulting.eu>

Convert tabs to spaces.


# 8874fa944588c164c9b93f4bb1ff6815652f2495 21-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Resolvable: fix __str__()

The compatible version wasn't printed correctly.


# 9c1b0385c7f7909870dc4e8d4fc443ed74d70d2b 21-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageInfo: improve field extraction

Explicitly match the beginning of the line to make it less likely to
get erroneous matches in multi-line description fields. It's still
possible though.


# 4f75ade5939a7c0f91c73e2b94e68611e6060d93 21-Jul-2013 Oliver Tappe <zooey@hirschkaefer.de>

Fix import-related warnings and errors.


# 99a61dae85929042affb1fe60e038aa4149261d5 19-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Unifiy the Options and GlobalConfig somewhat

* Module GlobalConfig is replaced with new module Configuration. The
global variable globalConfiguration is gone. Instead Configuration
provides getter methods.
* For several of the (newer) command line options there are now optional
configuration file entries. If given the command line values override
the configuration file values. Configuration also provides getter
methods for these options, which should be used instead of
getOption().


# c9504717226e5a0f95cc12e81bad8166b045b41f 14-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

PackageInfo: parse more package attributes

Namely the package name, the install path, the provides and requires.


# 2b8a58d5a6e9e88c974dc5a9600d9c769b47d8fd 13-Jul-2013 Ingo Weinhold <ingo_weinhold@gmx.de>

Start with a build platform abstraction

* Add '--cross-devel-package' option to specify the path to the cross
development package. Can be used for cross-compiling.
* Add module BuildPlatform which exports a buildPlatform variable, which
is initialized to an instance of BuildPlatformHaiku or
BuildPlatformUnix as appropriate.
* Move findDirectory() to BuildPlatformHaiku. BuildPlatformUnix has a
version with some hard-coded mappings.
* Add PackageInfo class. Very simple ATM. It only extracts the version
and the architecture from a package file.
* Rework Main._initGlobalShellVariables() somewhat: Extracting the Haiku
version from the build platform's system haiku package is obviously
not correct when cross-building. Also add support for non-Haiku build
platforms.
* Remove no longer needed MachineArchitecture.getBuildTripleFor().