Commit Graph

87 Commits

Author SHA1 Message Date
Nitesh Kumar 4725d3bc7b Replace existing use of libmetalink library with custom handling. 2021-12-10 10:33:06 +00:00
Oliver Kurth 2d1229f910 add --repoid/--repo and --repofrompath options 2021-11-22 23:42:46 +00:00
Oliver Kurth ca54ffdc94 repoquery: various optimizations, fixes and
issues that came up in reviews.
2021-10-29 17:34:11 +00:00
Oliver Kurth 5467a399de repoquery: add --list option 2021-10-21 19:52:39 +00:00
Oliver Kurth 582d897197 repoquery: add dependency query options 2021-10-21 19:52:32 +00:00
Oliver Kurth c4b99c1328 minversions: read from files in minversions.d 2021-10-06 17:20:38 +00:00
Oliver Kurth 5f6fe1c648 add minversions config option 2021-10-06 17:20:38 +00:00
Oliver Kurth 4d61db48e8 unify TDNFList()/TDNFInfo() 2021-06-30 11:22:22 -07:00
Oliver Kurth 68be8d9bd5 reposync: implement --newest-only option 2021-05-28 12:18:44 -07:00
Oliver Kurth 3edb3e0f3f reposync: add TDNFDownloadPackageToTree() function 2021-05-28 12:18:44 -07:00
Oliver Kurth 070c5be6dc move gpg package check to new TDNFGPGCheckPackage() function 2021-05-28 12:18:44 -07:00
Oliver Kurth 8544b87e14 reposync: urls only option, delete option, norepopath and check conflicting options 2021-05-28 12:18:44 -07:00
Oliver Kurth 9225ddae7e add TDNFCreatePackageUrl() 2021-05-27 13:41:16 -07:00
Oliver Kurth 52e5ade2f6 reposync: basics, metadata, metadata/download-path and option handling 2021-05-27 13:39:36 -07:00
Oliver Kurth 6abe7df829 add TDNFGetFileSize() 2021-05-27 13:36:46 -07:00
Oliver Kurth a9c9e8e0c9 move special metalink handling out of TDNFDownloadFile() to caller 2021-05-27 13:36:46 -07:00
Oliver Kurth 91373fe5bb use curl_easy_strerror() to print errors 2021-03-08 12:03:03 -08:00
Oliver Kurth fe9795ef2e recursively remove directories for clean 2021-02-18 17:06:18 -08:00
Oliver Kurth c279cacc36 implement --downloaddir option 2021-01-11 12:40:16 -08:00
Keerthana K 7bbca904d8
Merge pull request #197 from oliverkurth/topic/okurth/multiple-keys-in-file
read multiple keys from one file
2020-12-18 12:39:14 +05:30
Oliver Kurth b99f39aed6 implement all download options retries, timeout, minrate and throttle 2020-12-07 11:23:20 -08:00
Oliver Kurth 415d3e3440 read multiple keys from one file 2020-11-20 12:56:53 -08:00
Oliver Kurth b5e30edd03 add TDNFFindRepoById() and TDNFCurlErrorIsFatal() 2020-11-19 12:03:49 -08:00
Emre Girgin 39314b40b8
Add SSL options support (#176)
* Add SSL options support
2020-10-23 12:05:59 -07:00
oliverkurth f2793f3085 install local and remote RPMs from command line 2020-10-21 22:22:39 -07:00
oliverkurth 7b0c6bba12 add TDNFIsFileOrSymlink() 2020-10-16 16:13:09 -07:00
oliverkurth 70b4523b77 import multiple keys 2020-10-01 11:24:59 -07:00
Oliver Kurth f419d79d79 Download gpg keys from remote locations (http, ftp, ..).
The key is first downloaded into the cache area, then used
like a local key. The cached key will be deleted after it
has ben added to the key ring.
2020-09-21 11:36:10 -07:00
Keerthana K 31a577946b
Merge pull request #167 from tapakund/seq_metalink_support
support sequential retry of lesser priority mirrors
2020-09-17 12:44:01 +05:30
Tapas Kundu fadaad452f support sequential retry of lesser priority mirrors
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>
2020-09-16 13:52:51 +08:00
Siddharth Chandrasekaran 896f6b269a Hoist call to TDNFPkgsToExclude() in TDNFGoal()
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>
2020-09-15 17:14:31 +05:30
Keerthana K 9299a55b12
Merge pull request #168 from tapakund/use-EVP-For-FIPS-Compliant
use high level openssl api for calculating hash
2020-09-14 11:34:41 +05:30
Tapas Kundu 9cf7d12a68 use high level openssl api for calculating hash
Signed-off-by: Tapas Kundu <tkundu@vmware.com>
2020-09-08 13:46:10 +08:00
oliverkurth 5759b4437a use TDNFYesOrNo for installcmd, move it to common/utils.c, and fix it 2020-08-28 14:51:30 -07:00
oliverkurth b0d7c3e30e add repo key permanently after asking for confirmation 2020-08-27 20:14:06 -07:00
Tapas Kundu 4d8b5849ca
Skip debug logs if quiet option is set (#142)
Skip logging on console if tdnf quiet is set

Signed-off-by: Tapas Kundu tkundu@vmware.com
2020-05-29 22:58:42 +05:30
Keerthana K 56be3619bc
Fix stale solv cache issue (#134)
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>
2020-05-12 10:28:43 +05:30
Tapas Kundu da56817f97 Improvement for metalink support
-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>
2020-04-21 20:48:47 +08:00
Tapas Kundu 8b5495dbc6 Add metalink support
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>
2020-04-09 23:07:19 +08:00
Shreenidhi Shedi aa5e62857f Fix plugin related issues
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>
2020-04-02 07:55:57 +05:30
Keerthana K 1da45e068b tdnf clean all command updates
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>
2020-03-20 09:28:34 +00:00
Priyesh Padmavilasom d6a0e74723 plugin headers and initial repogpgcheck plugin implementation
- 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
2020-02-12 18:50:26 +00:00
Priyesh Padmavilasom 6a6b9987fe plugin support
- 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)
2020-01-29 23:37:42 +00:00
Priyesh Padmavilasom 5cba36acf6 move setopt.c to common
this is so that setopt/getopt can be used from all libs
 required for upcoming external gpgkey changes
2019-10-25 18:59:15 +00:00
Shreenidhi Shedi c4de6ae9db Minor fixes all over the place.
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>
2019-10-14 22:25:38 +05:30
Keerthana K 7f23f9c2f5 Add skipsignature and skipdigest options
This change adds 2 new options for install / update commands:
    skipsignature - skip verifying RPM signatures
    skipdigest - skip verifying RPM digest

Change-Id: I3543ed8e9027755ec7cb3ecb49212596ac76f5a9
2019-04-12 08:31:11 +00:00
Ankit Jain a5cc08d8b8 Merge "tdnf: Added options skipconflicts, skipobsoletes to check command" into dev 2019-03-14 22:22:30 -07:00
Ankit Jain 88c68bd4d5 tdnf: Added options skipconflicts, skipobsoletes to check command
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
2019-03-13 21:07:38 +05:30
Keerthana K b45e91f1c1 curl callback implementation for API clients
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
2019-03-12 05:36:48 +00:00
Keerthana K e6012ec141 changes in tdnf makecache and --refresh commands
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
2019-02-28 07:09:08 +00:00