ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: ALT Devel discussion list <devel@lists.altlinux.org>
Subject: Re: [devel] [git update] packages/perl: heads/master
Date: Thu, 15 Nov 2007 00:26:16 +0300
Message-ID: <20071114212616.GD6050@solemn.turbinal> (raw)
In-Reply-To: <20071114204614.GC6050@solemn.turbinal>


[-- Attachment #1.1: Type: text/plain, Size: 1000 bytes --]

On Wed, Nov 14, 2007 at 11:46:14PM +0300, Alexey Tourbin wrote:
> В принципе у меня была идея сделать что-то типа libperl.req,
> который если обнаруживает, что зависимость на PERL_X.Y.Z больше текущей
> версии самого perl X.Y.Z, то ставит зависимость на текущий
> 'perl-base >= X.Y.Z-%release'.

Вот такая зарисовка у меня есть.
Она делает как раз сравнение версий: если версия самого перла 5.8.8
а зависимость на libperl.5.8(PERL_5.8.9) значит используется
"опережающий интерфейс" и ставится зависимость >= 5.8.8-%release.

Только это, во-первых, не очень системное решение.  В принципе
можно как-то обобщить, чтобы можно было накрыть целый класс проблем
(сборки snapshot'ов с незакрытым интерфейсом).  Во-вторых, привязываться
именно к релизу всё-таки не очень хочется.  Но больше привязываться не к
чему.

В общем не знаю делать так или нет.

$ objdump -p /usr/bin/perl |grep PERL_
    0x02235169 0x00 06 PERL_5.8.9
$ ./libperl.req /usr/bin/perl
perl-base >= 5.8.8-alt15
$

[-- Attachment #1.2: libperl.req --]
[-- Type: text/plain, Size: 767 bytes --]

#!/bin/sh

perl_dep=$(rpm -qf /usr/bin/perl --qf '%{NAME} >= %{VERSION}-%{RELEASE}')
perl_version_num=$(rpm -qf /usr/bin/perl --qf '%{VERSION}' |
	awk -F. '{print$1*1000*1000+$2*1000+$3}')

. /usr/lib/rpm/functions

perl_version_refs()
{
	objdump -p "$f" |awk '
		BEGIN				{ START = 0 }
		/^Version References:/		{ START = 1 }
		/^ *required from /		{ START = 2 }
		/^ *required from libperl/	{ START = 3 }
		(START==3 && $1~/^0x/ && $NF~/^PERL_/) {
			sub(/^PERL_/, "", $NF)
			split($NF, ary, ".")
			print ary[1]*1000*1000+ary[2]*1000+ary[3]
		}'
}


LibPerlReq()
{
	local f="$1"; shift
	local ver="$(perl_version_refs "$f" |sort -rn |head -1)"
	if [ -n "$ver" ] && [ "$ver" -gt "$perl_version_num" ]; then
		echo "$perl_dep"
	fi
}

ArgvFileAction LibPerlReq "$@"

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

      reply	other threads:[~2007-11-14 21:26 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-14 10:44 ` Dmitry V. Levin
2007-11-14 11:37   ` Денис Смирнов
2007-11-14 20:50     ` [devel] nginx / 4.0 (Re: [git update] packages/perl: heads/master) Michael Shigorin
2007-11-15 10:37       ` Денис Смирнов
2007-11-16  7:11         ` Michael Shigorin
2007-11-16 17:32           ` Денис Смирнов
2007-11-16 17:37             ` [devel] [jt] nginx / 4.0 Dmitry V. Levin
2007-11-17  1:25               ` Денис Смирнов
2007-11-21 13:11                 ` Michael Shigorin
2007-11-26 13:50                   ` Денис Смирнов
2007-11-26 20:25                     ` Michael Shigorin
2007-12-01 17:24                   ` Денис Смирнов
2007-11-14 20:34   ` [devel] [git update] packages/perl: heads/master Alexey Tourbin
2007-11-14 20:46     ` Alexey Tourbin
2007-11-14 21:26       ` Alexey Tourbin [this message]

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=20071114212616.GD6050@solemn.turbinal \
    --to=at@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