Add information about what autospec version was used to create the
spec file.
New header will appear as:
+# autospec version: v2
+# autospec commit: 1234567
With this change we'll restart tagging autospec. Changes that get
tagged (after PR merge, tag likely just pushed via git cli) should be
doing something that would benefit from a larger package ecosystem
rebuild.
Signed-off-by: William Douglas <william.douglas@intel.com>
These patterns are being removed as they are not used or are going to
be reworked.
This change also removes support for multi-versioned packages which
were considered for go and cargo purposes.
Signed-off-by: William Douglas <william.douglas@intel.com>
Due to more systems being added for automated runtime dependency
injection for subpackages, we need a way for manual overrides of the
default detected dependencies.
This change provides support for specifying which subpackage runtime
dependencies should be added or removed and consolidates some of the
custom configuration file detection along with it.
The buildpattern is a bit of an odd standalone module that was a
vestiage of the pre-refactor days where modules owned global
data. These days are coming to a close so move this data to a more
sensible owner in config.
This resolves#612 though likely more will be done as part of #131.
Many different components require the target download path and it is
needed early. Previously code existed to attempt to autodetect its
location and so defining the path was enforced later in the build
process. This created problems with ordering functions based on this
requirement but since the target path is now certain to be defined at
startup (due to previous changes) we can better align the location and
initialization of the data to the Config class.
As part of this change also avoid requiring the temporary working
directory to be setup as part of the Build class. This is done as a
cleanup due to the only real user of this location being the Content
class.
This also drops the stand-alone pkg_integrety main function that was
initially used as a one off test to avoid needing to run autospec to
validate the integrity of a package. This feature was seldom used and
doesn't function well without handling configuration so it was
dropped.
The logic behind the files extras, dev_extras and *_extras is
essentially identical but duplicated. Consolidate the code and internal
variables into a single parse and file_maps variable.
The tarball module had a number of globals that were referenced by
many other modules and has ordering dependencies with the config
module for some values. This made deciding on where certain values get
initialized difficult but before the initialization can be addressed a
refactor is helpful.
This change moves the global state (and functions that needed to
act on that global state) into a Content class. The goal of this work
is to better track what can be updated by a particular function, load
data in a sensible order and have it owned by a sensible component.
I expect that future work will see the tarball, buildpattern and some
portions of the config moved around to better match what component
should own what data (and to better deliniate between the data that
has a similar use but comes from different sources).
The buildreq module had a large number of globals being touched across
many modules that would import it. This made changes to the buildreq
fragile.
It also made testing fragile due to certain globals needing to be
reset in order to properly test a change.
This change moves the global state (and functions that needed to act
on that global state) into a Requirements class. The goal of this work
is to better track what content can be updated by a particular
function and load data in a sensible order and have it owned by a
sensible component.
The config module had a large amount of globals that were being
touched across many modules that would import. This made changes to
config very fragile as figuring out what would be modified in any
given call chain was difficult to diagnose.
It also made testing fragile as one would need to reset a given
module's config import to the best of their knowledge before rerunning
another test.
To get away from that (and to try and reduce the number of globally
modified variablies in autospec as a whole), refactor the config
module to provide its state as part config class. The long running
goal of changes like this is to better track what content can be
updated by a particular function (if a function would have access
to the config instance is now the hint rather than the config module
getting imported).
Instead of the excludes file adding '%exclude' macros for files that
are not being shipped in the binary rpms, they cause the file to be
deleted entirely.
This causes a few ripple effects in other parts of the subpackage file
manipulation code where excludes were used to avoid files being added
to multiple subpackages. To work around this, don't allow calls that
add files to a specific subpackage to fall through into the general
push_package_file fallthrough or file_pat_match calls. Also don't add
files that are still intended to be shipped to show up on the excludes
list.
Update support for handling go packages by handling missing go
dependencies. Make use of go modules and the go proxy (see
https://tip.golang.org/cmd/go/#hdr-Module_proxy_protocol for more
details on the proxy implementation) to discover what artifacts are
needed.
A new go-dep build_pattern that will package all versions that the
go-proxy finds is also added as part of this change. Additional rework
of the golang build_pattern (and Makefile build_pattern as a number of
go packages use Makefiles) to use module vendoring when module
configuration is detected was added as well.
The new functionality is also intended to be used by a higher level
tool that will wrap autospec calls to build missing dependencies as
well as the requested package.
To improve tracking of units that are enabled for restart by
clr-service-restart, add a new config file `service_restart`. It lists
one or more unit names (with full path), one unit per line. The %install
section is updated accordingly.
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Updating expected dev package definition to accomodate:
make -dev packages require: the main package
so that installing -dev gives you a functional component
Enable package builders to create custom extras subpackages (suffixed
by -extras). This enables content to be divided more exactly than just
the current extras subpackage support and also allows users to specify
requirements on other subpackages in the package. It is not intended
to replace extras usage as this feature should be used sparingly where
content really must be specificly placed.
Some unit tests were failing due to some config options not being
initialized. The issues are not seen when run with 'coverage' (as with
'make unittests').
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
Commit cf9f5e5394 did that for each of
the sub-packages, but we forgot to do the same for the main package.
Signed-off-by: Thiago Macieira <thiago.macieira@intel.com>
Tests for the %files section use bare file names. Since rpmbuild
requires leading slashes anyway, adding slashes to some of the tests.
Adding new tests for filenames with white space and/or rpm directives.
Signed-off-by: Brett T. Warden <brett.t.warden@intel.com>
Some changes have recently been pushed to autospec sources without
updating the unit tests. This patch brings the unit tests up-to-date
again.
test_build.py: Remove go buildtool bits (was deprecated)
test_specdescription.py: Newline added to post-scripts
test_specfile.py: Reset license_translations dict
files.py: Check dict with get() in case of missing key
This patch allows users to specify requires_add and requires_ban to
augment the automatic runtime requirement handling.
As part of this change, the handling of python requires has been
modified so that they are managed under generic requires instead of
their own special mechanism. python requires detection was also improved
by adding install_requires section contents when the section is detected
in setup.py.
The primary change aside from python handling is to remove main_requires
handling in files.py and consolidate requires fully in buildreq.py.
Includes a rename of specfile.py -> specfiles.py for easier imports and
related change to how it imported in autospec.py. Also includes a minor
fix to how lang files are written to the specfile. The error was
identified by these unit tests.