ALT Linux Team development discussions
 help / color / mirror / Atom feed
* Re: [devel] [git update] packages/rpm: heads/mod
  @ 2007-09-21 13:37 ` Dmitry V. Levin
  2007-09-21 14:12   ` [devel] [JT] " Damir Shayhutdinov
  2007-09-21 14:24   ` [devel] [git update] packages/rpm: heads/mod Alexey Tourbin
  0 siblings, 2 replies; 7+ messages in thread
From: Dmitry V. Levin @ 2007-09-21 13:37 UTC (permalink / raw)
  To: ALT Devel discussion list

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

On Fri, Sep 21, 2007 at 05:05:07PM +0400, Alexey M. Tourbin wrote:
[...]
>  	if [ -n "${RPM_BUILD_ROOT-}" ] && [ -z "${rep##$RPM_BUILD_ROOT*}" ]; then

Этот код не будет работать правильно при пустом значении RPM_BUILD_ROOT.
Лучше заменить ${RPM_BUILD_ROOT-} на ${RPM_BUILD_ROOT:-}.


-- 
ldv

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

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

* Re: [devel] [JT] [git update] packages/rpm: heads/mod
  2007-09-21 13:37 ` [devel] [git update] packages/rpm: heads/mod Dmitry V. Levin
@ 2007-09-21 14:12   ` Damir Shayhutdinov
  2007-09-21 14:21     ` Led
  2007-09-21 14:24   ` [devel] [git update] packages/rpm: heads/mod Alexey Tourbin
  1 sibling, 1 reply; 7+ messages in thread
From: Damir Shayhutdinov @ 2007-09-21 14:12 UTC (permalink / raw)
  To: ALT Devel discussion list

> >       if [ -n "${RPM_BUILD_ROOT-}" ] && [ -z "${rep##$RPM_BUILD_ROOT*}" ]; then
>
> Этот код не будет работать правильно при пустом значении RPM_BUILD_ROOT.
> Лучше заменить ${RPM_BUILD_ROOT-} на ${RPM_BUILD_ROOT:-}.

Коллеги, если используете смайлики в шелл-скриптах, не забывайте
пририсовывать им глазки! :-}

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

* Re: [devel] [JT] [git update] packages/rpm: heads/mod
  2007-09-21 14:12   ` [devel] [JT] " Damir Shayhutdinov
@ 2007-09-21 14:21     ` Led
  2007-09-21 14:24       ` [devel] [JT] fortunes-ALT-devel! Re: [JT] [git update] packages/rpm: heads/mod [JT] Michael Shigorin
  0 siblings, 1 reply; 7+ messages in thread
From: Led @ 2007-09-21 14:21 UTC (permalink / raw)
  To: ALT Linux Team development discussions

В сообщении от Friday 21 September 2007 17:12:12 Damir Shayhutdinov 
написал(а):
> > >       if [ -n "${RPM_BUILD_ROOT-}" ] && [ -z "${rep##$RPM_BUILD_ROOT*}"
> > > ]; then
> >
> > Этот код не будет работать правильно при пустом значении RPM_BUILD_ROOT.
> > Лучше заменить ${RPM_BUILD_ROOT-} на ${RPM_BUILD_ROOT:-}.
>
> Коллеги, если используете смайлики в шелл-скриптах, не забывайте
> пририсовывать им глазки! :-}

Однозначно - в fortunes!:)

-- 
Led

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

* [devel] [JT] fortunes-ALT-devel! Re: [JT] [git update] packages/rpm: heads/mod [JT]
  2007-09-21 14:21     ` Led
@ 2007-09-21 14:24       ` Michael Shigorin
  0 siblings, 0 replies; 7+ messages in thread
From: Michael Shigorin @ 2007-09-21 14:24 UTC (permalink / raw)
  To: ALT Linux Team development discussions

On Fri, Sep 21, 2007 at 05:21:05PM +0300, Led wrote:
> > > >       if [ -n "${RPM_BUILD_ROOT-}" ] && [ -z "${rep##$RPM_BUILD_ROOT*}"
> > > > ]; then
> > > Этот код не будет работать правильно при пустом значении RPM_BUILD_ROOT.
> > > Лучше заменить ${RPM_BUILD_ROOT-} на ${RPM_BUILD_ROOT:-}.
> > Коллеги, если используете смайлики в шелл-скриптах, не
> > забывайте пририсовывать им глазки! :-}
> Однозначно - в fortunes!:)

А толку, fortunes-ALT никто не занимается :(

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


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

* Re: [devel] [git update] packages/rpm: heads/mod
  2007-09-21 13:37 ` [devel] [git update] packages/rpm: heads/mod Dmitry V. Levin
  2007-09-21 14:12   ` [devel] [JT] " Damir Shayhutdinov
@ 2007-09-21 14:24   ` Alexey Tourbin
  2007-09-21 14:59     ` Dmitry V. Levin
  1 sibling, 1 reply; 7+ messages in thread
From: Alexey Tourbin @ 2007-09-21 14:24 UTC (permalink / raw)
  To: ALT Devel discussion list

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

On Fri, Sep 21, 2007 at 05:37:50PM +0400, Dmitry V. Levin wrote:
> On Fri, Sep 21, 2007 at 05:05:07PM +0400, Alexey M. Tourbin wrote:
> [...]
> >  	if [ -n "${RPM_BUILD_ROOT-}" ] && [ -z "${rep##$RPM_BUILD_ROOT*}" ]; then
> 
> Этот код не будет работать правильно при пустом значении RPM_BUILD_ROOT.

Обоснуй.

> Лучше заменить ${RPM_BUILD_ROOT-} на ${RPM_BUILD_ROOT:-}.

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

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

* Re: [devel] [git update] packages/rpm: heads/mod
  2007-09-21 14:24   ` [devel] [git update] packages/rpm: heads/mod Alexey Tourbin
@ 2007-09-21 14:59     ` Dmitry V. Levin
  2007-09-21 15:29       ` Alexey Tourbin
  0 siblings, 1 reply; 7+ messages in thread
From: Dmitry V. Levin @ 2007-09-21 14:59 UTC (permalink / raw)
  To: ALT Devel discussion list

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

On Fri, Sep 21, 2007 at 06:24:46PM +0400, Alexey Tourbin wrote:
> On Fri, Sep 21, 2007 at 05:37:50PM +0400, Dmitry V. Levin wrote:
> > On Fri, Sep 21, 2007 at 05:05:07PM +0400, Alexey M. Tourbin wrote:
> > [...]
> > >  	if [ -n "${RPM_BUILD_ROOT-}" ] && [ -z "${rep##$RPM_BUILD_ROOT*}" ]; then
> > 
> > Этот код не будет работать правильно при пустом значении RPM_BUILD_ROOT.
> 
> Обоснуй.

OK, будет и так работать.


-- 
ldv

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

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

* Re: [devel] [git update] packages/rpm: heads/mod
  2007-09-21 14:59     ` Dmitry V. Levin
@ 2007-09-21 15:29       ` Alexey Tourbin
  0 siblings, 0 replies; 7+ messages in thread
From: Alexey Tourbin @ 2007-09-21 15:29 UTC (permalink / raw)
  To: ALT Devel discussion list

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

On Fri, Sep 21, 2007 at 06:59:03PM +0400, Dmitry V. Levin wrote:
> On Fri, Sep 21, 2007 at 06:24:46PM +0400, Alexey Tourbin wrote:
> > On Fri, Sep 21, 2007 at 05:37:50PM +0400, Dmitry V. Levin wrote:
> > > On Fri, Sep 21, 2007 at 05:05:07PM +0400, Alexey M. Tourbin wrote:
> > > [...]
> > > >  	if [ -n "${RPM_BUILD_ROOT-}" ] && [ -z "${rep##$RPM_BUILD_ROOT*}" ]; then
> > > 
> > > Этот код не будет работать правильно при пустом значении RPM_BUILD_ROOT.
> > 
> > Обоснуй.
> 
> OK, будет и так работать.

Да это же по сути код
	if [ -n "$RPM_BUILD_ROOT" ] && [ -z "${rep##$RPM_BUILD_ROOT*}" ]; then
	...

в котором при первом использовании RPM_BUILD_ROOT добавлен минус,
потому что скрипты работают в режиме 'sh -u'.  Минус означает что
"я действительно знаю, что такой переменной может и не быть, это
не опечатка".

Кстати, код
	if [ -n "${RPM_BUILD_ROOT-}" -a -z "${rep##$RPM_BUILD_ROOT*}" ]; then
	...
в этом отношении уже не проканает, потому что с точки зрения шелла это
одна и та же команда, и если первый минус "гасит" -u, то во втором
RPM_BUILD_ROOT минуса уже нет, а подстановка происходит всех переменных
СРАЗУ (до интерпретации), и шелл по идее должен вывалиться.

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

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

end of thread, other threads:[~2007-09-21 15:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-09-21 13:37 ` [devel] [git update] packages/rpm: heads/mod Dmitry V. Levin
2007-09-21 14:12   ` [devel] [JT] " Damir Shayhutdinov
2007-09-21 14:21     ` Led
2007-09-21 14:24       ` [devel] [JT] fortunes-ALT-devel! Re: [JT] [git update] packages/rpm: heads/mod [JT] Michael Shigorin
2007-09-21 14:24   ` [devel] [git update] packages/rpm: heads/mod Alexey Tourbin
2007-09-21 14:59     ` Dmitry V. Levin
2007-09-21 15:29       ` Alexey Tourbin

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