Below are the modifications done with this PR:
1. Add sha512sum support for verifying the repomd file.
2. Cache the baseurl in case of metalink.
3. support sequential retry of lesser priority mirrors
4. Removed hardcoded support of https, http, ftp, ftps, file resource types.
5. With this change, curl will decide on the protocol supported/unsupported.
6. Minor code cleanup and some improvements.
Signed-off-by: Tapas Kundu <tkundu@vmware.com>
TDNFGoal() calls TDNFPkgsToExclude() in two places. One of these calls
is from within a loop that calls TDNFAddGoal(). Hoisting this call to
TDNFPkgsToExclude() and passing the ouptput to TDNFAddGoal() prevents
needless calls at each loop iteration.
Signed-off-by: Siddharth Chandrasekaran <csiddharth@vmware.com>
This fix is to remove the old repomd , solv cache and lastrefresh
marker when there is a new repomd file downloaded. This fixes the issue
https://github.com/vmware/photon/issues/1008
Signed-off-by: Keerthana K <keerthanak@vmware.com>
-Added checks for files and resources.
-Added verifying checksum for the files to be downloaded using metalink file
-If verifying checksum fails, we will fail the discard the download.
-Added checks for resource type to:
- http
- https
- ftp
- ftps
- rsync
-We will also check the digest in below priority:
- sha256
- sha1
- md5
If sha256 is valid in metalink file, we will store sha256 to compare with the downloaded repomd.
In case sha256 is invalid, we will store sha1 and use it for validating the downloaded repomd file.
If both sha1 or sha256 is not valid, we will store md5.
In case we have only one digest present in metalink file and if thats invalid, we will not store any
digest and discard by throwing error, digest missing.
Signed-off-by: Tapas Kundu <tkundu@vmware.com>
Added metalink support for repo files.
If metalink URL is present, we will get the URL with the highest priority.
Then we concat the metalink path to the url and download the metalink file.
Once metalink file is downloaded, we parse it and downlod the repomd.xml
file and then parse the xml to download repoMD parts.
Also, we set the BaseURL for the respective repo to the URL we got from
the metalink file for further package downloads.
Signed-off-by: Tapas Kundu <tkundu@vmware.com>
Added support to deliver events based on registered events
Fixed problem with getting error string from plugins in case of failure
Few cosmetic fixes and fixed a typo in header file for "SYSTEM_LIBDIR"
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
tdnf clean all does not delete cache rpms. Fix to delete
the cached rpms if keepcache is not set.
Fixes https://github.com/vmware/photon/issues/832
Signed-off-by: Keerthana K <keerthanak@vmware.com>
- plugin event map for guidance to event items
- plugin events init, repo, repomd
- tests for plugin conf
- tests with a repomd sign and verify via plugin
- read conf file, read cmdline params.
- read plugins (default to 0. this means plugins are disabled by default)
- read pluginpath (default to /usr/lib/tdnf-plugins)
- read pluginconfpath (default to /etc/tdnf/pluginconf.d)
Changes include:
1. Fix build warnings like unused parameters, sign mismatch while comparing.
2. Using printf instead of fprintf(stdout, ...).
3. Added header guard in few .h files.
4. Added a rule for silent build in configure.ac
5. Removal of trailing spaces, my vim does it automatically
6. Fixed few wrong date entries in spec files.
7. Removed unused function parameters in few places.
Signed-off-by: Shreenidhi Shedi <sshedi@vmware.com>
Option Added to check command:
------------------------------
--skipconflicts: "tdnf check --skipconflicts" will hide the
conflict problems from the report and display it.
--skipobsoletes: "tdnf check --skipobsoletes" will hide the
obsoletes problems from the report and display it
If both options are given to check command, then it will display
the problems except conflicts and obsoletes problems
Additional Change:
-----------------
* replaced existing getopt_long call with getopt_long_only
Issue with getopt_long:
----------------------
** "tdnf check --sk" , it will parse --sk as --skipconflicts
*** --skip also it will parse as --skipconflicts as it occurs first in list
Fix with getopt_long_only:
-------------------------
** "tdnf check --skip" will give command error
*** --skipc will parse as --skipconflicts
*** --skipo will parse as --skipobsoletes
To differentiate between --skipconflicts and --skipobsoletes
replaced getopt_long with getopt_long_only
Testing:
-------
1) Added check.at under tests directory for "make check"
2) Executed TDNF tests to verify the changes
3) Executed PMD tests to verify the chnages
Change-Id: I8055d0ea3de6d46f80b7d6c8144f2637413ae917
This is used to modify curl options outside the tdnf. API clients
can set this callback via setopts and subsequently tdnf calls this
function before any curl options are set.
Change-Id: Ia5b79d0c1ba757287dbb26f7783b3c9b0d30ab4a
Previously tdnf makecache and --refresh always downloads repodata irrespective
of changes in repodata. This change uses shasum comaparison to detect if there
is any change in repodata and downloads repodata only if there is any
change in repodata.
Change-Id: Ia800bb54e69fec649aa10188fe981d66d2fc56a7
This change includes the support of libsolv caching of metadata which is a .solv file.
When the cache is created, tdnf creates a metadata cache file (*.solv)
in cache directory (/var/cache/tdnf/REPO-NAME/solvcache/). This is consumed by tdnf in
subsequent tdnf operations till the refresh timer expires. Solv cache file improves the
time consumed by tdnf operation which results in quicker results.
Change-Id: I42894260b8e9a110188c38027fc480dd83bfdc10
--reboot-required option is used to filter out the packages which
needs a system reboot post the package update.
Change-Id: Ibf346bb6d9a7ad1356edf19af0644490e4fb21e2
--security option is used to filter out the packages which have
the updates of security type.
--sec-severity option is used to filter out the packages which
has the update of type security and has a CVSS score greater than
the value mentioned in the opion value.
Change-Id: Ic83dd6fdb39d9037d303c69622de57a17c5751d8