summaryrefslogtreecommitdiff
path: root/yt-dlp/debian/patches/0002-Disable-upstream-s-autoupdate-mechanism.patch
blob: 968b1714901722b77e43294e3db0fe7f4ec732af (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
From: Nicolas Braud-Santoni <nicolas@braud-santoni.eu>
Date: Fri, 16 Mar 2018 14:17:40 -0300
Subject: Disable upstream's autoupdate mechanism
MIME-Version: 1.0
Content-Type: text/plain; charset="utf-8"
Content-Transfer-Encoding: 8bit

Description: Remove autoupdate mechanism
Bug-Debian: https://bugs.debian.org/890119
Forwarded: not-needed
Author: Nicolas Braud-Santoni <nicolas@braud-santoni.eu>
Reviewed-by: Rogério Theodoro de Brito <rbrito@gmail.com>
Last-Update: 2021-02-13
---
 README.md          |    3 ---
 yt_dlp/__init__.py |   11 ++++++-----
 yt_dlp/options.py  |    2 +-
 3 files changed, 7 insertions(+), 9 deletions(-)

--- a/README.md	2021-12-01 15:12:20.651056853 -0500
+++ b/README.md	2021-12-01 15:12:20.631057057 -0500
@@ -289,9 +289,6 @@
 ## General Options:
     -h, --help                       Print this help text and exit
     --version                        Print program version and exit
-    -U, --update                     Update this program to latest version. Make
-                                     sure that you have sufficient permissions
-                                     (run with sudo if needed)
     -i, --ignore-errors              Ignore download and postprocessing errors.
                                      The download will be considered successful
                                      even if the postprocessing fails
--- a/yt_dlp/__init__.py	2021-12-01 15:12:20.651056853 -0500
+++ b/yt_dlp/__init__.py	2021-12-01 15:12:20.631057057 -0500
@@ -42,7 +42,6 @@
     std_headers,
     write_string,
 )
-from .update import run_update
 from .downloader import (
     FileDownloader,
 )
@@ -791,10 +790,12 @@
         # Update version
         if opts.update_self:
             # If updater returns True, exit. Required for windows
-            if run_update(ydl):
-                if actual_use:
-                    sys.exit('ERROR: The program must exit for the update to complete')
-                sys.exit()
+            parser.error(
+                "yt-dlp's self-update mechanism is disabled on Debian.\n"
+                "Please update yt-dlp using apt(8).\n"
+                "See https://packages.debian.org/sid/yt-dlp for the "
+                "latest packaged version.\n"
+            )
 
         # Maybe do nothing
         if not actual_use:
--- a/yt_dlp/options.py	2021-12-01 15:12:20.651056853 -0500
+++ b/yt_dlp/options.py	2021-12-01 15:12:20.635057016 -0500
@@ -205,7 +205,7 @@
     general.add_option(
         '-U', '--update',
         action='store_true', dest='update_self',
-        help='Update this program to latest version. Make sure that you have sufficient permissions (run with sudo if needed)')
+        help=optparse.SUPPRESS_HELP)
     general.add_option(
         '-i', '--ignore-errors',
         action='store_true', dest='ignoreerrors',
bgstack15