From: Alexey Tourbin <at@altlinux.ru>
To: devel@lists.altlinux.org
Subject: Re: [devel] Владение директориями в rpm
Date: Mon, 1 Dec 2008 15:09:09 +0300
Message-ID: <20081201120908.GD25270@altlinux.org> (raw)
In-Reply-To: <20081201115720.GA17953@imap.altlinux.org>
[-- Attachment #1: Type: text/plain, Size: 1759 bytes --]
On Mon, Dec 01, 2008 at 02:57:20PM +0300, Grigory Batalov wrote:
> Что случится, если два разных пакета содержат (владеют) одну и ту же
> директорию?
Если директории "одинаковые", то ничего не случится -- rpm "поделит"
этот каталог между двумя пакетами, и будет пробовать удалять его только
при удалении последнего пакета, который владеет этим каталогом.
Если же директории "разные", то будет файловый конфликт.
Это касается и файлов.
lib/transaction.c:
878 static int filecmp(const TFI_t fi1, const int ix1, const TFI_t fi2, const int ix2)
879 /*@*/
880 {
881 uint_16 m1 = fi1->fmodes[ix1], m2 = fi2->fmodes[ix2];
882 uint_32 f1 = fi1->fflags[ix1], f2 = fi2->fflags[ix2];
883 const char *u1 = fi1->fuser[ix1], *u2 = fi2->fuser[ix2];
884 const char *g1 = fi1->fgroup[ix1], *g2 = fi2->fgroup[ix2];
885
886 /* both file type and permissions must match */
887 if (m1 != m2)
888 return 1;
889
890 /* ownership must also match */
891 if (strcmp(u1, u2) || strcmp(g1, g2))
892 return 1;
893
894 if ((f1 | f2) & RPMFILE_GHOST)
895 /* one or both %ghost files, no extra check */
896 ;
897 else if (S_ISLNK(m1)) {
898 /* symlinks must have the same target */
899 const char *l1 = fi1->flinks[ix1], *l2 = fi2->flinks[ix2];
900 if (strcmp(l1, l2))
901 return 1;
902 }
903 else if (S_ISREG(m1)) {
904 /* regular files must have the same md5 sum */
905 const char *md51 = fi1->fmd5s[ix1], *md52 = fi2->fmd5s[ix2];
906 if (strcmp(md51, md52))
907 return 1;
908 }
909
910 /* e.g. mtime difference is immaterial */
911 return 0;
912 }
[-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2008-12-01 12:09 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-01 11:57 Grigory Batalov
2008-12-01 12:06 ` Led
2008-12-01 12:09 ` Alexey Tourbin [this message]
2008-12-01 12:43 ` Vitaly Ostanin
2008-12-01 12:57 ` Grigory Batalov
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=20081201120908.GD25270@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