From nobody Mon Feb 9 19:04:28 2026 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=1658240297; cv=none; d=zohomail.com; s=zohoarc; b=M3IGBRWh+SJDDIXHHvUqmVO9JGOpQS/zFXor92NwmRX//mxtnSKyWfak0vrjaM4nr6OFhHTY4XDxW7B3tH/U4UsyiRj/Bx/lsWI6KjNhGXLkaQVd4DP+FD2Lu365AqzuNnTySmVLEq+ICMdy/tL3QOSRoRY7DQkRdv876Mpsvuw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1658240297; 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=6An7xT914AZz82FFyZQIABDYmVfJKjEA/X7bhUEo1Ds=; b=dvzlcJnYelguwmJpVB3CbtNgqDVDXmhdQALEOZFvkkwoeM1RREUQ7c/Rs2+Xxcek1rhJ0081lGJ7gIDlqp38++XNZ02sH7bUWPz3Y+fLpm/pACjdYgJavfeVoLzqGFffyam06/XKvPVZ/wR5V1GGAcK834aVAbTMxpL7zfjar7E= 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 1658240297547507.5704913938989; Tue, 19 Jul 2022 07:18:17 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-674-xaSnbrGLNT27THyxUMBp4A-1; Tue, 19 Jul 2022 10:18:12 -0400 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id B4F651C05ED3; Tue, 19 Jul 2022 14:17:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (unknown [10.30.29.100]) by smtp.corp.redhat.com (Postfix) with ESMTP id A0035C2811A; Tue, 19 Jul 2022 14:17:50 +0000 (UTC) Received: from mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (localhost [IPv6:::1]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8202B1947070; Tue, 19 Jul 2022 14:17:50 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx10.intmail.prod.int.rdu2.redhat.com [10.11.54.10]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 8D1051945DA7 for ; Tue, 19 Jul 2022 14:17:49 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 6DB66401E54; Tue, 19 Jul 2022 14:17:49 +0000 (UTC) Received: from harajuku.redhat.com (unknown [10.40.195.71]) by smtp.corp.redhat.com (Postfix) with ESMTPS id F08D8492C3B for ; Tue, 19 Jul 2022 14:17:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1658240296; 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=6An7xT914AZz82FFyZQIABDYmVfJKjEA/X7bhUEo1Ds=; b=fUm8C+cDJpCciDVKnved1eQucNcE1wgaukISC+Ceulxuzmz6hUAQq4z/vn62ibj4Zh43oy 6ovNpAG/3wPJYkR3o3HDC0nK9xmxd1k6RvHggM4QiEiCfIDr2zgjKeieXclIyYWVaLyQDw AgjsvTc5J+JhUa33Bp7an97VIGSBw7E= X-MC-Unique: xaSnbrGLNT27THyxUMBp4A-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 2/3] scripts: Add $DESTDIR support to meson-install-web.py Date: Tue, 19 Jul 2022 16:17:44 +0200 Message-Id: <20220719141745.220912-3-abologna@redhat.com> In-Reply-To: <20220719141745.220912-1-abologna@redhat.com> References: <20220719141745.220912-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.10 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: libvir-list-bounces@redhat.com Sender: "libvir-list" X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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: 1658240298296100002 Content-Type: text/plain; charset="utf-8" meson already supports $DESTDIR natively, but in this case we're using a custom script and so we have to do some extra work ourselves. Signed-off-by: Andrea Bolognani --- scripts/meson-install-web.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/scripts/meson-install-web.py b/scripts/meson-install-web.py index fdf407ba33..e7456fa750 100755 --- a/scripts/meson-install-web.py +++ b/scripts/meson-install-web.py @@ -6,10 +6,23 @@ import sys =20 from pathlib import Path =20 +destdir =3D os.getenv('DESTDIR') +if destdir: + destdir =3D Path(destdir) + if not destdir.is_absolute(): + print('$DESTDIR must be an absolute path') + sys.exit(1) + for desc in sys.argv[1:]: inst =3D desc.split(':') src =3D Path(inst[0]) dst =3D Path(inst[1]) =20 + if destdir: + # Turn dst into a relative path by dropping its first component + # and append it to destdir to obtain the absolute destination + # path that respects the value $DESTDIR found in the environment + dst =3D Path(destdir, *dst.parts[1:]) + dst.mkdir(parents=3DTrue, exist_ok=3DTrue) shutil.copy(src, dst) --=20 2.35.3