You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
dnf/dnf/conf/config.py: if TMPDIR is set to a non-existent dir, upgrades will fail.
in addition to testing whether TMPDIR is set, config.py should also check that the directory TMPDIR points to actually exists, in my opinion.
export TMPDIR=/sound dnf -y install ncdu
Last metadata expiration check: 0:00:57 ago on Tue 20 Jun 2023 12:56:51 PM PDT.
Dependencies resolved.
Package Architecture Version Repository Size
Reinstalling:
ncdu x86_64 1.18-4.fc38 fedora 63 k
Transaction Summary
Total download size: 63 k
Installed size: 111 k
Downloading Packages:
Cannot create temporary file - mkstemp '/sound/librepo-tmp-EZSao0': No such file or directory
dnf -y upgrade
Last metadata expiration check: 0:01:04 ago on Tue 20 Jun 2023 12:56:51 PM PDT.
Dependencies resolved.
Package Architecture Version Repository Size
Installing:
kernel x86_64 6.3.8-200.fc38 updates 132 k
...
xxd x86_64 2:9.0.1627-1.fc38 updates 35 k
Hello, I think the mentioned issue is not coming from the dnf component, but rather from librepo.
There is the TMPDIR constant in dnf, but given message Cannot create temporary file - mkstemp '/sound/librepo-tmp-EZSao0': No such file or directory is coming from librepo when the file is being downloaded into temporary location with the lr_gettmpfile function here. It doesn't use the TMPDIR constant from DNF, but the directory is taken from global environment variable when using GLib call g_get_tmp_dir, see here.
So the handling of the situation is done in GLib, the only thing of improving the situation from the user POV I can think of now is like checking the TMPDIR by ourselves in librepo and reseting it in case of non-existence, but I don't feel it is a good way as the GLib implementation could change...
Hey, Well, I'm still a bit of a newbie with such questions, so... To me it seems like, since '/tmp' is hard-coded a value of last resort, that providing the name of some known-as-existing directory is probably intended, because /tmp is so conventionally ubiquitous (right? ...it seems to be...). However, it is a temporary directory we're talking about here, so it also seems like there should be at least some expectation that the value of TMPDIR might have already bit the bucket by the time g_get_tmp_dir looks for a parameter value. idk
dnf/dnf/conf/config.py: if TMPDIR is set to a non-existent dir, upgrades will fail.
in addition to testing whether TMPDIR is set, config.py should also check that the directory TMPDIR points to actually exists, in my opinion.
export TMPDIR=/sound
dnf -y install ncdu
dnf -y upgrade
mapfile -t rpm_rpms < <(rpm -qa | grep -e dnf -e yum -e rpm )
: > ~/files
for r in "${rpm_rpms[@]}"; do unset foo; mapfile -t foo < <(rpm -ql "$r"); file -pk "${foo[@]}" >> ~/files; done
mapfile -t gfs < <( awk -F':' ' { print $1 }' ~/files )
grep -- mkstemp "${gfs[@]}" 2> /dev/null
git clone https://github.com/rpm-software-management/dnf
cd ./dnf; ls
grep -rn mkstemp .
find / -type f -path '*/dnf/conf/*' -name '*config.py*' 2> /dev/null
unset TMPDIR r rpms_rpms gfs
cd ..; rm -fr ./dnf
The text was updated successfully, but these errors were encountered: