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] /etc/ld.so.cache
Date: Mon, 15 Sep 2008 11:11:47 +0400
Message-ID: <20080915071147.GA5223@altlinux.org> (raw)
In-Reply-To: <20080911205329.GB31868@wo.int.altlinux.org>

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

On Fri, Sep 12, 2008 at 12:53:29AM +0400, Dmitry V. Levin wrote:
> > > Кстати, вот как это сделано в Мандриве (glibc-2.8-1.20080520.5mnb2.src.rpm),
> > > glibc.spec:
> > >   1015  # automatic ldconfig cache update on rpm installs/removals
> > >   1016  # (see http://wiki.mandriva.com/en/Rpm_filetriggers)
> > >   1017  install -d %buildroot%{_var}/lib/rpm/filetriggers
> > >   1018  cat > %buildroot%{_var}/lib/rpm/filetriggers/ldconfig.filter << EOF
> > >   1019  ^.((/lib|/usr/lib)(64)?/[^/]*\.so\.|/etc/ld.so.conf.d/[^/]*\.conf)
> > >   1020  EOF
> > >   1021  cat > %buildroot%{_var}/lib/rpm/filetriggers/ldconfig.script << EOF
> > >   1022  #!/bin/sh
> > >   1023  ldconfig -X
> > >   1024  EOF
> > >   1025  chmod 755 %buildroot%{_var}/lib/rpm/filetriggers/ldconfig.script
> > 
> > Кстати, при подобном раскладе (если содержать триггер в glibc-core),
> > у пакета glibc-core появится зависимость на sh (а у sh уже есть
> > зависимость на glibc-core).  Впрочем, триггер можно написать на Си...
> 
> В glibc-core уже есть несколько таких скриптов на C.
> А вот если там появится зависимость на @RPMCONFIGDIR@, то будет не очень
> здорово.

Вот как я себе представляю более аккуратную реализацию.

/usr/lib/rpm/0ldconfig.filetrigger
     1	#!/bin/sh
     2	
     3	IFS=
     4	while read -r f; do
     5		case "$f" in
     6			/lib/lib*/*.so* |\
     7			/lib64/lib*/*.so* |\
     8			/usr/lib/lib*/*.so* |\
     9			/usr/lib64/lib*/*.so* )
    10				# false positives
    11				continue ;;
    12			/lib/lib*.so |\
    13			/lib64/lib*.so |\
    14			/usr/lib/lib*.so |\
    15			/usr/lib64/lib*.so )
    16				# maybe soname
    17				if set $f.* && [ -f "$1" ]; then
    18					continue
    19				fi
    20				;;
    21			/lib/lib*.so.* |\
    22			/lib64/lib*.so.* |\
    23			/usr/lib/lib*.so.* |\
    24			/usr/lib64/lib*.so.* )
    25				# soname
    26				;;
    27			/etc/ld.so.conf.d/*.conf)
    28				;;
    29			*) continue ;;
    30		esac
    31		exec /sbin/ldconfig
    32	done

Такой триггер должен кооркетно обрабатывать установку и удаление *-devel
пакетов с симлинками (для них запускать ldconfig не надо).

В принципе можно запаковать такой триггер не в glibc-core, а в rpm.

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

  reply	other threads:[~2008-09-15  7:11 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-08  9:51 [devel] posttrans filetriggers [2] Alexey Tourbin
2008-09-08 12:07 ` Igor Vlasenko
2008-09-08 13:49 ` [devel] libgtk+2 Dmitry V. Levin
2008-09-08 13:55   ` Alexey Rusakov
2008-09-08 14:18   ` Yuri N. Sedunov
2008-09-08 14:23     ` Dmitry V. Levin
2008-09-08 14:42       ` Yuri N. Sedunov
2008-09-08 14:46         ` Dmitry V. Levin
2008-09-08 15:15           ` Yuri N. Sedunov
2008-09-08 15:21             ` Mikhail Gusarov
2008-09-08 15:24             ` Andrey Rahmatullin
2008-09-08 15:26             ` Alexey Rusakov
2008-09-08 15:41               ` Yuri N. Sedunov
2008-09-08 15:46                 ` Dmitry V. Levin
2008-09-08 15:54                   ` Yuri N. Sedunov
2008-09-09 10:05                     ` Sergey V Turchin
2008-09-08 15:27             ` Dmitry V. Levin
2008-09-11 19:25   ` [devel] /etc/ld.so.cache Alexey Tourbin
2008-09-11 19:58     ` Dmitry V. Levin
2008-09-11 20:16       ` Alexey Tourbin
2008-09-11 20:20         ` Dmitry V. Levin
2008-09-11 20:38           ` Alexey Tourbin
2008-09-11 20:48             ` Alexey Tourbin
2008-09-11 20:53               ` Dmitry V. Levin
2008-09-15  7:11                 ` Alexey Tourbin [this message]
2008-09-15 10:05                   ` Dmitry V. Levin
2008-09-19  7:02                     ` Alexey Tourbin
2008-10-06  7:04                   ` Alexey Tourbin
2008-09-11 20:50             ` 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=20080915071147.GA5223@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