ALT Linux Distributions development
 help / color / mirror / Atom feed
From: Michael Shigorin <mike@altlinux.org>
To: devel-distro@lists.altlinux.org
Subject: Re: [devel-distro] [PATCH] reports.mk: Generate rpm and srpms lists
Date: Wed, 28 Apr 2021 16:52:28 +0300
Message-ID: <20210428135228.GA20076@imap.altlinux.org> (raw)
In-Reply-To: <20210428123853.GA16601@imap.altlinux.org>

[-- Attachment #1: Type: text/plain, Size: 1672 bytes --]

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

Можно свести с предыдущим коммитом (если его забирать),
чтоб сразу был исправный.

-- 
 ---- WBR, Michael Shigorin / http://altlinux.org
  ------ http://opennet.ru / http://anna-news.info

[-- Attachment #2: 0001-reports.mk-provide-bashism-with-bash.patch --]
[-- Type: text/x-patch, Size: 814 bytes --]

>From 9c4e1fee862c7c80f2fae2bd290a25b5b3d315f9 Mon Sep 17 00:00:00 2001
From: Michael Shigorin <mike@altlinux.org>
Date: Wed, 28 Apr 2021 16:29:46 +0300
Subject: [PATCH] reports.mk: provide bashism with bash

Wrote that it's a bashism myself and neglected
to specify the proper shell, sigh.

This SHELL manipulation could ruin tracing
piggybacked onto it within lib/report.mk
but it's too late at this stage anyways.
---
 reports.mk | 1 +
 1 file changed, 1 insertion(+)

diff --git a/reports.mk b/reports.mk
index 247c722b5..f6020ce3c 100644
--- a/reports.mk
+++ b/reports.mk
@@ -77,6 +77,7 @@ reports/contents: reports/prep
 		fi; \
 	esac
 
+reports/packages: SHELL = /bin/bash
 reports/packages: reports/prep
 	@grep -E 'chroot/.in/[^/]*.rpm' < $(BUILDLOG) | \
 		cut -d' ' -f 1 | tr -d "'"'`' | \
-- 
2.25.4


  reply	other threads:[~2021-04-28 13:52 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 [this message]
2021-04-29 14:39   ` Антон Мидюков

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=20210428135228.GA20076@imap.altlinux.org \
    --to=mike@altlinux.org \
    --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