mirror of
https://gitlab.freedesktop.org/NetworkManager/NetworkManager.git
synced 2026-01-06 07:20:14 +01:00
ifcfg: test for sysconfig network path also on meson
In a recent commit 1402fa7487 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
This commit is contained in:
parent
f3b4053a91
commit
08a9109459
2 changed files with 4 additions and 18 deletions
|
|
@ -1,11 +0,0 @@
|
|||
#!/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)
|
||||
11
meson.build
11
meson.build
|
|
@ -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'
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue