Giter Site home page Giter Site logo

tdnf's Introduction

tdnf - tiny dandified yum

In order to compile, from the checkout directory, run the following

mkdir build && cd build
cmake ..
make

Do enable debugging symbols (useful for use with gdb), use:

cmake -DCMAKE_BUILD_TYPE=Debug ..

You can also build tdnf using docker using the following commands:

docker build -t photon/tdnf-build -f ci/Dockerfile.photon .
docker run --rm -it -v $(pwd):/build -w /build photon/tdnf-build

create a conf file named tdnf.conf under /etc/tdnf/ with the following content

[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=true
repodir=/etc/yum.repos.d
cachedir=/var/cache/tdnf

Now configure repo files under /etc/yum.repos.d or your repodir following .repo format of dnf/yum.

You should now have a client executable named tdnf under bin/. To test run:

./bin/tdnf list installed

You should see a list of installed packages and their related info

Testing

To build and run the test scripts within a container, do:

export DIST=photon
docker run --security-opt seccomp:unconfined --rm -it -e DIST -v$(pwd):/build -w/build ${DIST}/tdnf-build ./ci/docker-entrypoint.sh

Same for

export DIST=fedora

Coverity

Assuming you have coverity installed on /pathto/coverity, you can run:

docker run --rm -it -v $(pwd):/build -v /pathto/coverity/:/coverity/ -w /build photon/tdnf-build ./ci/coverity.sh

This will put the output to ./build-coverity. You can then commit the results to the coverity database from that directory, or view the results in ./build-coverity/html. For example, you can start an nginx container:

docker run -it --rm -p 8080:80 --name web -v $(pwd)/build-coverity/html:/usr/share/nginx/html nginx

and then view results in your browser at http://<host>:8080/.

tdnf's People

Contributors

azaugg avatar conan-kudo avatar ganboing avatar jaankit avatar jreypo avatar keerthanakalyan avatar mminkus avatar mrgirgin avatar ntsbtz avatar oliverkurth avatar ppadmavilasom avatar prashant1221 avatar prestonsn avatar reubeno avatar sameluch avatar shivania2 avatar sidcha avatar snambakam avatar ssahani avatar sshedi avatar suezzelur avatar tapakund avatar xiaolin-vmware avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tdnf's Issues

Not able to build and install tdnf

Tried building and installing tdnf on Ubuntu 16.04 Machine failed with below errors:

includes.h:42:29: fatal error: hawkey/advisory.h: No such file or directory
compilation terminated.
Makefile:486: recipe for target 'libtdnf_la-api.lo' failed
make[1]: *** [libtdnf_la-api.lo] Error 1
make[1]: Leaving directory '/root/tdnf/client'
Makefile:497: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

Even Hawkey installation failed:

Hawkey Error:

root@1e2c87fd62b0:~/hawkey/build# cmake ..
Building C object CMakeFiles/cmTC_8ba5c.dir/CheckSymbolExists.c.o
/usr/bin/cc  -D_GNU_SOURCE   -o CMakeFiles/cmTC_8ba5c.dir/CheckSymbolExists.c.o   -c /root/hawkey/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c
Linking C executable cmTC_8ba5c
/usr/bin/cmake -E cmake_link_script CMakeFiles/cmTC_8ba5c.dir/link.txt --verbose=1
/usr/bin/cc       CMakeFiles/cmTC_8ba5c.dir/CheckSymbolExists.c.o  -o cmTC_8ba5c -rdynamic 
make[1]: Leaving directory '/root/hawkey/build/CMakeFiles/CMakeTmp'
File /root/hawkey/build/CMakeFiles/CMakeTmp/CheckSymbolExists.c:

/* */
#include <fnmatch.h>
int main(int argc, char** argv)
{
  (void)argv;
#ifndef FNM_CASEFOLD
  return ((int*)(&FNM_CASEFOLD))[argc];
#else
  (void)argc;
  return 0;
#endif
}

Please guide what dependency am I missing to build and install tdnf?

tdnf distro-sync returned a non-zero code: 70

Hi,

When building Admiral container image based on vmware/photon:1.0 if we run "tdnf distro-sync --refresh -y" we get the following trace:

...
---> Running in 3e5311a68153
Refreshing metadata for: 'VMware Lightwave 1.0(x86_64)'
Refreshing metadata for: 'VMware Photon Linux 1.0(x86_64)Updates'
Refreshing metadata for: 'VMware Photon Extras 1.0(x86_64)'
Refreshing metadata for: 'VMware Photon Linux 1.0(x86_64)'

Installing:
libssh2 x86_64 1.8.0-1.ph1 182.22 k

Total installed size: 182.22 k

Upgrading:
zlib x86_64 1.2.8-5.ph1 103.93 k
vim x86_64 7.4-9.ph1 1.93 M
util-linux x86_64 2.27.1-3.ph1 4.57 M
tdnf x86_64 1.1.0-1.ph1 134.56 k
tcsh x86_64 6.19.00-6.ph1 477.08 k
sqlite-autoconf x86_64 3.18.0-2.ph1 2.27 M
rpm x86_64 4.11.2-14.ph1 4.28 M
readline x86_64 6.3-5.ph1 3.52 M
photon-release noarch 1.0-6.ph1 474.00 b
pcre x86_64 8.39-1.ph1 960.35 k
openssl x86_64 1.0.2l-1.ph1 5.23 M
nss x86_64 3.31-1.ph1 3.88 M
nspr x86_64 4.15-1.ph1 951.07 k
ncurses x86_64 6.0-5.ph1 6.83 M
libgpg-error x86_64 1.27-1.ph1 700.45 k
libstdc++ x86_64 5.3.0-4.ph1 1.56 M
libgcc x86_64 5.3.0-4.ph1 100.42 k
libassuan x86_64 2.4.3-1.ph1 106.00 k
glibc x86_64 2.22-13.ph1 50.98 M
filesystem x86_64 1.0-10.ph1 7.14 k
expat x86_64 2.2.0-1.ph1 242.58 k
elfutils-libelf x86_64 0.169-1.ph1 885.12 k
curl x86_64 7.54.0-1.ph1 1.35 M
bzip2 x86_64 1.0.6-6.ph1 1.65 M
bash x86_64 4.3.30-10.ph1 2.50 M

Total installed size: 95.13 M

Reinstalling:
which x86_64 2.21-2.ph1 30.91 k
popt x86_64 1.16-2.ph1 119.44 k
pkg-config x86_64 0.28-2.ph1 554.22 k
photon-repos noarch 1.0-4.ph1 1.97 k
lua x86_64 5.3.2-2.ph1 612.17 k
libsolv x86_64 0.6.19-2.ph1 1.09 M
librepo x86_64 1.7.17-2.ph1 413.00 k
libffi x86_64 3.2.1-2.ph1 54.96 k
libcap x86_64 2.25-2.ph1 80.33 k
hawkey x86_64 2014.1-4.ph1 137.93 k
grep x86_64 2.21-2.ph1 719.41 k
gpgme x86_64 1.6.0-2.ph1 523.95 k
glib x86_64 2.47.6-2.ph1 2.97 M
findutils x86_64 4.6.0-2.ph1 1.62 M
file x86_64 5.24-2.ph1 3.85 M
db x86_64 6.1.26-2.ph1 4.42 M
coreutils x86_64 8.25-2.ph1 5.27 M
ca-certificates x86_64 20160109-5.ph1 1.80 M
attr x86_64 2.4.47-3.ph1 195.53 k

Total installed size: 24.39 M

Downloading:
libssh2 81299 100%
attr 82511 100%
ca-certificates 836766 100%
coreutils 2534896 100%
db 1976531 100%
file 301842 100%
findutils 623785 100%
glib 1226180 100%
gpgme 225930 100%
grep 224018 100%
hawkey 51710 100%
libcap 42649 100%
libffi 29489 100%
librepo 140724 100%
libsolv 397795 100%
lua 292941 100%
photon-repos 4523 100%
pkg-config 227051 100%
popt 58622 100%
which 19231 100%
bash 888417 100%
bzip2 526008 100%
curl 967000 100%
elfutils-libelf 308371 100%
expat 92851 100%
filesystem 16590 100%
glibc 19395292 100%
libassuan 48255 100%
libgcc 49103 100%
libstdc++ 479272 100%
libgpg-error 218745 100%
ncurses 1957223 100%
nspr 251586 100%
nss 1603945 100%
openssl 3196457 100%
pcre 383441 100%
photon-release 4196 100%
readline 1645441 100%
rpm 1761793 100%
sqlite-autoconf 1113964 100%
tcsh 279213 100%
tdnf 59886 100%
util-linux 2049044 100%
vim 1046561 100%
zlib 60789 100%
Testing transaction
Found 32 problems
package pkg-config-0.28-2.ph1.x86_64 is already installed
package gpgme-1.6.0-2.ph1.x86_64 is already installed
package db-6.1.26-2.ph1.x86_64 is already installed
package ca-certificates-20160109-5.ph1.x86_64 is already installed
package libffi-3.2.1-2.ph1.x86_64 is already installed
package glib-2.47.6-2.ph1.x86_64 is already installed
package librepo-1.7.17-2.ph1.x86_64 is already installed
package file-5.24-2.ph1.x86_64 is already installed
package grep-2.21-2.ph1.x86_64 is already installed
package lua-5.3.2-2.ph1.x86_64 is already installed
package attr-2.4.47-3.ph1.x86_64 is already installed
package libcap-2.25-2.ph1.x86_64 is already installed
package coreutils-8.25-2.ph1.x86_64 is already installed
package popt-1.16-2.ph1.x86_64 is already installed
package libsolv-0.6.19-2.ph1.x86_64 is already installed
package hawkey-2014.1-4.ph1.x86_64 is already installed
package photon-repos-1.0-4.ph1.noarch is already installed
package findutils-4.6.0-2.ph1.x86_64 is already installed
package which-2.21-2.ph1.x86_64 is already installed
/sbin/ldconfig is needed by (installed) gpgme-1.6.0-2.ph1.x86_64
/sbin/ldconfig is needed by (installed) gmp-6.0.0a-3.ph1.x86_64
/sbin/ldconfig is needed by (installed) coreutils-8.25-2.ph1.x86_64
/sbin/ldconfig is needed by (installed) libffi-3.2.1-2.ph1.x86_64
/sbin/ldconfig is needed by (installed) glib-2.47.6-2.ph1.x86_64
/sbin/ldconfig is needed by (installed) file-5.24-2.ph1.x86_64
/sbin/ldconfig is needed by (installed) lua-5.3.2-2.ph1.x86_64
/sbin/ldconfig is needed by (installed) popt-1.16-2.ph1.x86_64
/sbin/ldconfig is needed by (installed) findutils-4.6.0-2.ph1.x86_64
/bin/sh is needed by (installed) librepo-1.7.17-2.ph1.x86_64
/bin/sh is needed by (installed) grep-2.21-2.ph1.x86_64
/bin/sh is needed by (installed) libsolv-0.6.19-2.ph1.x86_64
/bin/sh is needed by (installed) findutils-4.6.0-2.ph1.x86_64
Error(70) : (null)
The command '/bin/sh -c tdnf distro-sync --refresh -y && tdnf clean all && ...' returned a non-zero code: 70
make: *** [run] Error 70

Any help? Thanks!

tdnf should support installing from HTTP and HTTP GPG keys

Currently tdnf will fail if it tries to install from a URL provided package, for example:

tdnf install -y http://example.com/example.rpm

I would expect this to work.

Additionally, GPG files in .repo files are required to be files, and cannot be provided as URLs.

Copied from vmware/photon#1017
Somewhat related to #77 except URL instead of a local file.

Does tdnf support retry/resume on failure?

On download failure, does the tool automatically retry from the bits it has successfully got (HTTP range requests)?
If yes, are the retry_count and retry_interval customizable?

Update README file

Current README file is incorrect. It points to the built tdnf binary inside folder ./tools/cli/tdnf whereas the actual binary is located at ./bin folder.

Does not handle multiple packages for install specified on command line

Found when running in a docker container based of vmware/photon. All but the first package specified for install are ignored, not installed yet the command returns success.:

Step 3 : RUN tdnf install -y grep gawk docker
---> Running in 130c8f7412e3
Installing:
grep x86_64 2.21-1
Downloading 223390.00 of 223390.00
Testing transaction
Running transaction
---> 1e560ccfbc85
Removing intermediate container 130c8f7412e3

tdnf should either install all of the packages or return a usage error when multiple packages are specified.

How to make reposync for photon repository

Hello

Is there any way to create reposync (and sync changes periodically) for Photon OS 2 (and 1) repositories to use Photon only in local network environment with limited Internet access?

Return "Nothing to be done" when there are no packages to be upgraded

Currently, tdnf list upgrades returns an error code where there is no packages to be upgrades. While there may not be any package to be upgraded, the command itself is properly constructed and shouldn't return an error.

Something like "Nothing to be done here" is suitable alternative.

Error when installing into a btrfs root

I've been trying to add photon linux to mkosi's continuous integration setup. This is working quite well, except for the build that installs photon into a gpt btrfs image where tdnf fails with Error(4294967295) : Unknown error -1601, as well as /sbin/ldconfig: no such file or directory errors when installing packages.

This only happens on btrfs and only with tdnf so I'm inclined to think the bug might be in tdnf. I'm not sure where to start looking though. To try and reproduce locally, the following commands can be executed (assuming tdnf,btrfs-progs,e2fsprogs and maybe dosfstools are installed):

git clone https://github.com/DaanDeMeyer/mkosi.git --branch ci-tdnf
cd mkosi
sudo ./mkosi --distribution photon --format gpt_btrfs --debug run -f build

A link to a failed run: https://github.com/systemd/mkosi/runs/935891127?check_suite_focus=true#step:8:519. (Github Actions doesn't handle output on both stdout/stderr very well. The line I linked is the last line produced by tdnf. If you scroll further down you can see the commands executed by mkosi before running tdnf)

Getting Error(1622) : Invalid argument when package dependency resolution fails

This is a really obscure error message and provides no value other than frustration. What's really happening is there's a package dependency resolution failure happening when it attempts to install one of the downloaded RPMs and just blows up with this error.

I was able to come to this conclusion by running tdnf check-local /var/cache/tdnf/<repo name>/rpms/Packages and it came back with:

Found 1 problem(s) while resolving
1. nothing provides <package> needed by <package>
Error(1301) : Solv general runtime error

distroverpkg config entry is set to a package that is not installed

I get the below error after following the compile/install instructions in the readme. The error is not so clear, do you know what the issue is?

[root@centos cli]# ./tdnf list
Error(1022) : distroverpkg config entry is set to a package that is not installed. Check /etc/tdnf/tdnf.conf

distro-sync missing?

vagrant [ ~ ]$ tdnf --help
usage: tdnf [options] COMMAND

List of Main Commands

autoerase
check-local               Checks local rpm folder for problems
check-update              Check for available package upgrades
clean                     Remove cached data
distro-sync               Synchronize installed packages to the latest available versions
downgrade                 downgrade a package
...

then next:

vagrant [ ~ ]$ tdnf distro-sync
No such command: distro-sync. Please use /usr/bin/tdnf --help

Lack of proxy support

Unable to use TDNF behind a proxy despite having configured the correct proxy setting in /etc/tdnf/tdnf.conf and via environment variables.

Proxy support exists in DNF so a little surprised TDNF is missing it.

Photon base for for given docker using Erlang

I need to create a photon base docker image for eMQTT. This is basically migration of the Dockerfile from Alpyne to Photon:1.0 for this: https://github.com/emqtt/emq-docker/blob/52c8b6e559296f89e4afdbcf124e120817c55f84/Dockerfile

When I am trying to install the first package erlang, it fails talking about missing package.
Which repo I can use for erlang and all other packages here that are reqd to build the emqttd/emq-relx code base.


I tried using erlang-solutions but that need rpmlib
sh-4.3# rpm -Uvh erlang-solutions-1.0-1.noarch.rpm
error: Failed dependencies:
rpmlib(PayloadIsXz) <= 5.2-1 is needed by erlang-solutions-1.0-1.noarch

Thanks

Support for querying package dependencies

rpm -qR is the typical way of listing a package's dependencies. dnf has repoquery. tdnf doesn't seem to have a cli option for listing package dependencies. Would it be possible to enable dnf's repoquery option for tdnf?

compile tdnf on debian failed

i am following the guide to compile tdnf on Debian.
it failed at make stage now.

the error is:

root@61001cda38f5:/tdnf/tdnf-1.2.2# make
Making all in common
make[1]: Entering directory '/tdnf/tdnf-1.2.2/common'
make[1]: Nothing to be done for 'all'.
make[1]: Leaving directory '/tdnf/tdnf-1.2.2/common'
Making all in client
make[1]: Entering directory '/tdnf/tdnf-1.2.2/client'
/bin/bash ../libtool  --tag=CC   --mode=compile gcc -DPACKAGE_NAME=\"tdnf\" -DPACKAGE_TARNAME=\"tdnf\" -DPACKAGE_VERSION=\"1.2.0\" -DPACKAGE_STRING=\"tdnf\ 1.2.0\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"tdnf\" -DVERSION=\"1.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.  -I../include -D_REENTRANT -D_GNU_SOURCE -fPIC -Wall -Werror -fno-strict-aliasing  -g -O2 -MT libtdnf_la-api.lo -MD -MP -MF .deps/libtdnf_la-api.Tpo -c -o libtdnf_la-api.lo `test -f 'api.c' || echo './'`api.c
libtool: compile:  gcc -DPACKAGE_NAME=\"tdnf\" -DPACKAGE_TARNAME=\"tdnf\" -DPACKAGE_VERSION=\"1.2.0\" "-DPACKAGE_STRING=\"tdnf 1.2.0\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"tdnf\" -DVERSION=\"1.2.0\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -I../include -D_REENTRANT -D_GNU_SOURCE -fPIC -Wall -Werror -fno-strict-aliasing -g -O2 -MT libtdnf_la-api.lo -MD -MP -MF .deps/libtdnf_la-api.Tpo -c api.c  -fPIC -DPIC -o .libs/libtdnf_la-api.o
In file included from api.c:21:0:
includes.h:42:29: fatal error: hawkey/advisory.h: No such file or directory
 #include <hawkey/advisory.h>
                             ^
compilation terminated.
Makefile:475: recipe for target 'libtdnf_la-api.lo' failed
make[1]: *** [libtdnf_la-api.lo] Error 1
make[1]: Leaving directory '/tdnf/tdnf-1.2.2/client'
Makefile:486: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

the previous error on ./configure stage disappearred after install pkg-config

Looking for hawkey libs
checking for hy_sack_count in -lhawkey... no
./configure: line 12470: syntax error near unexpected token `LIBCURL,'
./configure: line 12470: `PKG_CHECK_MODULES(LIBCURL, libcurl, have_libcurl=yes, have_libcurl=no)'

here is the detail of debian environment
(gcc (Debian 4.9.2-10) 4.9.2)

docker pull jaschac/debian-gcc:latest
apt-get install -y automake libtool autoconf libcurl4-gnutls-dev curl pkg-config
curl -OL# https://github.com/vmware/tdnf/archive/v1.2.2.tar.gz
aclocal
libtoolize
automake --add-missing
autoreconf
./configure
make

any help is appreciated, thanks

On Fedora 22, glibconfig.h: No such file or directory

[at@fedora22test tdnf]$ cat /etc/redhat-release
Fedora release 22 (Twenty Two)
[at@fedora22test tdnf]$ make
Making all in client
make[1]: Entering directory '/home/aty010/gocodez/src/github.com/tdnf/client'
/bin/sh ../libtool  --tag=CC   --mode=compile gcc -DPACKAGE_NAME=\"tdnf\" -DPACKAGE_TARNAME=\"tdnf\" -DPACKAGE_VERSION=\"1.0.2\" -DPACKAGE_STRING=\"tdnf\ 1.0.2\" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"tdnf\" -DVERSION=\"1.0.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I.  -I../include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -Werror -fno-strict-aliasing -g -O2 -MT libtdnfclient_la-api.lo -MD -MP -MF .deps/libtdnfclient_la-api.Tpo -c -o libtdnfclient_la-api.lo `test -f 'api.c' || echo './'`api.c
libtool: compile:  gcc -DPACKAGE_NAME=\"tdnf\" -DPACKAGE_TARNAME=\"tdnf\" -DPACKAGE_VERSION=\"1.0.2\" "-DPACKAGE_STRING=\"tdnf 1.0.2\"" -DPACKAGE_BUGREPORT=\"\" -DPACKAGE_URL=\"\" -DPACKAGE=\"tdnf\" -DVERSION=\"1.0.2\" -DSTDC_HEADERS=1 -DHAVE_SYS_TYPES_H=1 -DHAVE_SYS_STAT_H=1 -DHAVE_STDLIB_H=1 -DHAVE_STRING_H=1 -DHAVE_MEMORY_H=1 -DHAVE_STRINGS_H=1 -DHAVE_INTTYPES_H=1 -DHAVE_STDINT_H=1 -DHAVE_UNISTD_H=1 -DHAVE_DLFCN_H=1 -DLT_OBJDIR=\".libs/\" -I. -I../include -I/usr/include/glib-2.0 -I/usr/lib/glib-2.0/include -Wall -Werror -fno-strict-aliasing -g -O2 -MT libtdnfclient_la-api.lo -MD -MP -MF .deps/libtdnfclient_la-api.Tpo -c api.c  -fPIC -DPIC -o .libs/libtdnfclient_la-api.o
In file included from /usr/include/glib-2.0/glib/galloca.h:32:0,
                 from /usr/include/glib-2.0/glib.h:30,
                 from includes.h:30,
                 from api.c:21:
/usr/include/glib-2.0/glib/gtypes.h:32:24: fatal error: glibconfig.h: No such file or directory
compilation terminated.
Makefile:486: recipe for target 'libtdnfclient_la-api.lo' failed
make[1]: *** [libtdnfclient_la-api.lo] Error 1
make[1]: Leaving directory '/home/aty010/gocodez/src/github.com/tdnf/client'
Makefile:462: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1
[at@ifedora22test tdnf]$

cURL headers append callout

Can we provide callouts to curl calls in order to be able to append headers and provide ssl certificates?

Fix deprecation warning due to invalid escape sequence in test_metalink.py

CI warns about this:

tests/test_metalink.py:51
  /build/pytests/tests/test_metalink.py:51: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="md5">' + md5sum + '</hash>', photon_metalink ])

tests/test_metalink.py:62
  /build/pytests/tests/test_metalink.py:62: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="sha1">' + sha1sum + '</hash>', photon_metalink ])

tests/test_metalink.py:72
  /build/pytests/tests/test_metalink.py:72: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="sha256">' + sha256sum + '</hash>', photon_metalink ])

tests/test_metalink.py:79
  /build/pytests/tests/test_metalink.py:79: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="md5">' + md5sum + '</hash>', photon_metalink ])

tests/test_metalink.py:84
  /build/pytests/tests/test_metalink.py:84: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="sha1">' + sha1sum + '</hash>', photon_metalink ])

tests/test_metalink.py:89
  /build/pytests/tests/test_metalink.py:89: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="sha256">' + sha256sum + '</hash>', photon_metalink ])

tests/test_metalink.py:94
  /build/pytests/tests/test_metalink.py:94: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="sha256">' + sha256sum + '</hash>', photon_metalink ])

tests/test_metalink.py:99
  /build/pytests/tests/test_metalink.py:99: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="sha1">' + sha1sum + '</hash>', photon_metalink ])

"remove" doesn't remove a package's dependencies

per the wiki

remove: This command removes a package. When removing a package, tdnf by default also removes
dependencies that are no longer used if they were was installed by tdnf as a dependency without
being explicitly requested by a user. You can modify the dependency removal by changing the
clean_requirements_on_remove option in /etc/tdnf/tdnf.conf to false.

Running in a fresh container I see the following

root [ / ]# tdnf --version
tdnf: 2.0.0
root [ / ]# cat /etc/tdnf/tdnf.conf
[main]
gpgcheck=1
installonly_limit=3
clean_requirements_on_remove=true
repodir=/etc/yum.repos.d
cachedir=/var/cache/tdnf

root [ / ]# tdnf list installed |wc -l
32

root [ / ]# tdnf install git -y
...
root [ / ]# tdnf list installed |wc -l
65

root [ / ]# tdnf -y remove git

Removing:
git                                                         x86_64                        2.19.0-2.ph3                            @System                           20.88M 21895454

Total installed size:  20.88M 21895454
Testing transaction
Running transaction
Removing: git-2.19.0-2.ph3.x86_64

Complete!
root [ / ]# tdnf list installed |wc -l
64

I would expect the installed package count to be back to 32 with git and all of its dependencies removed

tdnf 1.2.3 stops and updates docker, but doesnt start it again

Hi,
my docker demon stopped working.

heres the relevant log
Feb 17 04:12:16 dns2019 [RPM][27370]: erase docker-18.06.1-1.ph2.x86_64: success
Feb 17 04:12:16 dns2019 systemd[1]: Stopping Docker Application Container Engine...
Feb 17 04:12:16 dns2019 dockerd[299]: time="2019-02-17T04:12:16.639847805+01:00" level=info msg="Processing signal 'terminated'"

... some more logging

Feb 17 04:12:21 dns2019 systemd[1]: Stopped Docker Application Container Engine.
Feb 17 04:12:23 dns2019 [RPM][27370]: install docker-18.06.2-1.ph2.x86_64: success
Feb 17 04:12:24 dns2019 [RPM][27370]: erase docker-18.06.1-1.ph2.x86_64: success
Feb 17 04:12:24 dns2019 [RPM][27370]: install docker-18.06.2-1.ph2.x86_64: success
Feb 17 04:12:24 dns2019 [RPM][27370]: install docker-18.06.2-1.ph2.x86_64: success
Feb 17 10:03:47 dns2019 systemd[1]: Starting Docker Application Container Engine...

I restarted it manually in the morning as you can see.
Why wouldnt it restart it after an update?

root@dns2019 [ ~ ]# /usr/bin/tdnf --version
tdnf: 1.2.3

systemctl status docker
docker.service - Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: disabled)
Active: active (running) since Sun 2019-02-17 10:03:47 CET; 22min ago

tdnf support for metalink ...

Re: vmware/photon#468

From @gregmmurray
Can we add support for the metalink option to tdnf?

Getting some resilience in accessing repos and the ability to have some sophistication on which mirror/repo we direct users is important. There's potential, too, to improve security and validation of packages.

tdnf install returns error 137 if package is installed

I'm installing prereqs with tdnf with containers running the Photon base image, and several times I've had my build break because new packages were introduced into the base image that I used to install in my scripts. E.g. I used to say "tdnf install -y grep" but now that fails because grep already exists. I think tdnf should work like other package managers and return 0 for "nothing to do" rather than an error. Generally a no-op install would not be considered an error.

CLI Argument validation should happen before any other actions are performed

For an invalid command construct, we must early-return to speedup tests runtime. In this case, metadata refresh should not happen.

root@photon-ea4f47d2e8d0 [ ~/tdnf/pytests ]# tdnf clean
Refreshing metadata for: 'VMware Photon Linux 3.0(x86_64) Updates'
Error(903) : Clean requires an option: packages, metadata, dbcache, plugins, expire-cache, all

tdnf not working | Error 1621 : Is a directory

what do?

root@photon8 [ /home/stefan ]# tdnf upgrade
Error(1621) : Is a directory
root@photon8 [ /home/stefan ]# tdnf check-local
Error(1621) : Is a directory
root@photon8 [ /home/stefan ]# tdnf check-update
Error(1621) : Is a directory
root@photon8 [ /home/stefan ]# tdnf clean
Error(1621) : Is a directory
root@photon8 [ /home/stefan ]# tdnf info
Error(1621) : Is a directory

journalctl doesn't tell me anything
photonOS was installed only around 2 weeks ago. i didn't do any hacking, only installed 4 docker containers and installed docker-compose by moving their binary into /usr/local/bin/docker-compose

Linux photon8 4.19.115-1.ph3-esx #1-photon SMP Tue Apr 21 18:54:09 UTC 2020 x86_64 GNU/Linux

Metalink tests reports deprecation message

When running make tests, I get the following deprecation message.

tests/test_metalink.py:51
  /root/tdnf/pytests/tests/test_metalink.py:51: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="md5">' + md5sum + '</hash>', photon_metalink ])

tests/test_metalink.py:62
  /root/tdnf/pytests/tests/test_metalink.py:62: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="sha1">' + sha1sum + '</hash>', photon_metalink ])

tests/test_metalink.py:72
  /root/tdnf/pytests/tests/test_metalink.py:72: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="sha256">' + sha256sum + '</hash>', photon_metalink ])

tests/test_metalink.py:79
  /root/tdnf/pytests/tests/test_metalink.py:79: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="md5">' + md5sum + '</hash>', photon_metalink ])

tests/test_metalink.py:84
  /root/tdnf/pytests/tests/test_metalink.py:84: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="sha1">' + sha1sum + '</hash>', photon_metalink ])

tests/test_metalink.py:89
  /root/tdnf/pytests/tests/test_metalink.py:89: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="sha256">' + sha256sum + '</hash>', photon_metalink ])

tests/test_metalink.py:94
  /root/tdnf/pytests/tests/test_metalink.py:94: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="sha256">' + sha256sum + '</hash>', photon_metalink ])

tests/test_metalink.py:99
  /root/tdnf/pytests/tests/test_metalink.py:99: DeprecationWarning: invalid escape sequence \
    utils.run([ 'sed', '-i', '-e' ,'/<verification>/a \    <hash type="sha1">' + sha1sum + '</hash>', photon_metalink ])

New release please?

There are significant fixes unreleased in tdnf, and I don't want to have cherry pick ~20-ish commits to make things work well. Can we please have a new release?

`update` command do not show up in the help page.

update command is not listed when doing (tdnf: 1.1.0) :

$ tdnf -h
usage: tdnf [options] COMMAND

options    [-c [config file]]
           [--debugsolver]
           [--disablerepo=<repoid>]
           [--enablerepo=<repoid>]
           [--rpmverbosity [debug level name]] [-v] [-y] [--assumeno]
           [--version] [--installroot [path]]
           [--nogpgcheck]
           [-q, --quiet]
           [--releasever RELEASEVER] [--setopt SETOPTS]
           [--refresh]
List of Main Commands

check-local               Checks local rpm folder for problems
check-update              Check for available package upgrades
clean                     Remove cached data
distro-sync               Synchronize installed packages to the latest available versions
downgrade                 downgrade a package
erase                     Remove a package or packages from your system
help                      Display a helpful usage message
info                      Display details about a package or group of packages
install                   Install a package or packages on your system
list                      List a package or groups of packages
makecache                 Generate the metadata cache
provides                  Find what package provides the given value
remove                    Remove a package or packages from your system
reinstall                 reinstall a package
repolist                  Display the configured software repositories
search                    Search package details for the given string
updateinfo                Display advisories about packages
upgrade                   Upgrade a package or packages on your system
upgrade-to                Upgrade a package on your system to the specified version

TDNF doesn't resolve dependencies correctly

This was reproduced in photon-dev minimal install.

root@photon-8afac0db3de5 [ ~/linux-stable-rt ]# tdnf install glibc

Downgrading:
libselinux                                    x86_64                 2.8-2.ph3                      photon-updates          166.24k 170226
iproute2                                      x86_64                 4.18.0-2.ph3                   photon-updates           2.08M 2185470
glibc                                         x86_64                 2.28-4.ph3                     photon-updates           8.79M 9220943

Total installed size:  11.04M 11576639
Is this ok [y/N]:y

Downloading:
libselinux                               80816   100%
iproute2                               1056038   100%
glibc                                  3981792   100%
Found 1 problems
libm.so.6(GLIBC_2.29)(64bit) is needed by (installed) iptables-1.8.3-1.ph3.x86_64
Found 1 problems
libm.so.6(GLIBC_2.29)(64bit) is needed by (installed) iptables-1.8.3-1.ph3.x86_64
Error(1515) : rpm check reported errors

Always return "Error(XXX)" as the first line of an error message for ease of parsing

After some research, I figured that there is no straightforward way to get the 32-bit return code from tdnf process across operating systems in a reliable way. For this reason, I switched to parsing the the stderr outputs with a regex like: ^Error\(\d+\). Now for this to work, we must always return the first line of any error message with the Error(XXX) message and be consistent about it.

Known deviants:

  • tdnf erase invalid_package
  • tdnf install invalid_package
  • tdnf update invalid_package

distro-sync -y ,returned a non-zero code: 255

Step 2/16 : RUN tdnf distro-sync -y
---> Running in 3e4c32756781
Refreshing metadata for: 'VMware Photon Linux 1.0(x86_64)'
Refreshing metadata for: 'VMware Lightwave 1.0(x86_64)'
Refreshing metadata for: 'VMware Photon Extras 1.0(x86_64)'
Refreshing metadata for: 'VMware Photon Linux 1.0(x86_64)Updates'

Upgrading:
sqlite-autoconf x86_64 3.22.0-2.ph1 2.40 M
openssl x86_64 1.0.2o-1.ph1 5.34 M
filesystem x86_64 1.1-3.ph1 7.11 k
curl x86_64 7.59.0-1.ph1 1.48 M

Total installed size: 9.23 M

Downloading:
curl 1089952 100%
filesystem 19644 100%
openssl 3321423 100%
sqlite-autoconf 1207710 100%
Testing transaction
Running transaction
Error(-1) : Unknown error -1601

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.