Blame SOURCES/texlive-20190410-tlmgr-ignore-warning.patch

4ea8c1
diff -up ./scripts/texlive/tlmgr.pl.ignore-warning ./scripts/texlive/tlmgr.pl
4ea8c1
--- ./scripts/texlive/tlmgr.pl.ignore-warning	2019-05-24 21:35:57.384845754 -0400
4ea8c1
+++ ./scripts/texlive/tlmgr.pl	2019-05-24 21:39:32.703577109 -0400
4ea8c1
@@ -231,6 +231,7 @@ my %action_specification = (
4ea8c1
       "dry-run|n" => 1,
4ea8c1
       "file" => 1,
4ea8c1
       "force" => 1,
4ea8c1
+      "ignore-warning" => 1,
4ea8c1
       "no-depends"        => 1,
4ea8c1
       "no-depends-at-all" => 1,
4ea8c1
       "reinstall" => 1,
4ea8c1
@@ -331,6 +332,7 @@ my %action_specification = (
4ea8c1
       "dry-run|n" => 1,
4ea8c1
       "exclude" => "=s@",
4ea8c1
       "force" => 1,
4ea8c1
+      "ignore-warning" => 1,
4ea8c1
       "list" => 1,
4ea8c1
       "no-auto-install"            => 1,
4ea8c1
       "no-auto-remove"             => 1,
4ea8c1
@@ -2613,6 +2615,15 @@ sub upd_info {
4ea8c1
 }
4ea8c1
 
4ea8c1
 sub action_update {
4ea8c1
+  if (!($opts{"ignore-warning"})) {
4ea8c1
+    print("*** WARNING ***: Performing this action will likely destroy the Fedora TeXLive install on your system.\n");
4ea8c1
+    print("*** WARNING ***: This is almost NEVER what you want to do.\n");
4ea8c1
+    print("*** WARNING ***: Try using dnf install/update instead.\n");
4ea8c1
+    print("*** WARNING ***: If performing this action is really what you want to do, pass the \"ignore-warning\" option.\n");
4ea8c1
+    print("*** WARNING ***: But please do not file any bugs with the OS Vendor.\n");
4ea8c1
+    exit;
4ea8c1
+  }
4ea8c1
+
4ea8c1
   init_local_db(1);
4ea8c1
   $opts{"no-depends"} = 1 if $opts{"no-depends-at-all"};
4ea8c1
 
4ea8c1
@@ -3618,6 +3629,15 @@ sub check_announce_format_triggers {
4ea8c1
 # anymore!  That has all to be done by the caller.
4ea8c1
 #
4ea8c1
 sub action_install {
4ea8c1
+  if (!($opts{"ignore-warning"})) {
4ea8c1
+    print("*** WARNING ***: Performing this action will likely destroy the Fedora TeXLive install on your system.\n");
4ea8c1
+    print("*** WARNING ***: This is almost NEVER what you want to do.\n");
4ea8c1
+    print("*** WARNING ***: Try using dnf install/update instead.\n");
4ea8c1
+    print("*** WARNING ***: If performing this action is really what you want to do, pass the \"ignore-warning\" option.\n");
4ea8c1
+    print("*** WARNING ***: But please do not file any bugs with the OS Vendor.\n");
4ea8c1
+    exit;
4ea8c1
+  } 
4ea8c1
+
4ea8c1
   init_local_db(1);
4ea8c1
   my $ret = $F_OK;
4ea8c1
   return ($F_ERROR) if !check_on_writable();
4ea8c1
@@ -8151,6 +8171,13 @@ If updates to C<tlmgr> itself (or other
4ea8c1
 infrastructure) are present, C<tlmgr> will bail out and not perform the
4ea8c1
 installation unless this option is given.  Not recommended.
4ea8c1
 
4ea8c1
+=item B<--ignore-warning>
4ea8c1
+
4ea8c1
+The tlmgr tool can really ruin a Fedora install of TeXLive.
4ea8c1
+We have added a warning check here to try to keep you from
4ea8c1
+blindly following a tutorial and doing this. If you still want to
4ea8c1
+proceed, just use this option.
4ea8c1
+
4ea8c1
 =item B<--no-depends>
4ea8c1
 
4ea8c1
 Do not install dependencies.  (By default, installing a package ensures
4ea8c1
@@ -8846,6 +8873,13 @@ In short:
4ea8c1
 Nothing is actually installed; instead, the actions to be performed are
4ea8c1
 written to the terminal.  This is a more detailed report than C<--list>.
4ea8c1
 
4ea8c1
+=item B<--ignore-warning>
4ea8c1
+
4ea8c1
+The tlmgr tool can really ruin a Fedora install of TeXLive.
4ea8c1
+We have added a warning check here to try to keep you from
4ea8c1
+blindly following a tutorial and doing this. If you still want to
4ea8c1
+proceed, just use this option.
4ea8c1
+
4ea8c1
 =item B<--list> [I<pkg>]
4ea8c1
 
4ea8c1
 Concisely list the packages which would be updated, newly installed, or