Page MenuHomeFreeBSD

localedef: unbreak WITHOUT_LOCALES
ClosedPublic

Authored by bz on Aug 17 2021, 5:54 PM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 23, 11:54 AM
Unknown Object (File)
Sun, Sep 22, 8:27 AM
Unknown Object (File)
Wed, Sep 11, 1:24 AM
Unknown Object (File)
Sun, Sep 8, 4:32 AM
Unknown Object (File)
Sat, Sep 7, 2:28 PM
Unknown Object (File)
Sat, Sep 7, 1:14 PM
Unknown Object (File)
Sun, Sep 1, 2:58 PM
Unknown Object (File)
Aug 30 2024, 5:38 AM
Subscribers

Details

Summary

After 0fa5403d493be24dda2bf575c04019ef2dcc9d0c we need
usr.bin/localedef as a bootstrap tool independent on where
WITHOUT_LOCALE was specified as we ALWAYS process C.UTF-8.

At the same time LOCALES= in the local Makefile is emptyw but
C.UTF-8 with WITHOUT_LOCALES and thus after the replacement
FILES= is set to only .LC_CTYPE which results in a build failure
not knowing how to build that. Put #ifdef MK_LOCALES around and
set FILES= in case we do not want locales (but C.UTF-8).

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 41102
Build 37991: arc lint + arc unit

Event Timeline

bz requested review of this revision.Aug 17 2021, 5:54 PM

An additional request; in addition to review I'd be happy if someone else can handle (update the change if needed and commit) this.

Makefile.inc1 LGTM, will check ctypedef

Makefile.inc1 change is good, module my quibble. The ctypedef one I'll have to study too...

Makefile.inc1
2356

I'd drop the word now. It won't age well.

here's an easy way to show:

--- share/ctypedef/Makefile
+++ share/ctypedef/Makefile
@@ -261,4 +261,7 @@ ${t:S/src$/LC_CTYPE/}: $s
        -i ${.ALLSRC} ${.OBJDIR}/${.TARGET:T:R}  || true
 .endfor
 
+foo:
+       echo "FILES ${FILES}"
+
 .include <bsd.prog.mk>

Without the Makefile change:

% make -n foo -DWITHOUT_LOCALES
echo "FILES .LC_CTYPE"

^^^^ here's the problem Cannot build that.

% make -n foo
echo "FILES be_BY.CP1131.LC_CTYPE ca_IT.ISO8859-1.LC_CTYPE ca_IT.ISO8859-15.LC_CTYPE el_GR.ISO8859-7.LC_CTYPE en_US.ISO8859-1.LC_CTYPE en_US.ISO8859-15.LC_CTYPE en_US.US-ASCII.LC_CTYPE hi_IN.ISCII-DEV.LC_CTYPE hy_AM.ARMSCII-8.LC_CTYPE ja_JP.SJIS.LC_CTYPE ja_JP.eucJP.LC_CTYPE ko_KR.eucKR.LC_CTYPE lv_LV.ISO8859-13.LC_CTYPE ru_RU.CP1251.LC_CTYPE ru_RU.CP866.LC_CTYPE ru_RU.ISO8859-5.LC_CTYPE ru_RU.KOI8-R.LC_CTYPE sr_RS.ISO8859-2.LC_CTYPE tr_TR.ISO8859-9.LC_CTYPE uk_UA.CP1251.LC_CTYPE uk_UA.ISO8859-5.LC_CTYPE uk_UA.KOI8-U.LC_CTYPE zh_CN.GB18030.LC_CTYPE zh_CN.GB2312.LC_CTYPE zh_CN.GBK.LC_CTYPE zh_CN.eucCN.LC_CTYPE zh_TW.Big5.LC_CTYPE"

and with the Makefile change:

% make -n foo -DWITHOUT_LOCALES
echo "FILES "

% make -n foo
echo "FILES be_BY.CP1131.LC_CTYPE ca_IT.ISO8859-1.LC_CTYPE ca_IT.ISO8859-15.LC_CTYPE el_GR.ISO8859-7.LC_CTYPE en_US.ISO8859-1.LC_CTYPE en_US.ISO8859-15.LC_CTYPE en_US.US-ASCII.LC_CTYPE hi_IN.ISCII-DEV.LC_CTYPE hy_AM.ARMSCII-8.LC_CTYPE ja_JP.SJIS.LC_CTYPE ja_JP.eucJP.LC_CTYPE ko_KR.eucKR.LC_CTYPE lv_LV.ISO8859-13.LC_CTYPE ru_RU.CP1251.LC_CTYPE ru_RU.CP866.LC_CTYPE ru_RU.ISO8859-5.LC_CTYPE ru_RU.KOI8-R.LC_CTYPE sr_RS.ISO8859-2.LC_CTYPE tr_TR.ISO8859-9.LC_CTYPE uk_UA.CP1251.LC_CTYPE uk_UA.ISO8859-5.LC_CTYPE uk_UA.KOI8-U.LC_CTYPE zh_CN.GB18030.LC_CTYPE zh_CN.GB2312.LC_CTYPE zh_CN.GBK.LC_CTYPE zh_CN.eucCN.LC_CTYPE zh_TW.Big5.LC_CTYPE"

I guess the question left for me is whether there is a more elegant variant to the ${:<x>} substitutions to avoid the subsitution on an empty result after :N?

I might assume that alternatively this might also work?

--- share/ctypedef/Makefile
+++ share/ctypedef/Makefile
@@ -218,7 +218,7 @@ SAME+=              ko_KR.eucKR ko_KR.CP949 # legacy (same charset)
 
 # C.UTF-8 is the default locale, so it should always been installed.
 ALWAYS=                C.UTF-8.LC_CTYPE
-FILES=         ${LOCALES:NC.UTF-8:S/$/.LC_CTYPE/}
+FILES=         ${LOCALES:NC.UTF-8:C/.+$/&.LC_CTYPE/}
 CLEANFILES=    ${FILES}
 
 .for f t in ${SAME}

Switch to better regex rather than having .ifdef check.

Looks great. Thanks for changes.

This revision is now accepted and ready to land.Aug 19 2021, 5:04 PM
Makefile.inc1
2357

We should drop this definition and move the directory back inline now that it's not conditional anymore, I can do that pre-commit

Makefile.inc1
2357

Be my guest. Can you do the ctypedef Makefile then as well please?

Makefile.inc1
2357

Yup, I'll grab it, thanks!

Makefile.inc1
2357

I had a change of heart about moving this inline because of the documentation value, so I'm leaving it as-is and committing now...

This revision was automatically updated to reflect the committed changes.