---- steam-launcher/bin_steamdeps.py.orig 2020-06-15 16:29:37.582721048 +0200
-+++ steam-launcher/bin_steamdeps.py 2020-06-15 16:58:54.551881214 +0200
-@@ -20,24 +20,92 @@
+--- steam-launcher/bin_steamdeps.py.orig 2020-06-24 12:36:09.000000000 +0200
++++ steam-launcher/bin_steamdeps.py 2020-06-24 13:18:56.355636195 +0200
+@@ -27,24 +27,92 @@
# This is the set of supported dependency formats
SUPPORTED_STEAM_DEPENDENCY_VERSION = ['1']
###
-@@ -50,31 +118,32 @@
- else:
- return name
-
--
- #
- # Check to see if another package Provides this package
+@@ -61,16 +129,27 @@
# N.B. Version checks are not supported on virtual packages
#
def is_provided(pkgname):
-- try:
-- process = subprocess.Popen(['apt-cache', 'showpkg', pkgname],
-- stdout=subprocess.PIPE,
-- stderr=subprocess.PIPE)
-- pattern = re.compile(r'^Reverse Provides:')
-- providers = {}
-- for line in process.stdout:
-- if re.match(pattern, str(line, 'utf-8')):
-- for provider in process.stdout:
-- (name, version) = provider.split()
-- providers[name] = version
-- for provider in providers.keys():
-- if has_package(provider):
-- return True
-- return False
-- except (OSError, FileNotFoundError):
-- return False
+- """
+- Check to see if another package Provides this package
+- """
+- cache = apt.Cache()
+- pkgs = cache.get_providing_packages(pkgname)
+- for pkg in pkgs:
+- if pkg.is_installed:
+- return True
- return False
+ if ":" in pkgname:
+ pkgname, arch = pkgname.split(":", 1)
+ else:
+ arch = None
-+
+
+ if pkgname.startswith("@"):
+ pkgname = pkgname[1:]
-
++
+ process = subprocess.Popen(['rpm', '-q', '--what-provides', pkgname],
+ stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+ for line in process.stdout:
###
class Package:
-@@ -96,9 +165,17 @@
+@@ -92,9 +171,17 @@
return is_provided(self.name)
for (op, version) in self.version_conditions:
return True
-@@ -111,18 +188,7 @@
-
- ###
- def has_package(package):
-- process = subprocess.Popen(['dpkg', '-l', package], stdout=subprocess.PIPE,
-- stderr=subprocess.PIPE)
-- installed_pattern = re.compile(r"^\Si\s+([^\s]+)\s+([^\s]+)")
-- for line in process.stdout:
-- line = line.decode("utf-8").strip()
-- match = re.match(installed_pattern, line)
-- if match is None:
-- continue
--
-- return True
-- return False
--
-+ return is_provided(package)
-
- def is_glvnd():
- try:
-@@ -139,6 +205,7 @@
+@@ -120,6 +207,7 @@
def remap_package(name):
if name in (
'python-apt',
):
-@@ -218,10 +285,13 @@
- """
- if "DISPLAY" in os.environ:
+@@ -224,6 +312,8 @@
programs = [
-- ("gnome-terminal",
-- ["gnome-terminal", "--disable-factory", "-t", title, "-e"]),
-+ # PLD: --disable-factory doesn't work any more
-+ #("gnome-terminal",
-+ # ["gnome-terminal", "--disable-factory", "-t", title, "-e"]),
("konsole",
["konsole", "--nofork", "-p", "tabtitle=" + title, "-e"]),
+ ("Terminal",
+ ["Terminal", "--disable-server", "--title"+title, "-x"]),
("xterm",
["xterm", "-bg", "#383635", "-fg", "#d1cfcd", "-T", title, "-e"]),
- (
-@@ -230,7 +300,7 @@
+ ("x-terminal-emulator",
+@@ -240,7 +330,7 @@
]
for (program, commandLine) in programs:
if subprocess.call(['which', program],
return commandLine
# Fallback if no GUI terminal program is available
-@@ -245,17 +315,21 @@
+@@ -255,17 +345,21 @@
to do this, but nothing that exists yet does what we need.
"""
# If your host file is misconfigured in certain circumstances this
# can cause sudo to block for a while, which causes gksudo to go into
# limbo and never return.
-@@ -272,31 +346,30 @@
+@@ -282,31 +376,30 @@
else
return 0
fi
os.write(fd, script.encode("utf-8"))
os.close(fd)
os.chmod(script_file, (stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR))
-@@ -307,6 +380,7 @@
+@@ -317,6 +410,7 @@
except KeyboardInterrupt:
pass
os.unlink(script_file)
# Read the status out of the file, since if we ran the script in a
# terminal the process status will be whether the terminal started
-@@ -318,6 +392,9 @@
+@@ -328,6 +422,9 @@
os.unlink(status_file)
return status
-@@ -345,11 +422,11 @@
+@@ -355,11 +452,11 @@
"STEAM_DEPENDENCY_VERSION"])
return False
"your distribution.\n")
return False
-@@ -365,7 +442,11 @@
+@@ -375,7 +472,11 @@
sys.stderr.write("Usage: %s dependencies.txt\n" % sys.argv[0])
return 1
try:
fp = open(sys.argv[1])
except Exception as e:
-@@ -404,10 +485,20 @@
+@@ -414,10 +515,20 @@
row = []
for section in line.split("|"):
packages[package.name] = package
row.append(package)
-@@ -435,22 +526,28 @@
+@@ -445,22 +556,28 @@
if "COLUMNS" in os.environ:
del os.environ["COLUMNS"]
for row in dependencies:
if len(row) == 0:
continue
-@@ -461,7 +558,10 @@
+@@ -471,7 +588,10 @@
satisfied = True
break
if not satisfied:
# If we have anything to install, do it!
if len(needed) > 0:
-@@ -475,7 +575,12 @@
+@@ -485,7 +605,12 @@
print("Package %s needs to be installed" % package.name,
file=sys.stderr)