ALT Linux Distributions development
 help / color / mirror / Atom feed
From: "Антон Мидюков" <midyukov-anton@ya.ru>
To: devel-distro@lists.altlinux.org
Subject: Re: [devel-distro] [PATCH] reports.mk: Generate rpm and srpms lists
Date: Thu, 29 Apr 2021 21:39:05 +0700
Message-ID: <693ca654-eee4-8769-fa63-5f317b823e5a@ya.ru> (raw)
In-Reply-To: <20210428135228.GA20076@imap.altlinux.org>

28.04.2021 20:52, Michael Shigorin пишет:
> On Wed, Apr 28, 2021 at 03:38:53PM +0300, Michael Shigorin wrote:
>> PS: ещё немножко посмотрел этот скрипт -- не настаиваю на мерже
>> последнего патча из приложенных трёх, но
> 
>> >From 20642ae4aa3847403d3462e74ace4c00ca3240b3 Mon Sep 17 00:00:00 2001
>> From: Michael Shigorin <mike@altlinux.org>
>> Date: Wed, 28 Apr 2021 15:06:57 +0300
>> Subject: [PATCH 3/3] reports.mk: use process substitution to dedup
>>
>> The first half of both pipes was clearly a copy-pasted
>> initial logfile processing; the file can be of considerable
>> size (e.g. several megabytes) so it might be slightly more
>> efficient and cool (but a bit more arcane) to use bash(1)'s
> 
> Сам же написал -- bash; а SHELL по умолчанию будет sh.
> 
>> process substitution along with good ol' tee(1) like this:
>>
>> --- a/reports.mk
>> +++ b/reports.mk
>>  
>>  reports/packages: reports/prep
>> -	@grep -E 'chroot/.in/[^/]*.rpm' < $(BUILDLOG) | \
>> -		cut -d' ' -f 1 | tr -d "'"'`' | sed 's,^.*/,,' | \
>> -		sort -u > "$(REPORTDIR)/list-rpms.txt"
>>  	@grep -E 'chroot/.in/[^/]*.rpm' < $(BUILDLOG) | \
>>  		cut -d' ' -f 1 | tr -d "'"'`' | \
>> +		tee /dev/stderr 2> >(sed 's,^.*/,,' | \
>> +			sort -u > "$(REPORTDIR)/list-rpms.txt") | \
>>  		xargs rpm -qp --queryformat '%{sourcerpm}\n' | \
>>  		sort -u > "$(REPORTDIR)/list-srpms.txt"
> 
> По идее, на стадии report.mk нам уже нет дела до трассировки,
> которая взводится в lib/report.mk накруткой на SHELL;
> понадобится ещё вот такая строчка сперва:
> 
> reports/packages: SHELL = /bin/bash
> 
> Можно свести с предыдущим коммитом (если его забирать),
> чтоб сразу был исправный.
> 

Забрал, все четыре коммита.


-- 
С уважением, Антон Мидюков <antohami@altlinux.org>


      reply	other threads:[~2021-04-29 14:39 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-04-28 12:38 Michael Shigorin
2021-04-28 13:52 ` Michael Shigorin
2021-04-29 14:39   ` Антон Мидюков [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=693ca654-eee4-8769-fa63-5f317b823e5a@ya.ru \
    --to=midyukov-anton@ya.ru \
    --cc=devel-distro@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 Distributions development

This inbox may be cloned and mirrored by anyone:

	git clone --mirror http://lore.altlinux.org/devel-distro/0 devel-distro/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-distro devel-distro/ http://lore.altlinux.org/devel-distro \
		devel-distro@lists.altlinux.org devel-distro@lists.altlinux.ru devel-distro@lists.altlinux.com
	public-inbox-index devel-distro

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


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