-
Notifications
You must be signed in to change notification settings - Fork 277
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Rename failing during upgrade - flags problem? #1151
Comments
It looks to me like the files are coming out of the archive with various flags set. Is that expected behaviour? Is it a libarchive bug, and if so, is it during the creation or extraction stage? I can somewhat work around it by doing:
But this results in files in the filesystem afterwards having a whole bunch of flags set, which probably isn't wanted? For example:
|
I'm also not sure about this line: https://github.com/freebsd/pkg/blob/master/libpkg/pkg_add.c#L287 Should it be restoring the flags of the original file or the file from the archive? I think that's all I've got on this. Hopefully it helps a bit. |
it helps a lot thanks |
Right that should be fixed in, will be in 1.4.7. I'll do more testing before releasing. I would appreciate if you could test (the branch for 1.4.7 is: release-1.4) |
@bapt Happy to test. Will there be a ports-mgmt/pkg-devel with the changes, or do I need to pull from git? |
Looks good to me. At least, no errors at all in a full Actually - I take that back. I noticed a number of files in |
@bapt Ok, further testing this morning has still revealed problems. The first problem is that during a forced upgrade (so when a rename happens), I get files with odd flags. Here's a before and after for a
I think this is because of https://github.com/freebsd/pkg/blob/release-1.4/libpkg/pkg_add.c#L287 - in the case of a rename you apply the flags from the stat of the file within the archive, but you don't for a non-rename. Is that right? The second problem is that I still get failures, but from archive_read_extract(). They're not consistent; it fails in different places, and sometimes not at all. But here's traces of some failures:
Interestingly both cases are calls to
So probably caused by the target of the link having some flags set? Again, happy to do more testing while I have a repeatedly broken setup! |
Right so now I'm completly lost, I bet the problem is from libarchive 2.8 which is the version on FreeBSD 8 and some incompatibilities with libarchive 3 as I cannot reproduce on FreeBSD 9 or 10. Somehow the flags from the archive are not real flags. Maybe I should just skip all the flag handling on libarchive 2.8, I'll try to come with a patch |
Yes, I was beginning to wonder if libarchive was giving garbage flags, or more specifically that I suppose you want to be able to support files with flags in packages? If you don't, just wipe all flags? |
I only use aest->st_flags for a rename because to be able to handle the rename I need to wipe out the flags first. On all other cases libarchive should directly have extracted the proper flags. Yes we need to be able to support files with flags in packages to be able to package base. |
This time it should be really fixed. Really sorry about that breakage... |
@bapt fixed, thank you! No problems doing the upgrade, and no unexpected flags on files afterwards. |
I'm doing a bunch of updates using pkg 1.4.6 on FreeBSD 8.4-RELEASE-p19 i386. It's failing repeatedly (I fix one problem and another appears further on) with errors like this:
So I used truss just to confirm that it was actually a rename failing:
So I thought I'd check the flags for the files in that directory:
So it has the
sunlnk
flag set on the temporary file. And just to confirm this is the problem:So how did the sunlnk flag get there in the first place? Is this a bug? There seem to have been a number of changes to https://github.com/freebsd/pkg/commits/1.4.6/libpkg/pkg_add.c recently in this area so hopefully @bapt has some ideas what's going on.
Happy to provide further info.
The text was updated successfully, but these errors were encountered: