summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexis Hildebrandt <afh@surryhill.net>2023-12-06 12:08:01 +0100
committerAlexis Hildebrandt <afh@surryhill.net>2023-12-06 12:08:01 +0100
commit11b8e048d3ae5fe922bc9007425fd6b709bde5b5 (patch)
treef56e230c3122b744c5bf1ddc0512e7482797b999
parent63dc7e9517968f315b95ac0c445b9668b77de794 (diff)
downloadfork-ledger-11b8e048d3ae5fe922bc9007425fd6b709bde5b5.tar.gz
fork-ledger-11b8e048d3ae5fe922bc9007425fd6b709bde5b5.tar.bz2
fork-ledger-11b8e048d3ae5fe922bc9007425fd6b709bde5b5.zip
acprep: Simplify detecting system via os.uname
-rwxr-xr-xacprep23
1 files changed, 2 insertions, 21 deletions
diff --git a/acprep b/acprep
index 786bc63a..6ec372f8 100755
--- a/acprep
+++ b/acprep
@@ -358,25 +358,6 @@ class PrepareBuild(CommandLineApp):
self.log.error("Execution failed: " + e)
sys.exit(1)
- def get_stdout(self, *args):
- try:
- self.log.debug('Executing command: ' + ' '.join(args))
-
- proc = Popen(args, shell=False, stdout=PIPE)
- stdout = proc.stdout.read()
- retcode = proc.wait()
- if retcode < 0:
- self.log.error("Child was terminated by signal",
- -retcode)
- sys.exit(1)
- elif retcode != 0:
- self.log.error("Execution failed: " + ' '.join(args))
- sys.exit(1)
- return stdout[:-1]
- except OSError as e:
- self.log.error("Execution failed:" + e)
- sys.exit(1)
-
def isnewer(self, file1, file2):
"Check if file1 is newer than file2."
if not exists(file2):
@@ -502,7 +483,7 @@ class PrepareBuild(CommandLineApp):
self.log.info("Installing Ledger's build dependencies ...")
- system = self.get_stdout('uname', '-s').decode(locale.getpreferredencoding())
+ system = os.uname().sysname
if system == 'Darwin':
if exists('/opt/local/bin/port'):
@@ -823,7 +804,7 @@ class PrepareBuild(CommandLineApp):
self.configure_args.append(self.source_dir)
def setup_for_system(self):
- system = self.get_stdout('uname', '-s').decode(locale.getpreferredencoding())
+ system = os.uname().sysname
self.log.info('System type is => ' + system)
if self.options.enable_doxygen: