Maybe I'm missing something, but putting patches in /etc/portage/patches/net-misc/yt-dlp-2023.07.06/, one of the hunks from one of the patches does not seem to get applied, even though only an probably-unrelated warning is output. Reproducible: Always Steps to Reproduce: 1. mkdir -p /etc/portage/patches/net-misc/yt-dlp-2023.07.06/ 2. Put patches in /etc/portage/patches/net-misc/yt-dlp-2023.07.06/ 3. ebuild /usr/portage/net-misc/yt-dlp/yt-dlp-2023.07.06.ebuild prepare Actual Results: >>> Preparing source in /var/tmp/portage/net-misc/yt-dlp-2023.07.06/work/yt-dlp ... * =============================================================================================================================================================================================================== * Applying user patches from /etc/portage/patches ... * Applying 7564.diff ... patching file yt_dlp/extractor/facebook.py Hunk #1 succeeded at 23 with fuzz 2 (offset -1 lines). [ ok ] * Applying 7890.diff ... [ ok ] * User patches applied. * =============================================================================================================================================================================================================== But chunk 8 in 7564.diff hasn't been applied, and grep doesn't find "short_form_video_context" anywhere in the extracted source: @@ -497,6 +515,13 @@ def extract_relay_prefetched_data(_filter): entries = [] def parse_graphql_video(video): + v_id = video.get('videoId') or video.get('id') or video_id + reel_info = traverse_obj( + video, ('creation_story', 'short_form_video_context', 'playback_video', {dict})) + if reel_info: + video = video['creation_story'] + video['owner'] = traverse_obj(video, ('short_form_video_context', 'video_owner')) + video.update(reel_info) formats = [] q = qualities(['sd', 'hd']) for key, format_id in (('playable_url', 'sd'), ('playable_url_quality_hd', 'hd'), Expected Results: All hunks applied or error printed.
Created attachment 868832 [details, diff] 7564.diff (goes in /etc/portage/patches/net-misc/yt-dlp-2023.07.06/)
Created attachment 868833 [details, diff] 7890.diff (goes in /etc/portage/patches/net-misc/yt-dlp-2023.07.06/)
Haven't looked closely but maybe patch is malformed, this is reproducible without portage, e.g. $ tar -xf /var/cache/distfiles/yt-dlp-2023.07.06.tar.gz $ cd yt-dlp $ patch -p1 < ~/7564.diff patching file yt_dlp/extractor/facebook.py Hunk #1 succeeded at 23 with fuzz 2 (offset -1 lines). $ grep -r short_form_video_context . (no match) I'd rebase it and make a clean patch using the current source, then try to apply that. Alternatively you could use yt-dlp-9999 live ebuild if it's fixes that are already upstreamed.
(In reply to Ionen Wolkens from comment #3) > Haven't looked closely but maybe patch is malformed [...] Which sounds likely, instead I tried to get: https://github.com/yt-dlp/yt-dlp/pull/7564.patch and then $ patch -p1 < ~/7564.patch patching file yt_dlp/extractor/facebook.py patching file yt_dlp/extractor/facebook.py patching file yt_dlp/extractor/facebook.py patching file yt_dlp/extractor/facebook.py patching file yt_dlp/extractor/facebook.py patching file yt_dlp/extractor/facebook.py patching file yt_dlp/extractor/facebook.py $ grep -r short_form_video_context . ./yt_dlp/extractor/facebook.py: video, ('creation_story', 'short_form_video_context', 'playback_video', {dict})) ./yt_dlp/extractor/facebook.py: video['owner'] = traverse_obj(video, ('short_form_video_context', 'video_owner'))
In that case, a feature request would be to print a warning/error if possible, if a patch is malformed.
I think you probably want to file a bug upstream for patch itself.
Yeah, ultimately patch(1) did not report an error. Portage would abort if it did.