ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Gladkov <legion@altlinux.ru>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: [devel] I: perl.req vs BEGIN
Date: Fri, 15 Aug 2008 16:00:14 +0400
Message-ID: <48A56FCE.9030002@altlinux.ru> (raw)

Приветствую!

Пишу сюда, чтобы разметить возможную граблю. Нарвался тут при сборке
пакета с такой ошибкой:

/usr/lib/groff/groffer is not an existing directory; at /tmp/groff-buildroot/usr/bin/groffer line 145.
BEGIN failed--compilation aborted at /tmp/groff-buildroot/usr/bin/groffer line 167.
# perl(func.pl) at line 157 (depth 5) not loaded at BEGIN SKIP
# perl(man.pl) at line 158 (depth 5) not loaded at BEGIN SKIP
/tmp/groff-buildroot/usr/bin/groffer: deparse failed. isPerl=0.0409154403404476.
find-requires: ERROR: /usr/lib/rpm/perl.req failed

Ошибка несколько интересная. Смотрим в код утилиты groffer:

BEGIN {
...
    die "$groffer_libdir is not an existing directory;"
      unless -d $groffer_libdir;

    unshift(@INC, $groffer_libdir);
...
    require 'func.pl';
    require 'man.pl';
...
}

Как видно во время проверки зависимостей реально отработал код скрипта и
разумеется вышел с ошибкой, и этим завалил сборку пакета.

После консультаций с at@, выяснилось, что блок BEGIN отрабатывает в perl
*всегда*... даже при syntax check.

Таким образом, хочу предостеречь всех кто пакует перловые скрипты: если 
у вас в скрипте есть блок BEGIN, то будьте готовы, что он выполнится нашим 
rpm во время сборки.

Как варианты обхода:
1) Заменить BEGIN на обычный блок (если в нём есть проверки, как
   в моём случае).
2) Отключить поиск зависимостей в перл скриптах :)

-- 
Rgrds, legion



             reply	other threads:[~2008-08-15 12:00 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-15 12:00 Alexey Gladkov [this message]
2008-08-15 12:12 ` Alexey Tourbin
2008-08-15 12:26   ` Alexey Gladkov
2008-08-15 12:32     ` Alexey Tourbin
2008-08-15 13:08     ` Alexey I. Froloff
2008-08-15 13:17       ` Alexey Gladkov
2008-08-15 13:33         ` Led
2008-08-15 13:42           ` Alexey Gladkov
2008-08-15 13:51             ` Led
2008-08-18  7:01 ` Stanislav Ievlev

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=48A56FCE.9030002@altlinux.ru \
    --to=legion@altlinux.ru \
    --cc=devel@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 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