[opensuse-bugs] [Bug 1179023] New: quilt: setup with specfile with symlink in cwd path fails
https://bugzilla.suse.com/show_bug.cgi?id=1179023 Bug ID: 1179023 Summary: quilt: setup with specfile with symlink in cwd path fails Classification: openSUSE Product: openSUSE Distribution Version: Leap 15.2 Hardware: Other OS: Other Status: NEW Severity: Normal Priority: P5 - None Component: Other Assignee: jdelvare@suse.com Reporter: amajer@suse.com QA Contact: qa-bugs@suse.de Found By: --- Blocker: --- cd /tmp osc co openSUSE:Factory quilt cd openSUSE:Factory/quilt quilt setup --fast *.spec cat quilt-0.66/series -- Good series file here cd /tmp ln -s /tmp foo cd /tmp/foo/openSUSE:Factory/quilt quilt setup --fast *.spec cat quilt-0.66/series -- Absolute paths here?? cd quilt-0.66 quilt push -a -- fails to apply I would expect symlinks not to be resolved in the path that has nothing to do with the sources. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1179023 https://bugzilla.suse.com/show_bug.cgi?id=1179023#c1 Jean Delvare <jdelvare@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |CONFIRMED --- Comment #1 from Jean Delvare <jdelvare@suse.com> --- Thanks for the reproducer. I'm looking into this. I vaguely remember that I had to use absolute paths in some cases but I can't remember the details. Anyway, the fact that generated series file can't be applied is clearly not acceptable. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1179023 https://bugzilla.suse.com/show_bug.cgi?id=1179023#c2 Jean Delvare <jdelvare@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|CONFIRMED |IN_PROGRESS --- Comment #2 from Jean Delvare <jdelvare@suse.com> --- So here is what happens. "quilt setup" calls rpmbuild to process the spec file, and intercepts all the calls to tar, patch and the like to setup the working directory and generate the series file. It turns out that, when there is a symbolic link on the way to the patch files (as in your second example), rpmbuild apparently resolves the link before passing the result to the patch command. So when quilt gets the information, it's already too late, we have lost track of the original path of the patch file. "quilt setup" gets the patch file name as an absolute path in both cases. It would normally strip the prefix at this point, so that the patch file name is a relative path in the series file (typically just the name of the file, in the simple case, as in your first example). Here it fails because the prefix of the patch file name and the prefix of the working directory do not match. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1179023 https://bugzilla.suse.com/show_bug.cgi?id=1179023#c3 --- Comment #3 from Jean Delvare <jdelvare@suse.com> --- Created attachment 843805 --> https://bugzilla.suse.com/attachment.cgi?id=843805&action=edit [PATCH] inspect-wrapper: Resolve links in source path if rpmbuild did so Candidate fix. I did not resolve the paths unconditionally because I'm not sure if rpmbuild always did that, and always will. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1179023 https://bugzilla.suse.com/show_bug.cgi?id=1179023#c4 Jean Delvare <jdelvare@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |amajer@suse.com Flags| |needinfo?(amajer@suse.com) --- Comment #4 from Jean Delvare <jdelvare@suse.com> --- Please test the package in: https://build.opensuse.org/package/show/home:jdelvare:branches:devel:tools:s... Thanks. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1179023 https://bugzilla.suse.com/show_bug.cgi?id=1179023#c5 Jean Delvare <jdelvare@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Flags|needinfo?(amajer@suse.com) | --- Comment #5 from Jean Delvare <jdelvare@suse.com> --- After further analysis, it turns out that rpmbuild is not to blame. The resolution of symbolic links is done by the kernel itself when we figure out (via procfs) the path to the patch file which was passed to the patch utility through stdin. Illustration: $ readlink /proc/self/fd/0 < /tmp/foo/openSUSE:Factory/quilt/expand.diff /tmp/openSUSE:Factory/quilt/expand.diff So a better fix is possible. Working on it. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1179023 https://bugzilla.suse.com/show_bug.cgi?id=1179023#c6 --- Comment #6 from Adam Majer <amajer@suse.com> --- (In reply to Jean Delvare from comment #4)
Please test the package in:
https://build.opensuse.org/package/show/home:jdelvare:branches:devel:tools: scm/quilt
Thanks.
This is working :) I'll test again when you have the better solution too -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1179023 https://bugzilla.suse.com/show_bug.cgi?id=1179023#c7 Jean Delvare <jdelvare@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #843805|0 |1 is obsolete| | --- Comment #7 from Jean Delvare <jdelvare@suse.com> --- Created attachment 843838 --> https://bugzilla.suse.com/attachment.cgi?id=843838&action=edit [PATCH] inspect-wrapper: procfs resolves links -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1179023 Jean Delvare <jdelvare@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #843838|[PATCH] inspect-wrapper: |[PATCH v2] inspect-wrapper: description|procfs resolves links |procfs resolves links -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1179023 https://bugzilla.suse.com/show_bug.cgi?id=1179023#c8 --- Comment #8 from Adam Majer <amajer@suse.com> --- (In reply to Jean Delvare from comment #7)
Created attachment 843838 [details] [PATCH v2] inspect-wrapper: procfs resolves links
Seems to be working for my usecase with this patch. Thanks! -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1179023 https://bugzilla.suse.com/show_bug.cgi?id=1179023#c9 --- Comment #9 from Jean Delvare <jdelvare@suse.com> --- You're welcome. I'll get it upstream, and then update the package in OBS. I have another fix I'm working on for a different bug, I'll do a single update with both. -- You are receiving this mail because: You are on the CC list for the bug.
https://bugzilla.suse.com/show_bug.cgi?id=1179023 https://bugzilla.suse.com/show_bug.cgi?id=1179023#c10 Jean Delvare <jdelvare@suse.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|IN_PROGRESS |RESOLVED Resolution|--- |FIXED --- Comment #10 from Jean Delvare <jdelvare@suse.com> --- Fixed in Tumbleweed long ago, closing. -- You are receiving this mail because: You are on the CC list for the bug.
participants (1)
-
bugzilla_noreply@suse.com