From mboxrd@z Thu Jan 1 00:00:00 1970 X-GM-THRID: 7186516587736727552 X-Received: by 2002:a5d:6b51:0:b0:2b7:74c3:560d with SMTP id x17-20020a5d6b51000000b002b774c3560dmr659233wrw.39.1673259412092; Mon, 09 Jan 2023 02:16:52 -0800 (PST) X-BeenThere: isar-users@googlegroups.com Received: by 2002:a7b:c843:0:b0:3cd:d7d0:14b6 with SMTP id c3-20020a7bc843000000b003cdd7d014b6ls2927512wml.1.-pod-control-gmail; Mon, 09 Jan 2023 02:16:50 -0800 (PST) X-Google-Smtp-Source: AMrXdXsL10KMx/tmL5f19BAU4fR4Ct6zYNdkQPtGFiJerZ68vOOSinbhsmzWFN+YzAlYO2fzO7Vh X-Received: by 2002:a05:600c:3506:b0:3cf:803b:d7cc with SMTP id h6-20020a05600c350600b003cf803bd7ccmr48914372wmq.33.1673259410858; Mon, 09 Jan 2023 02:16:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673259410; cv=none; d=google.com; s=arc-20160816; b=XWUAaoip5b5Jb6sHljWy7o8GRjlQ7oKvzbMgosGN/hPLbg36pu/4yJQdxoIsp4OJFq wG2ZOnm/3kZEJU5lLXiUBlH3t1sWPUwK9qfZaIM+0YOD1PMJftXoxintrYlhEgy53XtR muL8u92ao4sMyw8sYa0kQRUldNGsRtiJhmeC0tJnpEvGklPWvoCghYBc0zsDgeCCPfp1 kSjJ2MqgsLIYtfZO9ktJWTje1/eTH7R79L46XcAUdusGDebmQKyTUZDxqdzSl5UOWbPi 4RuIo5i0VcybxyxyLoyKAzasTxYeoC3rpBZHu7Z7/90zbD0D4EboSyUjgweYGV582Qwe 803g== 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=QqbcXhbe4KccR0xbhfT2wrZ7MnzzPx/uz+mpgI6ANds=; b=QvdD1Ppaq3ydpnMvDQiU45PC2+vf1PD1YBBkLH5gqSRj3eE0Hk46Rh76IJaM+NSg3j igKAlWSKVEt5IeQZgbkxzj63nrbF6iIvuhM9oJcXlN8d4ophjrjU53usgPE37Ae72r4Y qTXmT1LTc2W8lkkDbMtYAbC+8DxcEOazlsDUsv0FBOWBMgCpgoqMfZVED+hiVlLDOj/R +RmSrIKwBW80I1C9EBIurUKAnChvpuhcSbogREGsZc2gteFD0hXp1eY7NBlR9u3wG4r8 eX1Nwqw8YmGC1Hb2xHHvL+MzrIxoYPVKaywnh1AepRZrglygjo6/FDMMVO/BgUIy0V/q yaTg== ARC-Authentication-Results: i=1; gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=SnQoEd+I; spf=pass (google.com: domain of fm-72506-20230109101650011c5dac93d51526aa-9sqmjh@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-72506-20230109101650011c5dac93d51526aa-9sQMJH@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Return-Path: Received: from mta-64-225.siemens.flowmailer.net (mta-64-225.siemens.flowmailer.net. [185.136.64.225]) by gmr-mx.google.com with ESMTPS id z5-20020a1c4c05000000b003cf1536d24dsi423737wmf.0.2023.01.09.02.16.50 for (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Mon, 09 Jan 2023 02:16:50 -0800 (PST) Received-SPF: pass (google.com: domain of fm-72506-20230109101650011c5dac93d51526aa-9sqmjh@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) client-ip=185.136.64.225; Authentication-Results: gmr-mx.google.com; dkim=pass header.i=@siemens.com header.s=fm1 header.b=SnQoEd+I; spf=pass (google.com: domain of fm-72506-20230109101650011c5dac93d51526aa-9sqmjh@rts-flowmailer.siemens.com designates 185.136.64.225 as permitted sender) smtp.mailfrom=fm-72506-20230109101650011c5dac93d51526aa-9sQMJH@rts-flowmailer.siemens.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=siemens.com Received: by mta-64-225.siemens.flowmailer.net with ESMTPSA id 20230109101650011c5dac93d51526aa for ; Mon, 09 Jan 2023 11:16:50 +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=QqbcXhbe4KccR0xbhfT2wrZ7MnzzPx/uz+mpgI6ANds=; b=SnQoEd+ItTYaOBLX0egtxInFAU67eNKH9uzhktEIxu01ldSnz1VWyeSclFkMPEh/p3Fh4S DCr1FN8tD4Oo44me3QbfoVWGMZkPdZjud/IP1sgpyhqtD/T87Q+SfxA7hleWvdkzO0y7Nq6D ID3/QGsoBFrpLNJzZgMiXHYLJS4rw=; 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 v2 1/3] make deb_add_changelog idempotent Date: Mon, 9 Jan 2023 10:16:35 +0000 Message-Id: <20230109101637.1436200-2-felix.moessbauer@siemens.com> In-Reply-To: <20230109101637.1436200-1-felix.moessbauer@siemens.com> References: <20230109101637.1436200-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: 91NaQLVBOkdY 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 | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/meta/classes/debianize.bbclass b/meta/classes/debianize.bbclass index d125256..ca7b520 100644 --- a/meta/classes/debianize.bbclass +++ b/meta/classes/debianize.bbclass @@ -19,11 +19,14 @@ deb_add_changelog() { if [ ! -f ${WORKDIR}/changelog.orig ]; then cp ${S}/debian/changelog ${WORKDIR}/changelog.orig fi - orig_version=$(dpkg-parsechangelog -l ${WORKDIR}/changelog.orig -S Version) - changelog_v=$(echo "${changelog_v}" | sed 's//'${orig_version}'/') - orig_date=$(dpkg-parsechangelog -l ${WORKDIR}/changelog.orig -S Date) - orig_seconds=$(date --date="${orig_date}" +'%s') - timestamp=$(expr ${orig_seconds} + 42) + # we have a non auto-generated original changelog + if [ -s ${WORKDIR}/changelog.orig ]; then + orig_version=$(dpkg-parsechangelog -l ${WORKDIR}/changelog.orig -S Version) + changelog_v=$(echo "${changelog_v}" | sed 's//'${orig_version}'/') + orig_date=$(dpkg-parsechangelog -l ${WORKDIR}/changelog.orig -S Date) + orig_seconds=$(date --date="${orig_date}" +'%s') + timestamp=$(expr ${orig_seconds} + 42) + fi fi date=$(LANG=C date -R -d @${timestamp}) @@ -34,7 +37,10 @@ ${PN} (${changelog_v}) UNRELEASED; urgency=low -- ${MAINTAINER} ${date} EOF - if [ -f ${WORKDIR}/changelog.orig ]; then + # ensure that we always start with the orig version of the + # changelog on repeated invocations (e.g. on partial rebuilds) + touch ${WORKDIR}/changelog.orig + if [ -s ${WORKDIR}/changelog.orig ]; then # prepend our entry to the original changelog echo >> ${S}/debian/changelog cat ${WORKDIR}/changelog.orig >> ${S}/debian/changelog -- 2.34.1