From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Date: Thu, 13 Mar 2008 09:58:39 +0300 From: Alexey Tourbin To: ALT Devel discussion list Message-ID: <20080313065839.GR24653@solemn.turbinal> Mail-Followup-To: ALT Devel discussion list References: <1205306530l.24196l.2l@ildar.innovations.kz> <20080313063043.GO24653@solemn.turbinal> <200803130951.08149@ruslandh> Mime-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Aq6vH1t1JS3Uc7g3" Content-Disposition: inline In-Reply-To: <200803130951.08149@ruslandh> Subject: Re: [devel] =?koi8-r?b?UlBNICVfdG1wcGF0aCAtIN7UzyDQzM/Iz8fPINcg08nM?= =?koi8-r?b?yc7Lwcg/?= X-BeenThere: devel@lists.altlinux.org X-Mailman-Version: 2.1.10b3 Precedence: list Reply-To: ALT Linux Team development discussions List-Id: ALT Linux Team development discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 13 Mar 2008 06:58:40 -0000 Archived-At: List-Archive: List-Post: --Aq6vH1t1JS3Uc7g3 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Mar 13, 2008 at 09:50:59AM +0300, =E8=C9=C8=C9=CE =F2=D5=D3=CC=C1= =CE wrote: > =FA=C4=D2=C1=D7=D3=D4=D7=D5=CA=D4=C5 Alexey Tourbin > =F7 =D3=CF=CF=C2=DD=C5=CE=C9=C9 =CF=D4 13 =CD=C1=D2=D4=C1 2008 Alexey T= ourbin =CE=C1=D0=C9=D3=C1=CC(a): > > On Wed, Mar 12, 2008 at 01:22:10PM +0600, Ildar Mulyukov wrote: > > > find-lang: ERROR: non-canonical > > > =E2=CF=CC=C5=C5 =D4=CF=C7=CF, =D0=CF=DE=C5=CD=D5 =D3 =CE=C5=CB=C1=CE= =CF=CE=C9=DE=C5=D3=CB=C9=CD=C9 =D0=D5=D4=D1=CD=C9 =C2=C5=DA find-lang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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=3D$RPM_FINDPACKAGE_ROOT= _PATH" # Below we use 'local Verbose=3DInfo' to increase per-case verbosity. Verbose=3DVerbose =20 -if [ -n "${RPM_BUILD_ROOT-}" ]; then - findpackage_xbroot=3D$(readlink -ve "$RPM_BUILD_ROOT") -else - unset findpackage_xbroot ||: -fi - FindByPathUnderBuildroot() { local f=3D"$1" rep=3D"$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}" } =20 xbrep=3D$(CanonPath "$RPM_BUILD_ROOT$rep") commit e0598b6fe35fa42ef3737001d1ff38161c6bca84 Author: Alexey Tourbin Date: Tue Feb 19 02:38:42 2008 +0300 functions (ValidateBuildRoot): require canonical RPM_BUILD_ROOT =20 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. =20 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() =20 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=3D$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=3D$(readlink -vm -- "$RPM_BUILD_ROOT") + [ "$RPM_BUILD_ROOT" =3D "$real_buildroot" ] || + Fatal "non-canonical RPM_BUILD_ROOT=3D$RPM_BUILD_ROOT real_buildroot=3D$= real_buildroot" } =20 [ -z "${RPM_BUILD_ROOT-}" ] || ValidateBuildRoot --Aq6vH1t1JS3Uc7g3 Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.8 (GNU/Linux) iEYEARECAAYFAkfY0J8ACgkQfBKgtDjnu0Z4pwCg3SA9OHLAWOdS6r9b45jr87X0 TtsAn004eqBLMAiuu/1jEVhzE7ygQ+3J =cc1f -----END PGP SIGNATURE----- --Aq6vH1t1JS3Uc7g3--