Commit 08a91094 authored by Inigo Martínez's avatar Inigo Martínez Committed by Thomas Haller

ifcfg: test for sysconfig network path also on meson

In a recent commit 1402fa74 a new
way for testing Red Hat compatible distributions had been added.

However, this new approach does not use a set of files, it uses a
directory, so this test can be done by using the `test` command
and makes the `check_distro.py` script unnecessary.

https://mail.gnome.org/archives/networkmanager-list/2018-January/msg00031.html
parent f3b4053a
#!/usr/bin/env python3
import errno
import os
import sys
for location in sys.argv[1:]:
if os.path.isfile(location):
sys.exit(0)
sys.exit(errno.ENOENT)
......@@ -219,16 +219,13 @@ glib_dep = declare_dependency(
]
)
check_distro = join_paths(meson.source_root(), 'check-distro.py')
redhat_releases = ['/etc/redhat-release', '/etc/fedora-release', '/etc/mandriva-release']
if run_command(check_distro, redhat_releases).returncode() == 0
if run_command('test', '-e', '/etc/sysconfig/network-scripts').returncode() == 0
distro = 'redhat'
elif run_command(check_distro, '/etc/SuSE-release').returncode() == 0
elif run_command('test', '-e', '/etc/SuSE-release').returncode() == 0
distro = 'suse'
elif run_command(check_distro, '/etc/debian_version').returncode() == 0
elif run_command('test', '-e', '/etc/debian_version').returncode() == 0
distro = 'debian'
elif run_command(check_distro, '/etc/gentoo-release').returncode() == 0
elif run_command('test', '-e', '/etc/gentoo-release').returncode() == 0
distro = 'gentoo'
else
distro = 'unknown'
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment