Skip to content

Commit

Permalink
gdal_calc python target?
Browse files Browse the repository at this point in the history
  • Loading branch information
sllynn committed Nov 29, 2024
1 parent ddc9e94 commit d803841
Showing 1 changed file with 12 additions and 9 deletions.
21 changes: 12 additions & 9 deletions python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,9 +70,12 @@ def run(self):
if not self.am_root():
prepend.append("sudo")

env = os.environ.copy()
env.pop("PYTHONPATH")

# Install base dependencies
subprocess.check_call(prepend + ["apt-get", "update"])
subprocess.check_call(prepend + ["apt-get", "install", "-y", *self.required_os_packages])
subprocess.check_call(prepend + ["apt-get", "update"], env=env)
subprocess.check_call(prepend + ["apt-get", "install", "-y", *self.required_os_packages], env=env)

# Install the .deb file
deb_file = os.path.join(
Expand All @@ -82,13 +85,13 @@ def run(self):
if os.path.exists(deb_file):
try:
# Run dpkg to install the .deb file
try:
subprocess.check_call(prepend + ["dpkg", "-i", deb_file])
except subprocess.CalledProcessError as e:
subprocess.check_call(
prepend + ["apt-get", "install", "-f", "-y"]
) # Fix dependencies if needed
subprocess.check_call(prepend + ["dpkg", "-i", deb_file])
# try:
subprocess.check_call(prepend + ["dpkg", "-i", deb_file])
# except subprocess.CalledProcessError as e:
# subprocess.check_call(
# prepend + ["apt-get", "install", "-f", "-y"]
# ) # Fix dependencies if needed
# subprocess.check_call(prepend + ["dpkg", "-i", deb_file])
except subprocess.CalledProcessError as e:
print(f"Error installing .deb package: {e}")
sys.exit(1)
Expand Down

0 comments on commit d803841

Please sign in to comment.