ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: "Dmitry V. Levin" <ldv@fandra.org>
To: devel@linux.iplabs.ru
Subject: Re: [devel] rpm macros
Date: Sun, 12 Nov 2000 19:48:32 +0300
Message-ID: <20001112194832.A21006@LDV.fandra.org> (raw)
In-Reply-To: <20001112135503.A2508@localhost.localdomain>; from mookid@sigent.ru on Sun, Nov 12, 2000 at 01:55:03PM +0300

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

On Sun, Nov 12, 2000 at 01:55:03PM +0300, Mikhail Zabaluev wrote:
> > $ rpm --eval='%embrace a b'
> > 
> > %embrace()          %brace
> > %brace()            begin %2 %1 end
> > результат: begin b a end
> 
> То есть %*, %1, %2 передаются как есть макросу "со скобочками", если он
> подставляется без параметров? Бред, так быть не должно. Эти параметры
> должны быть локальными.

Не совсем так: %*, %1, %2 и пр. создаются при каждом расширении по мере
надобности. Дело в том, что в rpm не существует понятия локальных
макросов. В результате, в область видимости попадают порой позиционные
параметры макроса, раскрытого уровнем выше.

Например, следующие макросы
%embrace()	%brace X %1
%brace()	%ONE %1 TWO %2 THREE %3 FOUR

по команде
$ rpm --eval='%embrace все что угодно'

раскрываются в
%ONE X TWO X THREE угодно FOUR

А если в процессе раскрытия парсер обнаружит, что %1 имеет значение %1,
или %2 - значение %2, и т.д., причем не обязательно на последнем уровне
раскрытия, то получается рекурсия.

Это все, конечно, плохо, однако именно так оно реализовано - это Вам не
cpp, где макрос, открытый один раз, выпадает из области видимости.

Какие будут предложения?


Regards,
	Dmitry

+-------------------------------------------------------------------------+
Dmitry V. Levin     mailto://ldv@fandra.org
Software Engineer   PGP pubkey http://www.fandra.org/users/ldv/pgpkeys.html
IPLabs Linux Team   http://linux.iplabs.ru
Fandra Project      http://www.fandra.org
+-------------------------------------------------------------------------+
UNIX is user friendly. It's just very selective about who it's friends are.

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

  parent reply	other threads:[~2000-11-12 16:48 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-11-10 15:12 Mikhail Zabaluev
2000-11-11 21:25 ` Dmitry V. Levin
2000-11-12  1:01   ` Mikhail Zabaluev
2000-11-11 22:06 ` Ivan Zakharyaschev
2000-11-11 23:29   ` Dmitry V. Levin
2000-11-12  9:46     ` Ivan Zakharyaschev
2000-11-12 10:55       ` Mikhail Zabaluev
2000-11-12 14:07         ` Ivan Zakharyaschev
2000-11-12 23:13           ` Mikhail Zabaluev
2000-11-14 22:35           ` Dmitry V. Levin
2000-11-12 16:48         ` Dmitry V. Levin [this message]
2000-11-12 23:27           ` Mikhail Zabaluev
2000-11-13 10:14             ` Dmitry V. Levin

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=20001112194832.A21006@LDV.fandra.org \
    --to=ldv@fandra.org \
    --cc=devel@linux.iplabs.ru \
    /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