Pacman

Historical bug tracker for the Pacman package manager.

The pacman bug tracker has moved to gitlab:
https://gitlab.archlinux.org/pacman/pacman/-/issues

This tracker remains open for interaction with historical bugs during the transition period. Any new bugs reports will be closed without further action.
Tasklist

FS#11218 - pacman gives "No such file" error during some --force installs

Attached to Project: Pacman
Opened by Jim Pryor (Profjim) - Thursday, 14 August 2008, 20:37 GMT
Last edited by Dan McGee (toofishes) - Wednesday, 20 August 2008, 00:56 GMT
Task Type Bug Report
Category General
Status Closed
Assigned To Xavier (shining)
Dan McGee (toofishes)
Architecture All
Severity Medium
Priority Normal
Reported Version 3.2.0
Due in Version 3.2.1
Due Date Undecided
Percent Complete 100%
Votes 0
Private No

Details

Description: pacman gives several "error: could not open file /var/lib/pacman/local/$package/files: No such file or directory" during --force installs for some packages. So far I've seen it with openvpn and (my own-makepkg'ed) ifplugd. If you remove the package data from /var/lib/pacman/local, the first --force install will work fine. Subsequent ones will give the error message.


Additional info:
* package version(s) pacman 3.2.0-1; openvpn 2.0.9-4 or ifplugd 0.28-3
* config and/or log files etc.


Steps to reproduce: "pacman -S --force openvpn"
This task depends upon

Closed by  Dan McGee (toofishes)
Wednesday, 20 August 2008, 00:56 GMT
Reason for closing:  Fixed
Additional comments about closing:  Commit 232b838a54e689800267e1b98ace207bd442b8cd
Comment by Xavier (shining) - Saturday, 16 August 2008, 17:08 GMT
So the problem is in lib/libalpm/add.c , here :
/* we'll need to save some record for backup checks later */
oldpkg = _alpm_pkg_dup(local);

We duplicate the package, but we don't make sure that oldpkg->files was filled.
Then the database entry is removed.

Later, when we do this call : hash_orig = _alpm_needbackup(entryname, alpm_pkg_get_backup(oldpkg));
get_backup tries to access to oldpkg->files. If it is empty, it tries to load it from /var/lib/pacman/local/$package/files , which does not exist anymore. So it breaks here.

This only happens when --force is used, because otherwise, we do file conflicts check :
/* Check for file conflicts */
if(!(trans->flags & PM_TRANS_FLAG_FORCE)) {

So in this case, oldpkg->files is filled.
Comment by Dan McGee (toofishes) - Saturday, 16 August 2008, 18:34 GMT
Should we just add an else block to this if statement along these lines?

} else {
/* even if we are forcing install, we need the oldpkg filelist loaded for backup handling later */
alpm_pkg_get_files(oldpkg);
}
Comment by Xavier (shining) - Saturday, 16 August 2008, 18:45 GMT
Indeed, we can do something like that, though I would prefer it doing it at the place where we create oldpkg, so just after
oldpkg = _alpm_pkg_dup(local);

But another problem is that this package is returned to the frontend :
EVENT(trans, PM_TRANS_EVT_UPGRADE_DONE, newpkg, oldpkg);

So then we have no control over what the frontend could do with it. A frontend has the right to access any fields of a package.
So maybe it would be better to just do :
oldpkg = _alpm_pkg_dup(local);
_alpm_db_read(oldpkg->origin_data.db, oldpkg, INFRQ_FULL);

Loading...