From: Alexey Tourbin <at@altlinux.ru> To: ALT Devel discussion list <devel@lists.altlinux.org> Subject: Re: [devel] RPM %_tmppath - что плохого в силинках? Date: Thu, 13 Mar 2008 09:58:39 +0300 Message-ID: <20080313065839.GR24653@solemn.turbinal> (raw) In-Reply-To: <200803130951.08149@ruslandh> [-- Attachment #1: Type: text/plain, Size: 3387 bytes --] On Thu, Mar 13, 2008 at 09:50:59AM +0300, Хихин Руслан wrote: > Здравствуйте Alexey Tourbin > В сообщении от 13 марта 2008 Alexey Tourbin написал(a): > > On Wed, Mar 12, 2008 at 01:22:10PM +0600, Ildar Mulyukov wrote: > > > find-lang: ERROR: non-canonical > > > Более того, почему с неканоническими путями без find-lang пакеты > > > собираются? > > Не собираются. > А эту фичу нельзя отключить ? > Всё равно окончательно rpm собирается в хешере, а вот до его сборки в > хешере иногда удобно его собирать в домашнем каталоге, причём > где-нибудь внутри /tmp, который на tmpfs. Тогда придётся усложнять логику поиска зависимостей, причём не сразу понятно в каких именно местах и чем это чревато. А так её удаётся упростить. commit 810f4045edef59b4ba77521d2335a6c4713c357d Author: Alexey Tourbin <at@altlinux> Date: Tue Feb 19 03:13:51 2008 +0300 find-package: removed findpackage_xbroot stuff diff --git a/scripts/find-package.in b/scripts/find-package.in index 00b280a..d4c795b 100755 --- a/scripts/find-package.in +++ b/scripts/find-package.in @@ -58,12 +58,6 @@ Debug "RPM_FINDPACKAGE_ROOT_PATH=$RPM_FINDPACKAGE_ROOT_PATH" # Below we use 'local Verbose=Info' to increase per-case verbosity. Verbose=Verbose -if [ -n "${RPM_BUILD_ROOT-}" ]; then - findpackage_xbroot=$(readlink -ve "$RPM_BUILD_ROOT") -else - unset findpackage_xbroot ||: -fi - FindByPathUnderBuildroot() { local f="$1" rep="$2" xbrep; shift 2 || return @@ -72,12 +66,12 @@ FindByPathUnderBuildroot() MatchBuildroot() { [ -n "$1" ] && - [ -z "${1##$findpackage_xbroot/*}" ] + [ -z "${1##$RPM_BUILD_ROOT/*}" ] } StatPrint() { [ -e "$1" -o -L "$1" ] && - printf '%s\n' "${1#$findpackage_xbroot}" + printf '%s\n' "${1#$RPM_BUILD_ROOT}" } xbrep=$(CanonPath "$RPM_BUILD_ROOT$rep") commit e0598b6fe35fa42ef3737001d1ff38161c6bca84 Author: Alexey Tourbin <at@altlinux> Date: Tue Feb 19 02:38:42 2008 +0300 functions (ValidateBuildRoot): require canonical RPM_BUILD_ROOT Some scripts like lib.req rely on the fact that RPM_BUILD_ROOT should not end with trailing slashes or something. Other scripts like find-package explicitly assume that RPM_BUILD_ROOT can be relocated within filesystem; they use something like "real_buildroot" variables. The code gets complicated, fragile, and error-prone. Therefore, guys, hereby I FORBID non-canonical RPM_BUILD_ROOT path. Note that RPM_BUILD_ROOT actually does not have to exist. This is another problem... diff --git a/scripts/functions b/scripts/functions index 9ffa7f0..636ef74 100644 --- a/scripts/functions +++ b/scripts/functions @@ -57,8 +57,16 @@ Debug() ValidateBuildRoot() { + [ -n "${RPM_BUILD_ROOT-}" ] || + Fatal 'RPM_BUILD_ROOT not set' [ -n "$(printf %s "$RPM_BUILD_ROOT" |tr -d ' /.')" ] || - Fatal 'invalid $RPM_BUILD_ROOT' + Fatal "bogus RPM_BUILD_ROOT=$RPM_BUILD_ROOT" + local real_buildroot + # There could be simply no %install section... + # I pretend that non-existent buildroot is just canonical enough. + real_buildroot=$(readlink -vm -- "$RPM_BUILD_ROOT") + [ "$RPM_BUILD_ROOT" = "$real_buildroot" ] || + Fatal "non-canonical RPM_BUILD_ROOT=$RPM_BUILD_ROOT real_buildroot=$real_buildroot" } [ -z "${RPM_BUILD_ROOT-}" ] || ValidateBuildRoot [-- Attachment #2: Type: application/pgp-signature, Size: 197 bytes --]
next prev parent reply other threads:[~2008-03-13 6:58 UTC|newest] Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top 2008-03-12 7:22 Ildar Mulyukov 2008-03-13 6:30 ` Alexey Tourbin 2008-03-13 6:50 ` Хихин Руслан 2008-03-13 6:58 ` Alexey Tourbin [this message] 2008-03-13 7:05 ` Хихин Руслан 2008-03-13 10:50 ` Alexey Tourbin 2008-03-13 6:52 ` Ildar Mulyukov 2008-03-13 7:02 ` Alexey Tourbin 2008-03-15 0:27 ` 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=20080313065839.GR24653@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