The lib_to_so boolean option in options.conf for a specific package
causes files ending with .so to be added to the lib subpackage instead
of the dev subpackage. This is helpful for packages with a plugin
architecture that use .so files as their plugins. Specific examples of
the packages this is helpful for is mesa and elfutils.
Functional tests updated.
A proxy redirect to localhost prevents package builds from accessing the
internet (they will receive a connection refused). Package build access
to the internet is a security issue if successful, and a very long
timeout if the build is behind an actual proxy.
Update the functional tests to reflect this change.
This patch is necesary to re autospec packages that build libraries
under /usr/lib64/avx2/ due to new glibc patch:
x86: Set dl_platform and dl_hwcap from CPU features
With this new patch ld.so will search "haswell" instead of "avx2".
Signed-off-by: Victor Rodriguez <victor.rodriguez.bahena@intel.com>
If a CVE was patched for the package, at any point in the package's
history, there is a good chance it is a security sensitive package.
Automatically set the security_sensitive flag for the package.
Implemented support for hash verification of packages from
download.gnome.org. This commit includes tests for domain
based verification (pypi ang gnome)
Update functional tests to reflect the recent version and name detection
changes, such as the addition of the [configuration] section of the
options.conf file.
Due to an 'nargs' specification in the argument parser, the name
argument was being read as a list. The list was then always accessed as
name_argument[0] to access the name. This patch removes the 'nargs'
specifier so name is always a string and removes the logic to parse the
list.
If both version and name arguments exist, set them and skip automated
detection. If one is not set, continue with the automated detection
since the URL parsing for both are done together, override at the end.
Autospec is unable to accurately parse every type of URL for the correct
name and version of the package. When this is the case, the detected
version can be overwritten by the --version argument on the command
line.
Before attempting to parse the build results, check that the build log
actually exists. If it does not exist, print a fatal error and exit.
This error often occurs on Clear Linux if the user is part of the mock
group.
Two large lists in the license module moved to configuration files
license_blacklist and license_translations. These files are read in by
the config module and are accessible from there.
Instead of manually searching for identifying strings in package
licenses, rely on the configuration file and license server to set the
license information. Remove unit tests that tested these functions.
Convert license_blacklist back to dict for faster lookup times.
Several changes to the license module including changes to where local
hashes are stored. Tests were added as well. Detailed changes below.
config:
- Move the license hashes from an internal repo to a config file
(license_hashes) in autospec.
test_license:
- Unit tests added
- Unit test target added to autospec Makefile
- COPYING_TEST file added with GPL-3.0 text for test purposes
license:
- scan_for_licenses: separate out search strings from conditional to
make the code more readable and remove unused parameter (required a
change to where autospec.py called the function).
- remove duplicate licenses from license_translation list.
- convert license_blacklist dict to list (values were unused, it was
being treated as a list anyways).
- separate out search strings from code in license_from_copying_hash
and license_from_doc.
- move curl code out of `with open(file) as fname:` clause in
license_from_copying_hash.
Public key import was not cleanning after running. With this
change the state of the keyring will be reverted to the
original state after the test runs.
The files module was being treated like a class, in that it was
necessary to keep state throughout the entire autospec run. Convert the
files module to a class and make some other general clean ups. This
changed how the files module was instantiated and called by the main
autospec module and other modules such as tarball and config.
Test the files module with unit tests and add the target to the
makefile.
When attempting to test python packages, test the python3 portion rather
than python2 as that is the priority for Clear Linux.
This patch is still bad as we don't detect the minor version of python
in use. I'd appreciate suggestions for improvement.
Instead of grabbing the tarball prefix from the first or second line in
the tarball contents, iterate through the lines until a properly formed
line is found. The prefix will usually be grabbed from the first line,
but cases where we have to keep looking are as follows:
tar -tf <tarfile>
name-with-no-trailing-slash
name-with-trailing-slash/README
name-with-trailing-slash/...
...
or
./
./name-with-trailing-slash/README
./name-with-trailing-slash/...
...
In both cases we want "name-with-trailing-slash." If the tarball prefix
cannot be determined, a fatal error will be printed and autospec will
exit.
Recent tempfiles change attempted to improve the way paths were
referenced in the tarball module, but this one was missed. Fix the
broken reference, which was breaking some package builds.
Autospec previously used an unsecure public temporary directory as its
working directory. This patch creates a secure temporary directory only
accessible by the creating user ID.
This shortcoming was identified when a github package URL was changed to
http from https. The 's' character is made optional when parsing the
github URL and two test cases are added to the packageurl list for
testing.
When a build fail autospec return 0 as exit code. This patch
change the print to print_fatal message and call sys.exit(1)
Signed-off-by: Miguel Bernal Marin <miguel.bernal.marin@linux.intel.com>