From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7186516587736727552 X-Received: by 2002:a05:6512:2246:b0:4cb:24d9:88bb with SMTP id i6-20020a056512224600b004cb24d988bbmr2506270lfu.277.1673241283439; Sun, 08 Jan 2023 21:14:43 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a2e:97c9:0:b0:281:15f8:128c with SMTP id m9-20020a2e97c9000000b0028115f8128cls781991ljj.8.-pod-prod-gmail; Sun, 08 Jan 2023 21:14:42 -0800 (PST) X-Google-Smtp-Source: AMrXdXs8IrYikCoEoMyXmvJogPtpRTGckV+FS1ZiWNasGd3MH4xejVm4DSHRvseRhULMQl2AuFgk X-Received: by 2002:a2e:9253:0:b0:283:deb1:1c52 with SMTP id v19-20020a2e9253000000b00283deb11c52mr1299744ljg.30.1673241281964; Sun, 08 Jan 2023 21:14:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673241281; cv=none; d=google.com; s=arc-20160816; b=n2zGOSch9yE/mTgZSYTnWx2HVCi1YdIaEQPJZLUDLdant2/WxKVq4GtlmAswpzdrOf zLXZSKLhzA7bEw20EjaVeqk7NORKzPh4YF6bWfz2rHImMBMYNxHq9b87EkFjtNcL5hKN f+4hbfCpPr2GFDkF53ks2WyhkNZ4wgY4tzIyp/1m4nZ5mTGwNgAfIQcDj5r+y/izhONG 7AjAM/V3vNQWcnefmGPjXeAdCa22jV2LbZDIG/mQT6C7CEdxBaJS9bTmmTJ5DF/Eliih 2PVrYnJ6PgeCtey8NgAnCyDtI22dTlmJdkN3QnVV9XXTSaFXpk+Qe/khLJGSjJoZoWTy rfLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=feedback-id:content-transfer-encoding:mime-version:references :in-reply-to:message-id:date:subject:cc:to:from:dkim-signature; bh=PVA0j44JtHetzBMvbGmLrxQL/2Vtp/smSBJp17zBdm0=; b=xQZ9poMuEShmrpGDJ9YZyHR5mhue08C55lN2KzW6MpHNwDglJAxNd49DLyROkqf+P1 nba5ZlwZvvuzqatz9GOoOG3/+HCShcynu4AXZD/e3lxRrCZKFqR/ks8QUqKckQnsDJnv IH34Laq+WyR+OgBU3UOU4EALr5nVWjvltFCH4J8PjMcxikvfoZf4ghfaGqxl3RWriZ42 xn68+xCiFBobGu0p7jPSeFCBwuWb55JM6xGPhc/fk1atQGvlrhEbOboBQvOtjKAMcHRu CUxgd4DGvwNlQrbROh0v9qoafRXrJ0Bibj2c0BC2aOnYZGcdCvFIahFxgLpmWNa0FCf4 eWGQ== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=apibIqYU; spf=pass (google.com: domain of fm-72506-202301090514413f4bf5b0889afb7498-l3_nlm@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-72506-202301090514413f4bf5b0889afb7498-L3_NlM@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from mta-65-227.siemens.flowmailer.net (mta-65-227.siemens.flowmailer.net. [185.136.65.227]) by gmr-mx.google.com with ESMTPS id g10-20020a2ea4aa000000b0027fe115019esi282808ljm.6.2023.01.08.21.14.41 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 08 Jan 2023 21:14:41 -0800 (PST) Received-SPF: pass (google.com: domain of fm-72506-202301090514413f4bf5b0889afb7498-l3_nlm@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) client-ip=185.136.65.227; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=apibIqYU; spf=pass (google.com: domain of fm-72506-202301090514413f4bf5b0889afb7498-l3_nlm@rts-flowmailer.siemens.com designates 185.136.65.227 as permitted sender) smtp.mailfrom=fm-72506-202301090514413f4bf5b0889afb7498-L3_NlM@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: by mta-65-227.siemens.flowmailer.net with ESMTPSA id 202301090514413f4bf5b0889afb7498 for ; Mon, 09 Jan 2023 06:14:41 +0100 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; s=fm1; d=siemens.com; i=felix.moessbauer@siemens.com; h=Date:From:Subject:To:Message-ID:MIME-Version:Content-Type:Content-Transfer-Encoding:Cc:References:In-Reply-To; bh=PVA0j44JtHetzBMvbGmLrxQL/2Vtp/smSBJp17zBdm0=; b=apibIqYUoCB0PMi40A1NR9Z2P4fgvnruhNDspCJkrKnZU4joj0uYdQGPCi+2BlV87rQml7 sWjlX6jM67TvvzWfV1iU+gqiPhTu7+C2AfvOHpt99nMx/TpRRSG8V6TKFHBF2T4rutc6h4AK x3P4RwHvojkhI/jELUWf8bZ9NcaQk=; From: Felix Moessbauer To: isar-users@googlegroups.com Cc: jan.kiszka@siemens.com, henning.schild@siemens.com, venkata.pyla@toshiba-tsip.com, Felix Moessbauer Subject: [PATCH 1/3] make deb_add_changelog idempotent Date: Mon, 9 Jan 2023 05:14:26 +0000 Message-Id: <20230109051428.450854-2-felix.moessbauer@siemens.com> In-Reply-To: <20230109051428.450854-1-felix.moessbauer@siemens.com> References: <20230109051428.450854-1-felix.moessbauer@siemens.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Flowmailer-Platform: Siemens Feedback-ID: 519:519-72506:519-21489:flowmailer X-TUID: nF8bHW5V4WRy Previously, the deb_add_changelog function considered an auto-generated changelog as a base to add changes on top. This behavior is not idempontent on subsequent invocations of the function (e.g. on partial rebuilds). This lead to both reproducability issues, as well as unclean changelog files having multiple "generated by ISAR" entries. This patch changes this implementation in a way to always create a (possibly empty) orig changelog on the first invocation. On subequent invocations, the orig changelog is only considered as provided by the user, if it is not empty. Signed-off-by: Felix Moessbauer --- meta/classes/debianize.bbclass | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass index d125256..34347b5 100644 --- a/meta/classes/debianize.bbclass +++ b/meta/classes/debianize.bbclass @@ -15,7 +15,9 @@ MAINTAINER ??= "Unknown maintainer " deb_add_changelog() { changelog_v="${CHANGELOG_V}" timestamp=0 - if [ -f ${S}/debian/changelog ]; then + # we have a changelog and that is not autogenerated + # (when autogenerated, changelog.orig is empty) + if [ -f ${S}/debian/changelog ] && [ -s ${WORKDIR}/changelog.orig ]; then if [ ! -f ${WORKDIR}/changelog.orig ]; then cp ${S}/debian/changelog ${WORKDIR}/changelog.orig fi @@ -34,10 +36,12 @@ ${PN} (${changelog_v}) UNRELEASED; urgency=low -- ${MAINTAINER} ${date} EOF - if [ -f ${WORKDIR}/changelog.orig ]; then - # prepend our entry to the original changelog - echo >> ${S}/debian/changelog - cat ${WORKDIR}/changelog.orig >> ${S}/debian/changelog + # ensure that we always start with the orig version of the + # changelog on repeated invocations (e.g. on partial rebuilds) + touch ${WORKDIR}/changelog.orig + # prepend our entry to the original changelog + echo >> ${S}/debian/changelog + cat ${WORKDIR}/changelog.orig >> ${S}/debian/changelog fi if [ -f ${WORKDIR}/changelog ]; then -- 2.34.1