Commit Graph

942 Commits

Author SHA1 Message Date
Patrick McCarty 8317bd5ee0 Implement profile_payload handling function
This function will manage all profile_payload handling. For patterns
that require special handling, the pattern argument can be passed to
specify the pattern name.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-09-11 14:42:56 -07:00
Athenas Jimenez cda74a0f2e specfiles : Add patterns for gradle repositories
Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2019-09-10 12:04:02 -07:00
William Douglas 6b47e7a985 Always remove non-compat files
When building a compat package, always exclude the non-compat files
regardless of if they match a specfic section or not.
2019-09-09 12:02:04 -07:00
Juro Bystricky 498c476faf license.py: Fix a misleading error message
We may get a message "<package>.license not found" even
if the file exists.

The <package>.license file is manually created but the
licenses in the file may be silently rejected due to being
blacklisted.
For example adding "GPL" or "BSD" to abc.license while autospecing
a package "abc" can produce the error:

"[FATAL]  Cannot find any license or abc.license file!"

eventhough the abc.license manifestly exists.

This patch modifies the original error message and also prints out
some additional messages, such as:

[WARNING] abc.license: blacklisted license GPL ignored.
[WARNING] abc.license: blacklisted license BSD ignored.
...
[FATAL]  Cannot find any license or a valid abc.license file!

Note: With this patch "add_license" only fails (returns False) if trying
to add a blacklisted license, it always returns True for non-blacklisted
licenses. This required to change the unit test "test_add_license_present"
accordingly.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-09-05 14:37:34 -07:00
William Douglas 8ac65c2a89 Add nodebug option
Enable setting an option for disabling debuginfo generation.
2019-09-05 14:37:19 -07:00
William Douglas 8736719a52 Stop globbing header files
This change eliminates the ability for header files to change path
without rebuilding. This limitation is being added because of changes
to exclude (to remove files rather than exclude them) making it
difficult to move header content to extras.
2019-09-05 11:49:10 -07:00
Brett T. Warden 70591e4ea8 Recursively search for target jar/pom files
Installs jar and pom files for any target directory, not just ./target.
2019-09-04 15:44:02 -07:00
Patrick McCarty 613cc6a753 Make one maven fail pattern more generic
I am seeing some requests to access 'apache.snapshots.https' instead of
'central', so make the regex more generic to match any mirror.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-09-04 14:26:46 -07:00
Patrick McCarty e9bd41ff81 Add support for mvn() virtual provides
All mvn packages in Clear Linux OS recently gained mvn() Provides, most
of which have the form:

    mvn(GROUPID:ARTIFACTID:TYPE) = VER

If classifiers are present, they have the form:

    mvn(GROUPID:ARTIFACTID:TYPE:CLASSIFIER) = VER

Because maven's error messages for missing artifacts list the missing
group ID, artifact ID, type, and optional classifier similar to the
above format, the fail pattern handling for these are simple.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-09-04 14:26:46 -07:00
Patrick McCarty 6973e09700 Fix up current maven jar mappings
I found some additional mappings to add, some that were obsolete, and
some that needed correction.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-09-04 14:26:46 -07:00
Patrick McCarty af4352ada5 maven pattern: do not install_append twice
write_install_append() is already called by write_buildpattern(), so it
should not be called in pattern-specific code.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-09-03 11:39:43 -07:00
Thiago Macieira d48e32ca06 Apply -mstackrealign to all 32-bit builds.
Since our 32-bit builds are for compatibility with old software that
hasn't been updated in ages, it's reasonable to add this flag so that we
also support software that simply hasn't been recompiled in nearly 15
years (the -mstackrealign flag was added in 2006, but the ABI change
happened some time before that).

Addresses distribution#1152.
2019-09-03 11:00:55 -07:00
Brett T. Warden f9c473c3de Fix comments to make flake8 happy 2019-08-30 13:30:15 -07:00
Brett T. Warden 6439342d14 Add build pattern for maven source packages 2019-08-30 13:30:15 -07:00
Choong Yin Thong 41132df1cc [specfiles] - update re.compile pattern
Added URL pattern with host repository.mapr.com.
There are some binary jar is located outside of repo.maven
hostname.

Signed-off-by: Choong Yin Thong <yin.thong.choong@intel.com>
2019-08-28 10:14:06 -07:00
Auke Kok d181536431 Add a translation for perl. 2019-08-27 14:25:05 -07:00
Juro Bystricky 3309db8f0e license_translations: add GFDL1.1
Autospec can detect license "GFDL1.1".
In this happens, a package build will end up with the
following error:

"ERROR: License 'GFDL1.1' is not an allowed SPDX license ID"

This patch translates "GFDL1.1" into the corresponding SPDX
license "GFDL-1.1".

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-08-26 16:06:44 -07:00
Juro Bystricky 86a59b8280 Add new pattern for 'vala'
Autospec fails for several gnome packages with:
meson.build:1:0: ERROR: Could not execute Vala compiler "valac"
This had to be fixed by manually adding "vala" to
buildreq_add file.
This patch adds "BuildRequires : vala" to the spec file if the
pattern "ERROR: Could not execute Vala compiler" is detected.

Signed-off-by: Juro Bystricky <juro.bystricky@intel.com>
2019-08-21 15:07:03 -07:00
Patrick McCarty 2848f9cedb specfiles: add new function for installing license files
Reduce code duplication by moving identical code blocks into a new
function, write_license_files().

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-08-21 12:04:32 -07:00
Athenas Jimenez 4998efbe1f mvnbin: Add license files to mvn packages.
Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2019-08-21 11:25:50 -07:00
Brett T. Warden 2c5e51fae8 Remove unused var jar_dir 2019-08-20 12:46:10 -07:00
Brett T. Warden c41790509c Remove experimental code
Remove prints and experimental build_unjar
2019-08-20 12:46:10 -07:00
Brett T. Warden fb14c5b448 Finalizing ant build pattern
Incorporating changes from @AthenasJimenez
2019-08-20 12:46:10 -07:00
Brett T. Warden 93e52e0033 Building up the ant buildpattern 2019-08-20 12:46:10 -07:00
Brett T. Warden 86cd8a9464 Limit extensions on licen[cs]e files
Limit optional extensions in licen[cs]e files to .txt or .xml so we
don't pick up things like images, makefiles, or source code.
2019-08-15 14:36:47 -07:00
Brett T. Warden 3b478e07c8 Allow extensions on licen[cs]e files
Expand the generic search pattern to also find files like
foo_license.txt by allowing an optional single-level extension after the
word licen[cs]e.
2019-08-15 12:19:33 -07:00
Auke Kok f8e3dead56 Abirepot: omit -extras- subrpms.
We don't want to make bundles that include all the deps for *extras* rpms,
these are most likely removed or optional components. We may have to
create separate used_libs_extras files for them instead.

We ignore the package name when searching for -extras-.
2019-08-14 16:50:21 -07:00
Patrick McCarty 18e4f8d1b4 Ignore pom, jar, and xml files
Java-based packages often have pom, jar, and/or xml files for sources.
We want to ignore them to prevent them from being added to package
repos.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-08-12 17:28:03 -07:00
Auke Kok 7464700d06 Meson: Fix lib/lib64 default base libdir.
Also, unify the way meson passes these flags for some consistency.
2019-08-07 10:43:46 -07:00
Auke Kok d075f518e0 Add summary file support, just like description.
Only the first line is used.
2019-08-02 13:20:26 -07:00
Miguel Bernal Marin 13aca42c60 fix upstream file creation
check_or_get_file is calling for the tarball and for each
archive, this provokes that upstream is reset every time, and
the latest archive is written twice as process_archives creates
the shasum again.

Let's remove the second shasum creation from process_archives, and
add a mode="a" parameter to check_or_get_file function for the archives,
and use mode="w" for the source tarball.

Fixes #440
2019-08-02 11:50:58 -07:00
Athenas Jimenez 06d4686847 mvnbin pattern: Manage metadata
Add the capability to manage maven-metadata.xml files.

Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2019-08-01 16:55:22 -07:00
William Douglas aeebdc928a Rework exclude feature
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.
2019-07-29 14:33:35 -07:00
Patrick McCarty 3f16dc56d0 Remove path restriction for go.mod processing
The go.mod file will typically live in a subdirectory of source tree
walk, so remove the restriction on where to find the go.mod.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-07-29 12:16:28 -07:00
Patrick McCarty c547cfc216 Ignore error when upstream file does not exist
The 'upstream' file may not exist when creating a new package from
scratch, so ignore FileNotFoundError for unlink() here.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-07-29 12:16:28 -07:00
William Douglas d9a7438dd0 Add ant build pattern 2019-07-24 15:32:34 -07:00
Athenas Jimenez e9289fbf91 cmake_modules: Set openjdk11 as default.
Openjdk9 is no longer under development and would be deprecated on July
26 of 2019 on Clear Linux. So, it would be replaced by Openjdk11
which is the current LTS.

Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2019-07-24 15:03:22 -07:00
William Douglas 54fd6e27aa Improve go ecosystem support
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.
2019-07-19 15:10:48 -07:00
Patrick McCarty c2b49457e2 pkg_integrity: fix handling of pubkey export error
The function should return early when the export fails.

Fixes #431.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-07-18 12:10:44 -07:00
Mandar Thorat cf3998959a download: Reverting changes to connection and low speed window timeouts
Request timeout is set to 30s. But connection timeout and low speed
window timeouts are set back to 10s as they didn't cause any errors

Signed-off-by: Mandar Thorat <mandar.chandrakant.thorat@intel.com>
2019-07-12 23:45:42 -07:00
Mandar Thorat 35d8cd2b33 download: Increase pycurl timeouts to 30 seconds
Increased connection timeout, request timeout and speed limit timeout
window to 30 seconds from 10 seconds

Signed-off-by: Mandar Thorat <mandar.chandrakant.thorat@intel.com>
2019-07-12 23:45:42 -07:00
Patrick McCarty b059fb90f3 tests: fix up pycurl mocks
Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-07-11 13:43:02 -07:00
Patrick McCarty 8d99b0f8d8 download: set pycurl timeouts
To start with, try setting the following timeouts:

- connection timeout of 10 seconds
- request timeout of 10 seconds
- speed limit timeout of 1 byte/sec in a 10-second window

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-07-11 13:43:02 -07:00
Athenas Jimenez 0136c493ce maven pattern: Mapping more maven packages
Signed-off-by: Athenas Jimenez <athenas.jimenez.gonzalez@intel.com>
2019-07-09 10:45:18 -07:00
Patrick McCarty 2d848ea73c Add regex escaping for NEWS file parsing
In some cases, the lack of escaping here leads to unhandled exceptions.
For example, if `tarball.name` == `libsigc++`, then an exception is
raised due to `++` not being a valid sequence in the regular expression.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-07-08 12:33:57 -07:00
Patrick McCarty 0942f31ffc buildreq: ignore R packages that ship with R itself
Add a blacklist of packages that ship with R so that autospec can ignore
them and avoid printing a "skipping" progress message for them.

Eventually, we want to autopopulate this list, so I added a FIXME too.

Fixes #420

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-07-04 09:18:08 -07:00
Patrick McCarty e2e4e710bf build: reset success flag before starting build round
Occasionally, within a build round, rpmbuild may succeed *and* new build
dependencies are detected, thus requiring another build round. But if
one or more of those new dependencies does not yet exist in the repo,
the root log scan returns an error and autospec falls through, commits
the result, and returns success.

Avoid this issue by resetting the success flag at the beginning of every
build round.

Fixes #419

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-07-03 14:41:31 -07:00
Patrick McCarty baadfa24fe Parsing fix for R package descriptions
We cannot split on whitespace alone, because dependencies may be
specified like 'igraph(>= 1.0.1)', with no intervening space between the
package name and the open parenthesis.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-07-03 12:39:00 -07:00
Patrick McCarty 3dbc3cdc6c Support UTF-8 curly single quotes for R patterns
Since the introduction of the C.UTF-8 locale for builds, R now prints
left/right curly single quotes in its error messages.

Adapt to this behavior by accepting U+2018 (left single quotation mark)
and U+2019 (right single quotation mark) in addition to the apostrophes
for the R fail patterns.

Signed-off-by: Patrick McCarty <patrick.mccarty@intel.com>
2019-07-02 14:44:19 -07:00
Patrick McCarty 0e1c61f6e6 Implement new config for clr-service-restart units
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>
2019-07-01 21:33:09 -07:00