ALT Linux Team development discussions
 help / color / mirror / Atom feed
* [devel] %__subst changes?
@ 2004-03-03 17:33 Maxim Tyurin
  2004-03-03 17:48 ` Sergey Vlasov
  2004-03-03 22:05 ` Dmitry V. Levin
  0 siblings, 2 replies; 8+ messages in thread
From: Maxim Tyurin @ 2004-03-03 17:33 UTC (permalink / raw)
  To: ALTLinux devel

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

Hi!
Просветите plz какие изменения в subst (sed) произошли?
Перестал обрабатывать такую конструкцию в спеке:
 %__grep -r /etc/ipsec.secrets * \
| %__awk '{ print $1 }' \
| %__sed -e 's|:.*$|\1|' \
| xargs %__subst 's|/etc/ipsec.conf|/etc/super-freeswan/ipsec.conf|';

Ругается 
+ /bin/grep -r /etc/ipsec.secrets BUGS CHANGES CHANGES.AggressiveMode CHANGES.SUPERFS CHANGES.X509 CHANGES.ipsec_alg COPYING CREDITS INSTALL Makefile Makefile.inc Makefile.ver README README.AggressiveMode README.DPD README.NAT-Traversal README.SUPERFS README.ipsec_alg README.selectors README.x509 contrib doc klips lib libcrypto libdes packaging pluto rpm.in testing utils zlib
+ gawk '{ print $1 }'
+ /bin/sed -e 's|:.*$|\1|'
/bin/sed: -e expression #1, char 10: Invalid reference \1 on `s' command's RHS
ошибка: Неверный код возврата из /home/mrkooll/tmp/rpm-tmp.44577 (%prep)

Пока заменил на 
%__grep -r /etc/ipsec.secrets * \
| %__awk '{ print $1 }' \
| %__sed -e 's|:.*$|\1|' \
| xargs perl -p -i -e 's|/etc/ipsec.secrets|/etc/freeswan/ipsec.secrets|';
но это IMHO кривее.

Или подкиньте кто мысль как эту конструкцию нормально переписать.

P.S. это из пакета super-freeswan-1.99.8-alt1.2.src.rpm
-- 

With Best Regards, Maxim Tyurin
JID:	MrKooll@jabber.pibhe.com
			

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [devel] %__subst changes?
  2004-03-03 17:33 [devel] %__subst changes? Maxim Tyurin
@ 2004-03-03 17:48 ` Sergey Vlasov
  2004-03-03 17:59   ` Maxim Tyurin
  2004-03-03 22:05 ` Dmitry V. Levin
  1 sibling, 1 reply; 8+ messages in thread
From: Sergey Vlasov @ 2004-03-03 17:48 UTC (permalink / raw)
  To: ALTLinux devel

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

On Wed, Mar 03, 2004 at 07:33:28PM +0200, Maxim Tyurin wrote:
> Просветите plz какие изменения в subst (sed) произошли?
> Перестал обрабатывать такую конструкцию в спеке:
>  %__grep -r /etc/ipsec.secrets * \
> | %__awk '{ print $1 }' \
> | %__sed -e 's|:.*$|\1|' \
> | xargs %__subst 's|/etc/ipsec.conf|/etc/super-freeswan/ipsec.conf|';
> 
> Ругается 
> + /bin/grep -r /etc/ipsec.secrets BUGS CHANGES CHANGES.AggressiveMode CHANGES.SUPERFS CHANGES.X509 CHANGES.ipsec_alg COPYING CREDITS INSTALL Makefile Makefile.inc Makefile.ver README README.AggressiveMode README.DPD README.NAT-Traversal README.SUPERFS README.ipsec_alg README.selectors README.x509 contrib doc klips lib libcrypto libdes packaging pluto rpm.in testing utils zlib
> + gawk '{ print $1 }'
> + /bin/sed -e 's|:.*$|\1|'
> /bin/sed: -e expression #1, char 10: Invalid reference \1 on `s' command's RHS
> ошибка: Неверный код возврата из /home/mrkooll/tmp/rpm-tmp.44577 (%prep)

Так он не на subst дохнет, а на предыдущем sed.  И правильно делает - что
может обозначать ссылка '\1' в правой части, если в левой части нет
'\(..\)'?

В старом sed это, похоже, работало как 's|:.*$||' - предполагалось именно
это?

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [devel] %__subst changes?
  2004-03-03 17:48 ` Sergey Vlasov
@ 2004-03-03 17:59   ` Maxim Tyurin
  2004-03-03 18:17     ` Sergey Vlasov
  0 siblings, 1 reply; 8+ messages in thread
From: Maxim Tyurin @ 2004-03-03 17:59 UTC (permalink / raw)
  To: ALT Devel discussion list

Sergey Vlasov <vsu@altlinux.ru> writes:

> On Wed, Mar 03, 2004 at 07:33:28PM +0200, Maxim Tyurin wrote:
>> Просветите plz какие изменения в subst (sed) произошли?
>> Перестал обрабатывать такую конструкцию в спеке:
>>  %__grep -r /etc/ipsec.secrets * \
>> | %__awk '{ print $1 }' \
>> | %__sed -e 's|:.*$|\1|' \
>> | xargs %__subst 's|/etc/ipsec.conf|/etc/super-freeswan/ipsec.conf|';
>> 
>> Ругается 
>> + /bin/grep -r /etc/ipsec.secrets BUGS CHANGES CHANGES.AggressiveMode CHANGES.SUPERFS CHANGES.X509 CHANGES.ipsec_alg COPYING CREDITS INSTALL Makefile Makefile.inc Makefile.ver README README.AggressiveMode README.DPD README.NAT-Traversal README.SUPERFS README.ipsec_alg README.selectors README.x509 contrib doc klips lib libcrypto libdes packaging pluto rpm.in testing utils zlib
>> + gawk '{ print $1 }'
>> + /bin/sed -e 's|:.*$|\1|'
>> /bin/sed: -e expression #1, char 10: Invalid reference \1 on `s' command's RHS
>> ошибка: Неверный код возврата из /home/mrkooll/tmp/rpm-tmp.44577 (%prep)
>
> Так он не на subst дохнет, а на предыдущем sed.  И правильно делает - что
> может обозначать ссылка '\1' в правой части, если в левой части нет
> '\(..\)'?
>
> В старом sed это, похоже, работало как 's|:.*$||' - предполагалось именно
> это?

Может я тупить начал уже.
Но 
%__grep -r /etc/ipsec.conf * \
| %__awk '{ print $1 }' \
| %__sed -e 's|:.*$|\1|' \
| xargs perl -p -i -e 's|/etc/ipsec.conf|/etc/freeswan/ipsec.conf|';
работает как надо.

-- 

With Best Regards, Maxim Tyurin
JID:	MrKooll@jabber.pibhe.com
			



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [devel] %__subst changes?
  2004-03-03 17:59   ` Maxim Tyurin
@ 2004-03-03 18:17     ` Sergey Vlasov
  2004-03-03 18:24       ` Maxim Tyurin
  0 siblings, 1 reply; 8+ messages in thread
From: Sergey Vlasov @ 2004-03-03 18:17 UTC (permalink / raw)
  To: ALT Devel discussion list

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

On Wed, Mar 03, 2004 at 07:59:36PM +0200, Maxim Tyurin wrote:
> Sergey Vlasov <vsu@altlinux.ru> writes:
> 
> > On Wed, Mar 03, 2004 at 07:33:28PM +0200, Maxim Tyurin wrote:
> >> Просветите plz какие изменения в subst (sed) произошли?
> >> Перестал обрабатывать такую конструкцию в спеке:
> >>  %__grep -r /etc/ipsec.secrets * \
> >> | %__awk '{ print $1 }' \
> >> | %__sed -e 's|:.*$|\1|' \
> >> | xargs %__subst 's|/etc/ipsec.conf|/etc/super-freeswan/ipsec.conf|';
> >> 
> >> Ругается 
> >> + /bin/grep -r /etc/ipsec.secrets BUGS CHANGES CHANGES.AggressiveMode CHANGES.SUPERFS CHANGES.X509 CHANGES.ipsec_alg COPYING CREDITS INSTALL Makefile Makefile.inc Makefile.ver README README.AggressiveMode README.DPD README.NAT-Traversal README.SUPERFS README.ipsec_alg README.selectors README.x509 contrib doc klips lib libcrypto libdes packaging pluto rpm.in testing utils zlib
> >> + gawk '{ print $1 }'
> >> + /bin/sed -e 's|:.*$|\1|'
> >> /bin/sed: -e expression #1, char 10: Invalid reference \1 on `s' command's RHS
> >> ошибка: Неверный код возврата из /home/mrkooll/tmp/rpm-tmp.44577 (%prep)
> >
> > Так он не на subst дохнет, а на предыдущем sed.  И правильно делает - что
> > может обозначать ссылка '\1' в правой части, если в левой части нет
> > '\(..\)'?
> >
> > В старом sed это, похоже, работало как 's|:.*$||' - предполагалось именно
> > это?
> 
> Может я тупить начал уже.
> Но 
> %__grep -r /etc/ipsec.conf * \
> | %__awk '{ print $1 }' \
> | %__sed -e 's|:.*$|\1|' \
> | xargs perl -p -i -e 's|/etc/ipsec.conf|/etc/freeswan/ipsec.conf|';
> работает как надо.

Если это происходит на той же системе, на которой предыдущий вариант не
работает с вышеуказанным сообщением - это уже что-то из области
фантастики.

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [devel] %__subst changes?
  2004-03-03 18:17     ` Sergey Vlasov
@ 2004-03-03 18:24       ` Maxim Tyurin
  0 siblings, 0 replies; 8+ messages in thread
From: Maxim Tyurin @ 2004-03-03 18:24 UTC (permalink / raw)
  To: ALT Devel discussion list

Sergey Vlasov <vsu@altlinux.ru> writes:

> On Wed, Mar 03, 2004 at 07:59:36PM +0200, Maxim Tyurin wrote:
>> > В старом sed это, похоже, работало как 's|:.*$||' - предполагалось именно
>> > это?
>> 
>> Может я тупить начал уже.
>> Но 
>> %__grep -r /etc/ipsec.conf * \
>> | %__awk '{ print $1 }' \
>> | %__sed -e 's|:.*$|\1|' \
>> | xargs perl -p -i -e 's|/etc/ipsec.conf|/etc/freeswan/ipsec.conf|';
>> работает как надо.
>
> Если это происходит на той же системе, на которой предыдущий вариант не
> работает с вышеуказанным сообщением - это уже что-то из области
> фантастики.

поменял на %__sed -e 's|:.*$||' заработало.
Сори за беспокойство.

-- 

With Best Regards, Maxim Tyurin
JID:	MrKooll@jabber.pibhe.com
			



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [devel] %__subst changes?
  2004-03-03 17:33 [devel] %__subst changes? Maxim Tyurin
  2004-03-03 17:48 ` Sergey Vlasov
@ 2004-03-03 22:05 ` Dmitry V. Levin
  2004-03-04  7:33   ` Maxim Tyurin
  1 sibling, 1 reply; 8+ messages in thread
From: Dmitry V. Levin @ 2004-03-03 22:05 UTC (permalink / raw)
  To: ALT Devel discussion list

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

Hi,

On Wed, Mar 03, 2004 at 07:33:28PM +0200, Maxim Tyurin wrote:
> Hi!
> Просветите plz какие изменения в subst (sed) произошли?

Радикально изменилась версия, с sed-3.02-alt2 на sed-4.0.9-alt1.

> Перестал обрабатывать такую конструкцию в спеке:
>  %__grep -r /etc/ipsec.secrets * \
> | %__awk '{ print $1 }' \
> | %__sed -e 's|:.*$|\1|' \
> | xargs %__subst 's|/etc/ipsec.conf|/etc/super-freeswan/ipsec.conf|';
> 
> Ругается 
> + /bin/grep -r /etc/ipsec.secrets BUGS CHANGES CHANGES.AggressiveMode CHANGES.SUPERFS CHANGES.X509 CHANGES.ipsec_alg COPYING CREDITS INSTALL Makefile Makefile.inc Makefile.ver README README.AggressiveMode README.DPD README.NAT-Traversal README.SUPERFS README.ipsec_alg README.selectors README.x509 contrib doc klips lib libcrypto libdes packaging pluto rpm.in testing utils zlib
> + gawk '{ print $1 }'
> + /bin/sed -e 's|:.*$|\1|'
> /bin/sed: -e expression #1, char 10: Invalid reference \1 on `s' command's RHS
> ошибка: Неверный код возврата из /home/mrkooll/tmp/rpm-tmp.44577 (%prep)

Всё правильно, новый sed не принимает неверное выражение
's|:.*$|\1|'

Чтобы использовать \1, нужно что-то выделить с помощью \( и \).

> Пока заменил на 
> %__grep -r /etc/ipsec.secrets * \
> | %__awk '{ print $1 }' \
> | %__sed -e 's|:.*$|\1|' \
> | xargs perl -p -i -e 's|/etc/ipsec.secrets|/etc/freeswan/ipsec.secrets|';
> но это IMHO кривее.

И работать всё равно не будет.

> Или подкиньте кто мысль как эту конструкцию нормально переписать.

Если я правильно понял идею замены, то
find -type f -print0 |
	xargs -r0 %__grep -FZl /etc/ipsec.secrets -- |
	xargs -r0 %__subst 's|/etc/ipsec.conf|/etc/super-freeswan/ipsec.conf|' --

Похожий пример есть в Sisyphus/doc/alt-packaging/spp.tex


-- 
ldv

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [devel] %__subst changes?
  2004-03-03 22:05 ` Dmitry V. Levin
@ 2004-03-04  7:33   ` Maxim Tyurin
  2004-03-04  8:03     ` [devel] " Michael Shigorin
  0 siblings, 1 reply; 8+ messages in thread
From: Maxim Tyurin @ 2004-03-04  7:33 UTC (permalink / raw)
  To: ALT Devel discussion list

"Dmitry V. Levin" <ldv@altlinux.org> writes:

<scip>
> Если я правильно понял идею замены, то
> find -type f -print0 |
> 	xargs -r0 %__grep -FZl /etc/ipsec.secrets -- |
> 	xargs -r0 %__subst 's|/etc/ipsec.conf|/etc/super-freeswan/ipsec.conf|' --
>
> Похожий пример есть в Sisyphus/doc/alt-packaging/spp.tex

Спасибо. Так гораздо понятнее. 
-- 

With Best Regards, Maxim Tyurin
JID:	MrKooll@jabber.pibhe.com
			



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [devel] Re: %__subst changes?
  2004-03-04  7:33   ` Maxim Tyurin
@ 2004-03-04  8:03     ` Michael Shigorin
  0 siblings, 0 replies; 8+ messages in thread
From: Michael Shigorin @ 2004-03-04  8:03 UTC (permalink / raw)
  To: ALT Devel discussion list

On Thu, Mar 04, 2004 at 09:33:17AM +0200, Maxim Tyurin wrote:
> > find -type f -print0 |
> > 	xargs -r0 %__grep -FZl /etc/ipsec.secrets -- |
> > 	xargs -r0 %__subst 's|/etc/ipsec.conf|/etc/super-freeswan/ipsec.conf|' --
> Спасибо. Так гораздо понятнее. 

Я где-то подцепил такой стиль:

find -type f -print0 \
| xargs -r0 %__grep -FZl /etc/ipsec.secrets -- \
| xargs -r0 %__subst 's|/etc/ipsec.conf|/etc/super-freeswan/ipsec.conf|' --

IMO и компактней, и читабельней. :)

-- 
 ---- WBR, Michael Shigorin <mike@altlinux.ru>
  ------ Linux.Kiev http://www.linux.kiev.ua/


^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2004-03-04  8:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-03 17:33 [devel] %__subst changes? Maxim Tyurin
2004-03-03 17:48 ` Sergey Vlasov
2004-03-03 17:59   ` Maxim Tyurin
2004-03-03 18:17     ` Sergey Vlasov
2004-03-03 18:24       ` Maxim Tyurin
2004-03-03 22:05 ` Dmitry V. Levin
2004-03-04  7:33   ` Maxim Tyurin
2004-03-04  8:03     ` [devel] " Michael Shigorin

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