From nobody Tue Feb 10 04:13:30 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=1652776384; cv=none; d=zohomail.com; s=zohoarc; b=ikqi3JRbj/HftngnSakbhZRRF+kwio0x1Z9uMjJcLy5E0USMZsxVVzZcaFS2z1VzZoVi0Te1F95pbVV5NK0YQNg71RGdySYZN5VcKKOjM2LF6ZblWYdbhmCs/MKxDncJxc8nuRrdzTnr1dwzJDNWFiF4+lHMEokXvyzdaPLLyLc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1652776384; 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=fpxlAuKQZfFpEXuNwmGQaiDet53PVkmM6sCM15SdIJw=; b=Ee2QdQMuQ/nB31PehbMC7eLfNKiA/rV4d+kNSNNXwJLxH2Moh/txcY3NebUJVC9FJnBbuFmruA9bZ6+cLtPyT3599TxcPxsFjzBarMnqabxkqzyN1HqTsnTgfiBmb3VcIaZIo2ydGsGZohs/jhfO6qKYya4JfrssBJyy4zfD3OE= 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 1652776384954557.9228199881852; Tue, 17 May 2022 01:33:04 -0700 (PDT) Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-325-ZkGO_18_Omyq3k-6THRwzw-1; Tue, 17 May 2022 04:32:25 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.rdu2.redhat.com [10.11.54.2]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 41CE1833978; Tue, 17 May 2022 08:32:23 +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 CC3CA40D1B9D; Tue, 17 May 2022 08:32:22 +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 0A7F2194707A; Tue, 17 May 2022 08:32:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) by mm-prod-listman-01.mail-001.prod.us-east-1.aws.redhat.com (Postfix) with ESMTP id 983C91947056 for ; Tue, 17 May 2022 08:32:21 +0000 (UTC) Received: by smtp.corp.redhat.com (Postfix) id 8C065C15D67; Tue, 17 May 2022 08:32:21 +0000 (UTC) Received: from harajuku.usersys.redhat.com (unknown [10.40.193.212]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 1AEEAC15D5C for ; Tue, 17 May 2022 08:32:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1652776384; 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=fpxlAuKQZfFpEXuNwmGQaiDet53PVkmM6sCM15SdIJw=; b=Kqj2BIOiNZWAzw29h+TO0WMMSFyyk50u3AeD6B+QCbpzLCsZvi78XknrHBG98lP/6mrt8U PbK0MDG2kidvYpbQD96mwJL1mymSt0pAYVWTt/Jp0ef6mTvXqY2t82xKzoTnrpmr0oZgWs s3JAAWpkOQp9eLMIc03pfBTSb3zDcPQ= X-MC-Unique: ZkGO_18_Omyq3k-6THRwzw-1 X-Original-To: libvir-list@listman.corp.redhat.com From: Andrea Bolognani To: libvir-list@redhat.com Subject: [libvirt PATCH 2/7] syntax-check: Introduce sc_pot_comments Date: Tue, 17 May 2022 10:32:12 +0200 Message-Id: <20220517083217.193910-3-abologna@redhat.com> In-Reply-To: <20220517083217.193910-1-abologna@redhat.com> References: <20220517083217.193910-1-abologna@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 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.84 on 10.11.54.2 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: 1652776385934100001 Content-Type: text/plain; charset="utf-8" We don't want comments to be present in the potfile, unless they're specifically aimed at translators. To achieve this, we pass the --add-comments=3DTRANSLATORS: option to xgettext. However, we also use the 'glib' preset, which contains the --add-comments option. This should work fine, as later options override earlier ones, but there's a problem: until 0.60, meson would not correctly preserve the order of options, and so whether or not the potfile would contain comments we don't care about was entirely down to chance. Add a check that will make the test suite fail if unwanted comments have been added to the potfile. Signed-off-by: Andrea Bolognani --- build-aux/syntax-check.mk | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/build-aux/syntax-check.mk b/build-aux/syntax-check.mk index 6664763faf..b14e2e57cc 100644 --- a/build-aux/syntax-check.mk +++ b/build-aux/syntax-check.mk @@ -1503,6 +1503,17 @@ sc_po_check: rm -f $@-1 $@-2; \ fi =20 +pot_file =3D $(top_srcdir)/po/libvirt.pot + +# Before 0.60, meson would sometimes pass options to xgettext in the +# wrong order, resulting in unwanted comments showing up in the +# potfile after it was refreshed +sc_pot_comments: + @if $(GREP) -E '^#\. ' $(pot_file) | $(GREP) -Ev 'TRANSLATORS:'; then \ + echo "Spurious comments in $(pot_file)" 1>&1; \ + exit 1; \ + fi + # #if WITH_... will evaluate to false for any non numeric string. # That would be flagged by using -Wundef, however gnulib currently # tests many undefined macros, and so we can't enable that option. --=20 2.35.3