ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: devel@lists.altlinux.org
Subject: Re: [devel] gb-task-check-lastchange: inheritance by src.rpm changelog
Date: Tue, 16 Mar 2010 20:24:18 +0300
Message-ID: <20100316172418.GM8189@altlinux.org> (raw)
In-Reply-To: <20100316141101.GI8189@altlinux.org>


[-- Attachment #1.1: Type: text/plain, Size: 586 bytes --]

On Tue, Mar 16, 2010 at 05:11:01PM +0300, Alexey Tourbin wrote:
> gb-task-check-lastchange: new check for inheritance
> http://git.altlinux.org/people/at/packages/girar-builder.git?a=commitdiff;h=132737dc
> 
> +#
> +# When updating a package V1->V2, last changelog entry in V1
> +# must be present among changelog entries in V2.  This is how
> +# we can retain NMU and promote QA activity.
> +#

More examples follow along with a simple script to automate comparsion.

[at@altair at]$ ./changelogdiff /ALT/archive/Sisyphus/2009/08/01 /ALT/archive/Sisyphus/2009/09/01 >diff

[-- Attachment #1.2: changelogdiff --]
[-- Type: text/plain, Size: 915 bytes --]

#!/bin/sh -efu

. tmpdir.sh
cd $TMPDIR

repo1=$1
repo2=$2

ls $repo1/files/SRPMS/ |perl -pe 's/(.+)-(.+)-(.+)/$1\t$1-$2-$3/' >NF1
ls $repo2/files/SRPMS/ |perl -pe 's/(.+)-(.+)-(.+)/$1\t$1-$2-$3/' >NF2

sort -u -o NF1{,}
sort -u -o NF2{,}

join NF1 NF2 |awk '$2!=$3{print$2,$3}' >check

changelog()
{       
	rpmquery --qf '[%{CHANGELOGTIME:day}\t%{CHANGELOGNAME}\n]' -p "$1" |
	perl -pe 's/\t.*<(\S+)(?:\@| at )([\w-]+).*>[ \t]*/\t$1\@$2\t/'
}

check()
{       
        changelog "$1" >c1
        changelog "$2" >c2
        lastchange=$(head -1 c1)
        if ! fgrep -qs -x -e "${lastchange:?}" c2; then
		rpm -q --changelog -p "$1" >${1##*/}.changelog
		rpm -q --changelog -p "$2" >${2##*/}.changelog
		diff -u {${1##*/},${2##*/}}.changelog || [ $? = 1 ]
        fi
}

while read -r F1 F2; do
	F1=$repo1/files/SRPMS/$F1
	F2=$repo2/files/SRPMS/$F2
	check $F1 $F2
done <check

[-- Attachment #1.3: diff.gz --]
[-- Type: application/x-gzip, Size: 6350 bytes --]

[-- Attachment #2: Type: application/pgp-signature, Size: 198 bytes --]

      parent reply	other threads:[~2010-03-16 17:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-16 14:11 Alexey Tourbin
2010-03-16 14:44 ` Alexey Tourbin
2010-03-16 16:30 ` Alexey Tourbin
2010-03-16 17:24 ` Alexey Tourbin [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20100316172418.GM8189@altlinux.org \
    --to=at@altlinux.ru \
    --cc=devel@lists.altlinux.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

ALT Linux Team development discussions

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel/0 devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 devel devel/ http://lore.altlinux.org/devel \
		devel@altlinux.org devel@altlinux.ru devel@lists.altlinux.org devel@lists.altlinux.ru devel@linux.iplabs.ru mandrake-russian@linuxteam.iplabs.ru sisyphus@linuxteam.iplabs.ru
	public-inbox-index devel

Example config snippet for mirrors.
Newsgroup available over NNTP:
	nntp://lore.altlinux.org/org.altlinux.lists.devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git