-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 06/09/12 03:55 AM, Ulrich Mueller wrote:
>>>>>> On Thu, 06 Sep 2012, Gregory M Turner wrote:
> 
>> Hello, in my overlay I need to fix a bunch of issues that crop up
>> when implementing EPREFIX construction in scripts due to Cygwin's
>>  idiosyncratic, but POSIX-compliant, handling of paths beginning
>> with "//" (Cygwin does some arguably pathological stuff when such
>> paths are used).
> 
>> Almost all of these stem from the careless tacking of "ROOT" onto
>>  "EPREFIX" in bash-scripts, i.e., as in this (made-up)
>> bash-script snippet:
> 
>> ${ROOT:=/} EPREFIX="@GENTOO_PORTAGE_EPREFIX@" 
>> EROOT="${ROOT}${EPREFIX}"
> 
>> When ROOT is undefined or empty, this script will assign "//foo"
>> to EROOT and bad things will happen in Cygwin.
> 
>> Several correct-ish solutions exist, i.e., in the above we could
>> change the concatenation statement to read:
> 
>> EROOT="${ROOT}${EPREFIX#/}"
> 
> I'd rather do it the other way around: EROOT=${ROOT%/}${EPREFIX}
> 
> Reason: EPREFIX is guaranteed to start with a slash, whereas for
> ROOT I wouldn't be so sure that it always ends with one.
> 
> Ulrich
> 

Not to mention that `man 5 ebuild` specifically defines EROOT to be
"${ROOT%/}${EPREFIX}/" already , so all that's needed is the removal
of the final '/' if I'm reading this correctly..





-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.19 (GNU/Linux)

iF4EAREIAAYFAlBInW8ACgkQ2ugaI38ACPA0UQD/YePPvXa5wNhdvpk656RtwNwa
+yUJKdh/cdu2d8lKCcQA/2/SI4ApNEY/uAf0VxEyRKE6jxdm9/KM6a9gWfSJ0ttn
=gJ7i
-----END PGP SIGNATURE-----

Reply via email to