summaryrefslogtreecommitdiff
path: root/debian/patches/0039-Enforce-Debian-assumptions.patch
blob: 0b16e697c8dd85be74c6de7ce44f14d4b3967e08 (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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
From: Didier Raboud <odyx@debian.org>
Date: Sat, 21 Sep 2019 19:02:07 +0200
Subject: Enforce Debian assumptions:

- The distro version is supported
- Auto installation is not allowed
- Do not allow the installer to install "missing" packages by itself
---
 installer/core_install.py | 109 +++-------------------------------------------
 1 file changed, 5 insertions(+), 104 deletions(-)

diff --git a/installer/core_install.py b/installer/core_install.py
index 6ea0131..a93df2b 100644
--- a/installer/core_install.py
+++ b/installer/core_install.py
@@ -2047,34 +2047,12 @@ class CoreInstall(object):
             return True
 
     def validate_distro_version(self):
-        if self.validate_disto():
-            for vers in self.distros[self.distro_name]['versions']:
-                if self.distro_version == vers:
-                    return True
-
-        return False
+        # It's shipped in Debian. It's supported.
+        return True
 
     def is_auto_installer_support(self, distro_version=DISTRO_VER_UNKNOWN):
-        if not self.distro_name:
-            self.get_distro()
-            try:
-                self.distro_name = self.distros_index[self.distro]
-            except KeyError:
-                log.debug("Auto installation is not supported as Distro Name can't find for distro index [%d]." % (
-                    self.distro))
-                return False
-
-        if distro_version == DISTRO_VER_UNKNOWN:
-            distro_version = self.distro_version
-
-        if self.distro != DISTRO_UNKNOWN and distro_version != DISTRO_VER_UNKNOWN and self.get_ver_data('supported', False, distro_version):
-            log.debug("Auto installation is supported for Distro =%s version =%s " % (
-                self.distro_name, distro_version))
-            return True
-        else:
-            log.debug("Auto installation is not supported for Distro =%s version =%s " % (
-                self.distro_name, distro_version))
-            return False
+        # No auto install ever.
+        return False
 
     # Uninstalls the HPLIP package.
     # Input:
@@ -2412,83 +2390,6 @@ class CoreInstall(object):
             log.info("No missing dependencies")
             return 0
 
-        if mode == INTERACTIVE_MODE:
-            ok, user_input = tui.enter_choice(
-                "Do you want to update repository and Install missing/incompatible packages. (a=install all*, c=custom_install, s=skip):", ['a', 'c', 's'], 'a')
-            if not ok or user_input == 'q':
-                return 1
-            elif user_input == 's':
-                log.info(
-                    log.bold("Install manually above missing/incompatible packages."))
-            else:
-                self.close_package_managers()
-
-                log.info(log.bold("Updating repository"))
-                log.info(log.bold('-' * len("Updating repository")))
-                if pre_depend_cmd:
-                    for cmd in pre_depend_cmd:
-                        log.info("cmd =%s" % (cmd))
-                        sts, out = utils.run(cmd, self.passwordObj)
-                        if sts != 0 or "Failed" in out:
-                            log.warn(
-                                "Failed to update Repository, check if any update/installation is running.")
-
-                if user_input == 'c':
-                    log.info(log.bold("Installing missing/incompatible packages"))
-                    log.info(
-                        log.bold('-' * len("Installing missing/incompatible packages")))
-                    for d in overall_install_cmds:
-                        ok, user_input = tui.enter_choice(
-                            "Do you want to install '%s' package?(y=yes*, n=no):" % d, ['y', 'n'], 'y')
-                        if ok and user_input == 'y':
-                            if 'hpaio' in overall_install_cmds[d]:
-                                self.update_hpaio()
-                            else:
-                                log.info("cmd =%s" % overall_install_cmds[d])
-                                sts, out = utils.run(overall_install_cmds[
-                                                     d], self.passwordObj)
-                                if sts != 0 or "Failed" in out:
-                                    log.error(
-                                        "Failed to install '%s' package, please install manually. " % d)
-                    if 'cups' in d:
-                        if not services.start_service('cups', self.passwordObj):
-                            log.error(
-                                "Failed to start CUPS service. Please start CUPS manually or restart system.")
-                    for cmd in missing_cmd:
-                        ok, user_input = tui.enter_choice(
-                            "Do you want to run '%s' command?(y=yes*, n=no):" % d, ['y', 'n'], 'y')
-                        if ok and user_input == 'y':
-                            sts, out = utils.run(cmd, self.passwordObj)
-                            if sts != 0 or "Failed" in out:
-                                log.error(
-                                    "Failed to run '%s' command, please run manually. " % d)
-
-                elif user_input == 'a':
-                    log.info(log.bold("Installing Missing/Incompatible packages"))
-                    log.info(
-                        log.bold('-' * len("Installing Missing/Incompatible packages")))
-                    for d in overall_install_cmds:
-                        if 'hpaio' in overall_install_cmds[d]:
-                            self.update_hpaio()
-                        else:
-                            log.info("cmd =%s" % overall_install_cmds[d])
-                            sts, out = utils.run(overall_install_cmds[
-                                                 d], self.passwordObj)
-                            if sts != 0 or "Failed" in out:
-                                log.error(
-                                    "Failed to install '%s' package, please install manually. " % d)
-                    if 'cups' in d:
-                        if not services.start_service('cups', self.passwordObj):
-                            log.error(
-                                "Failed to start CUPS sevice. Please start CUPS manually or restart system.")
-                    for cmd in missing_cmd:
-                        sts, out = utils.run(cmd, self.passwordObj)
-                        if sts != 0 or "Failed" in out:
-                            log.error(
-                                "Failed to run '%s' command, please run manually. " % d)
-
-        else:
-            log.error("GUI is not yet supported..1")
-            # TBD
+        # Do not allow HPLIP to run APT or anything else, especially not as root.
 
         return 0