I am try to get sys-libs/glibc to support Prefix. Here is the first patch of the locale-gen script. Please review. Reproducible: Always
Created attachment 351104 [details, diff] locale-gen_prefix.patch
Created attachment 351106 [details, diff] locale-gen_prefix.patch
Created attachment 351108 [details, diff] locale-gen_prefix.patch
Created attachment 351110 [details, diff] locale-gen_prefix.patch
Comment on attachment 351110 [details, diff] locale-gen_prefix.patch >-source /etc/init.d/functions.sh || { >+source "${EPREFIX}"/etc/init.d/functions.sh || { don't you need to encode EPREFIX in the shell script ? or is it always set in the environment (even runtime) ? >+# For log pathes, the line may get wrapped into two, in which case space (' ') is replaced guessing you mean "long paths" >+# by newline (\n). >+LOCALEDIR=$(LC_ALL="C" "${DESTDIR}"usr/bin/localedef --help | sed -n -e'/locale path/{N;s|.*:[ \n]\(.*\):/.*|\1|;p}') don't escape things to get eregexp syntax. use the -r flag with sed.
(In reply to SpanKY from comment #5) > Comment on attachment 351110 [details, diff] [details, diff] > locale-gen_prefix.patch > > >-source /etc/init.d/functions.sh || { > >+source "${EPREFIX}"/etc/init.d/functions.sh || { > > don't you need to encode EPREFIX in the shell script ? or is it always set > in the environment (even runtime) ? Yes, you cannot rely on it being in the environment
Created attachment 351322 [details, diff] locale-gen_prefix.patch Thanks for reviewing. Updated the patch according to the comments.
Created attachment 351324 [details, diff] locale-gen_prefix.patch oops, forgot other EPREFIX occurences. And inherit prefix / eprefixify is omitted this time because glibc in my overlay is behind gx86 tree.
Comment on attachment 351324 [details, diff] locale-gen_prefix.patch >+source "@GENTOO_PORTAGE_EPREFIX@"/etc/init.d/functions.sh || { do this above: EPREFIX="@GENTOO_PORTAGE_EPREFIX@" if [[ ${EPREFIX} == "@"GENTOO_PORTAGE_EPREFIX"@" ]] ; then EPREFIX="" fi then you can use $EPREFIX like normal >+ einfo "Using locale.gen from EROOT ${EROOT}etc/" hmm, i'd prefer to keep saying "ROOT" in the output
Created attachment 351434 [details, diff] locale-gen_prefix.patch updated accordingly. Thanks.
the code also does this: if [[ ${QUIET} -eq 0 ]] && [[ -z ${JUST_LIST} ]] && \ [[ -e ${ROOT}etc/locales.build ]] then shouldn't that be $EROOT ?
(In reply to SpanKY from comment #11) > the code also does this: > if [[ ${QUIET} -eq 0 ]] && [[ -z ${JUST_LIST} ]] && \ > [[ -e ${ROOT}etc/locales.build ]] > then > > shouldn't that be $EROOT ? From the following lines, ewarn "You should upgrade your /etc/locales.build to /etc/locale.gen" ewarn "and then remove /etc/locales.build when you're done.\n" it is used for transition from some older version of locale-gen. Being introducting locale-gen afresh, we don't need to consider it in Prefix, do we?
(In reply to Benda Xu from comment #12) more accurately, it's from when the glibc ebuild itself would read locales.build and we didn't have `locale-gen` at all yet. you are right that prefix probably didn't exist (it's been deprecated for at least 4 years ... i'd have to go through the history to try and figure out when we started doing this new stuff). however, let's say the file did exist on prefix systems. using $EROOT is still the correct answer isn't it ? i don't want the script using $EROOT in most places but then using $ROOT in a few random places. it's pointlessly confusing and will lead to $ROOT getting copy & pasted in places where it should be $EROOT.
Created attachment 352206 [details, diff] locale-gen_prefix.patch Good point, Mike. Updated the patch accordingly.
(In reply to Benda Xu from comment #14) queued in the tree: http://sources.gentoo.org/gentoo/src/patchsets/glibc/extra/locale/locale-gen?r1=1.32&r2=1.33 whenever a new patchset is generated, this will get included automatically
Thanks, Mike.
Now that the locale-gen is patched, we need to call eprefixify to the script. Committed without changing keywords or revisions: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=debdaa5625ac306670fbcf6fa10126cac8e4dab3