Skip to content
Snippets Groups Projects
Commit a76f826d authored by Yuri Victorovich's avatar Yuri Victorovich
Browse files

www/yt-dlp: Simplify patches

-U now refuses to work and recommends to use the package manager
instead of being patched out entirely.
parent 7a64d4dd
No related branches found
No related tags found
No related merge requests found
PORTNAME= yt-dlp
DISTVERSION= 2022.06.22.1
PORTREVISION= 1
CATEGORIES= www
MAINTAINER= yuri@FreeBSD.org
......
--- yt_dlp/__init__.py.orig 2022-06-22 00:50:42 UTC
+++ yt_dlp/__init__.py
@@ -879,20 +879,20 @@ def _real_main(argv=None):
return
with YoutubeDL(ydl_opts) as ydl:
- pre_process = opts.update_self or opts.rm_cachedir
+ pre_process = opts.rm_cachedir
actual_use = all_urls or opts.load_info_filename
if opts.rm_cachedir:
ydl.cache.remove()
- updater = Updater(ydl)
- if opts.update_self and updater.update() and actual_use:
- if updater.cmd:
- return updater.restart()
- # This code is reachable only for zip variant in py < 3.10
- # It makes sense to exit here, but the old behavior is to continue
- ydl.report_warning('Restart yt-dlp to use the updated version')
- # return 100, 'ERROR: The program must exit for the update to complete'
+ #updater = Updater(ydl)
+ #if opts.update_self and updater.update() and actual_use:
+ # if updater.cmd:
+ # return updater.restart()
+ # # This code is reachable only for zip variant in py < 3.10
+ # # It makes sense to exit here, but the old behavior is to continue
+ # ydl.report_warning('Restart yt-dlp to use the updated version')
+ # # return 100, 'ERROR: The program must exit for the update to complete'
if not actual_use:
if pre_process:
--- yt_dlp/options.py.orig 2022-06-22 01:17:57 UTC
+++ yt_dlp/options.py
@@ -313,10 +313,6 @@ def create_parser():
action='version',
help='Print program version and exit')
general.add_option(
- '-U', '--update',
- action='store_true', dest='update_self',
- help='Update this program to latest version')
- general.add_option(
'--no-update',
action='store_false', dest='update_self',
help='Do not update (default)')
- this patch prevents -U from updating yt-dlp - it makes it "unrecognized"
--- yt_dlp/update.py.orig 2022-06-22 01:54:04 UTC
+++ yt_dlp/update.py
@@ -29,7 +29,7 @@ def _get_variant_and_executable_path():
path = os.path.dirname(__file__)
if isinstance(__loader__, zipimporter):
- return 'zip', os.path.join(path, '..')
+ return 'unknown', os.path.join(path, '..')
elif (os.path.basename(sys.argv[0]) in ('__main__.py', '-m')
and os.path.exists(os.path.join(path, '../.git/HEAD'))):
return 'source', path
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment