From nobody Fri May 3 03:29:15 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1643281235; cv=none; d=zohomail.com; s=zohoarc; b=n57nOFL+xIO5OcMguXiKHFoxV7t7xI4MzTvvaPd07m/YSjGCQ+VmhrbWZVTSacBDvhoWQafcOxsibwauuI2MVXtfmnGFumkF0YwKBGQw/pUFJeXMP7OmHoT3iF3B/fRZTWXhpGtn9YJyGwNKCWpBxhWZ8Ahe/vvElsmTpx9yl4c= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643281235; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=Z3V5whYfwm8b23A8rTZzTK1/QxULc/qadGdyxf/WDk8=; b=DIE1jqaLzzXdHqIxi3ZLtf12r862a0eQO1R9o8kAY6BQ6H63xyoT5larMiwTJTX3VyA+VvbEW3XD7DMeetM+W7oZT16o10+/QVnDcTgUy7MEzIvUtVpukg/XWlNn8iAwc+Dpjmmk0xJGVZxj2IAkthlOW+ZIH54dMeQZyJH+Amw= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1643281235455167.06417416777742; Thu, 27 Jan 2022 03:00:35 -0800 (PST) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-650-DZs9gXfNNGuopXbu9izfSg-1; Thu, 27 Jan 2022 06:00:31 -0500 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 07D0883DEB9; Thu, 27 Jan 2022 11:00:26 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9A63D7BB4C; Thu, 27 Jan 2022 11:00:25 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 8920C1809CB8; Thu, 27 Jan 2022 11:00:23 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 20RB0MVu020226 for ; Thu, 27 Jan 2022 06:00:22 -0500 Received: by smtp.corp.redhat.com (Postfix) id 89FAC7B6F5; Thu, 27 Jan 2022 11:00:22 +0000 (UTC) Received: from harajuku.usersys.redhat.com.homenet.telecomitalia.it (unknown [10.40.194.40]) by smtp.corp.redhat.com (Postfix) with ESMTPS id ECD767B6F1 for ; Thu, 27 Jan 2022 11:00:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1643281234; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=Z3V5whYfwm8b23A8rTZzTK1/QxULc/qadGdyxf/WDk8=; b=B9AIDSf95Tg4IUS29RnPI3o7pBt+DiPjQraEuaz7AVM5Cp71hwShOsJjbp4kshp9jgMXSS OPTRSQLx7HEpg2dLRx9TjOYYpf6aG3w+9bLHI/+Dqux7smAe/Ga9anY2RGBcAM2ul7dmi+ y6pzhEEy6HqErPmeucCLH1EWjF4j684= X-MC-Unique: DZs9gXfNNGuopXbu9izfSg-1 From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH v2 1/1] meson: Check for os-release's ID_LIKE in addition to ID Date: Thu, 27 Jan 2022 12:00:18 +0100 Message-Id: <20220127110018.111266-2-abologna@redhat.com> In-Reply-To: <20220127110018.111266-1-abologna@redhat.com> References: <20220127110018.111266-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) X-ZM-MESSAGEID: 1643281237970100003 Content-Type: text/plain; charset="utf-8" This makes it possible to reduce the number of cases we have to consider, because 'sles' declares itself to be like 'suse' and both 'rhel' and 'centos' declare themselves to be like 'fedora'. We have to move the check for Ubuntu before the one for Debian, however, because 'ubuntu' declares itself to be like 'debian' and it would end up with the wrong defaults otherwise. Suggested-by: Olaf Hering Signed-off-by: Andrea Bolognani Reviewed-by: Michal Privoznik --- meson.build | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/meson.build b/meson.build index 0e6f0f22fc..5f49ad0f3e 100644 --- a/meson.build +++ b/meson.build @@ -1665,24 +1665,23 @@ if not get_option('driver_qemu').disabled() qemu_user =3D 'root' qemu_group =3D 'wheel' else - os_release =3D run_command('grep', '^ID=3D', '/etc/os-release', ch= eck: false).stdout() + os_release =3D run_command('grep', '-E', '^ID(_LIKE)*=3D', '/etc/o= s-release', check: false).stdout() if os_release.contains('arch') qemu_user =3D 'nobody' qemu_group =3D 'nobody' - elif (os_release.contains('centos') or - os_release.contains('fedora') or + # RHEL and CentOS both have ID_LIKE=3Dfedora, SLES has ID_LIKE=3Ds= use + elif (os_release.contains('fedora') or os_release.contains('gentoo') or - os_release.contains('rhel') or - os_release.contains('sles') or os_release.contains('suse')) qemu_user =3D 'qemu' qemu_group =3D 'qemu' - elif os_release.contains('debian') - qemu_user =3D 'libvirt-qemu' - qemu_group =3D 'libvirt-qemu' + # Ubuntu has ID_LIKE=3Ddebian so we need to handle it first elif os_release.contains('ubuntu') qemu_user =3D 'libvirt-qemu' qemu_group =3D 'kvm' + elif os_release.contains('debian') + qemu_user =3D 'libvirt-qemu' + qemu_group =3D 'libvirt-qemu' else qemu_user =3D 'root' qemu_group =3D 'root' --=20 2.34.1