ALT Linux Team development discussions
 help / color / mirror / Atom feed
From: Alexey Tourbin <at@altlinux.ru>
To: ALT Linux Team development discussions <devel@lists.altlinux.org>
Subject: Re: [devel] Q: вопрос к знатокам rpm
Date: Fri, 10 Oct 2008 10:22:14 +0400
Message-ID: <20081010062214.GG6399@altlinux.org> (raw)
In-Reply-To: <48EEEE3A.6020005@altlinux.ru>

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

On Fri, Oct 10, 2008 at 09:55:06AM +0400, Alexey Gladkov wrote:
> Alexey Tourbin wrote:
> >Хедер должен целиком помещаться в 
> >память, общий лимит 16M.
> 
> Раз уж зашёл разговор про зависимости. 
> Алексей, вопрос к тебе, я часто наблюдаю 
> такую картину:
> 
> $ rpmquery -R firefox |grep /bin/sh
> /bin/sh
> /bin/sh
> /bin/sh
> 
> понятно, что эти зависимости берутся 
> из-за скриптов.
> 
> По факту это Requires(post), Prequires(pre) и т.д. или у 
> нас генерируются просто Requires: /bin/sh ?

У каждой зависимости, кроме %{REQUIRENAME}, есть ещё %{REQUIREFLAGS}.

$ rpmquery --qf '[%{REQUIRENAME}\t%{REQUIREFLAGS}\n]' firefox |fgrep /bin/sh
/bin/sh 832
/bin/sh 1344
/bin/sh 2368
$

lib/rpmlib.h:
   468  typedef enum rpmsenseFlags_e {
   469      RPMSENSE_ANY        = 0,
   470  /*@-enummemuse@*/
   471      RPMSENSE_SERIAL     = (1 << 0),     /*!< @todo Legacy. */
   472  /*@=enummemuse@*/
   473      RPMSENSE_LESS       = (1 << 1),
   474      RPMSENSE_GREATER    = (1 << 2),
   475      RPMSENSE_EQUAL      = (1 << 3),
   476      RPMSENSE_PROVIDES   = (1 << 4), /* only used internally by builds */
   477      RPMSENSE_CONFLICTS  = (1 << 5), /* only used internally by builds */
   478      RPMSENSE_PREREQ     = (1 << 6),     /*!< @todo Legacy. */
   479      RPMSENSE_OBSOLETES  = (1 << 7), /* only used internally by builds */
   480      RPMSENSE_INTERP     = (1 << 8),     /*!< Interpreter used by scriptlet. */
   481      RPMSENSE_SCRIPT_PRE = ((1 << 9)|RPMSENSE_PREREQ), /*!< %pre dependency. */
   482      RPMSENSE_SCRIPT_POST = ((1 << 10)|RPMSENSE_PREREQ), /*!< %post dependency. */
   483      RPMSENSE_SCRIPT_PREUN = ((1 << 11)|RPMSENSE_PREREQ), /*!< %preun dependency. */
   484      RPMSENSE_SCRIPT_POSTUN = ((1 << 12)|RPMSENSE_PREREQ), /*!< %postun dependency. */
   485      RPMSENSE_SCRIPT_VERIFY = (1 << 13), /*!< %verify dependency. */
   486      RPMSENSE_FIND_REQUIRES = (1 << 14), /*!< find-requires generated dependency. */
   487      RPMSENSE_FIND_PROVIDES = (1 << 15), /*!< find-provides generated dependency. */
   488  
   489      RPMSENSE_TRIGGERIN  = (1 << 16),    /*!< %triggerin dependency. */
   490      RPMSENSE_TRIGGERUN  = (1 << 17),    /*!< %triggerun dependency. */
   491      RPMSENSE_TRIGGERPOSTUN = (1 << 18), /*!< %triggerpostun dependency. */
   492      RPMSENSE_MULTILIB   = (1 << 19),
   493      RPMSENSE_SCRIPT_PREP = (1 << 20),   /*!< %prep build dependency. */
   494      RPMSENSE_SCRIPT_BUILD = (1 << 21),  /*!< %build build dependency. */
   495      RPMSENSE_SCRIPT_INSTALL = (1 << 22),/*!< %install build dependency. */
   496      RPMSENSE_SCRIPT_CLEAN = (1 << 23),  /*!< %clean build dependency. */
   497      RPMSENSE_RPMLIB     = ((1 << 24) | RPMSENSE_PREREQ), /*!< rpmlib(feature) dependency. */
   498  /*@-enummemuse@*/
   499      RPMSENSE_TRIGGERPREIN = (1 << 25),  /*!< @todo Implement %triggerprein. */
   500  /*@=enummemuse@*/
   501  
   502  /*@-enummemuse@*/
   503      RPMSENSE_KEYRING    = (1 << 26)
   504  /*@=enummemuse@*/
   505  } rpmsenseFlags;

То есть флаги зависимостей расшифровываются так:

$ perl -le 'printf "%16b\n", shift' 832
      1101000000
$ perl -le 'printf "%16b\n", shift' 1344
     10101000000
$ perl -le 'printf "%16b\n", shift' 2368
    100101000000
$ 

Это будет, соответственно,
RPMSENSE_PREREQ|RPMSENSE_INTERP|RPMSENSE_SCRIPT_PRE,
RPMSENSE_PREREQ|RPMSENSE_INTERP|RPMSENSE_SCRIPT_POST,
RPMSENSE_PREREQ|RPMSENSE_INTERP|RPMSENSE_SCRIPT_PREUN.

Эти три зависимости можно было бы сгруппировать в одну, с флагами
RPMSENSE_PREREQ|RPMSENSE_INTERP|RPMSENSE_SCRIPT_PRE|RPMSENSE_SCRIPT_POST|RPMSENSE_SCRIPT_PREUN.

В build/reqprov.c уже есть некоторая логика удаления дублирующихся
зависимостей, но слияния по флагам там пока нет.

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

  reply	other threads:[~2008-10-10  6:22 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-10-09 21:07 Konstantin A. Lepikhov
2008-10-09 21:37 ` Led
2008-10-09 21:57   ` Konstantin A. Lepikhov
2008-10-09 22:26     ` Led
2008-10-09 22:43       ` Dmitry V. Levin
2008-10-09 22:55         ` Led
2008-10-09 23:19         ` Konstantin A. Lepikhov
2008-10-09 23:43           ` Led
2008-10-10  5:38 ` Alexey Tourbin
2008-10-10  5:47   ` Alexey Gladkov
2008-10-10  5:52     ` Alexey Tourbin
2008-10-10  5:58       ` Alexey Gladkov
2008-10-10  5:55   ` Alexey Gladkov
2008-10-10  6:22     ` Alexey Tourbin [this message]
2008-10-10  7:50       ` Alexey Gladkov

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=20081010062214.GG6399@altlinux.org \
    --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