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
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
|
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
Wednesday, 20 August 2008, 00:56 GMT
Reason for closing: Fixed
Additional comments about closing: Commit 232b838a54e689800267e1b98ace207bd442b8cd
/* 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.
} else {
/* even if we are forcing install, we need the oldpkg filelist loaded for backup handling later */
alpm_pkg_get_files(oldpkg);
}
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);