Closed
Bug 747206
Opened 12 years ago
Closed 12 years ago
makefiles: add pure make uppercase/lowercase functions
Categories
(Firefox Build System :: General, defect)
Firefox Build System
General
Tracking
(Not tracked)
RESOLVED
WONTFIX
People
(Reporter: joey, Assigned: joey)
References
Details
Attachments
(1 file)
7.52 KB,
patch
|
glandium
:
review-
|
Details | Diff | Splinter Review |
Removing more shell overhead in the makefiles replacement for: $(shell echo $(var) | tr '[A-Z]' '[a-z]')
Assignee | ||
Comment 1•12 years ago
|
||
uc() and lc() implemented in make. unit test updated to validate functions.
Assignee: nobody → joey
Attachment #616779 -
Flags: review?(ted.mielczarek)
Comment 2•12 years ago
|
||
That seems a whole lot of Make code to do something that could be written as: lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst X,x,$(subst Y,y,$(subst Z,z,$1)))))))))))))))))))))))))) uc = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst x,X,$(subst y,Y,$(subst z,Z,$1))))))))))))))))))))))))))
Assignee | ||
Comment 3•12 years ago
|
||
True the functions could be written this way but hardcoding values will eventually force duplication. If/when more string transforms are needed later on, next iteration will be to refactor lc & uc so 'trans_lower' and 'trans_upper' can be passed as a parameter. Testing benefits by not having to exhaustively validate all of the one-off functions. (In reply to Mike Hommey [:glandium] from comment #2) > That seems a whole lot of Make code to do something that could be written as: > lc = $(subst A,a,$(subst B,b,$(subst C,c,$(subst D,d,$(subst E,e,$(subst > F,f,$(subst G,g,$(subst H,h,$(subst I,i,$(subst J,j,$(subst K,k,$(subst > L,l,$(subst M,m,$(subst N,n,$(subst O,o,$(subst P,p,$(subst Q,q,$(subst > R,r,$(subst S,s,$(subst T,t,$(subst U,u,$(subst V,v,$(subst W,w,$(subst > X,x,$(subst Y,y,$(subst Z,z,$1)))))))))))))))))))))))))) > uc = $(subst a,A,$(subst b,B,$(subst c,C,$(subst d,D,$(subst e,E,$(subst > f,F,$(subst g,G,$(subst h,H,$(subst i,I,$(subst j,J,$(subst k,K,$(subst > l,L,$(subst m,M,$(subst n,N,$(subst o,O,$(subst p,P,$(subst q,Q,$(subst > r,R,$(subst s,S,$(subst t,T,$(subst u,U,$(subst v,V,$(subst w,W,$(subst > x,X,$(subst y,Y,$(subst z,Z,$1))))))))))))))))))))))))))
Comment 4•12 years ago
|
||
Comment on attachment 616779 [details] [diff] [review] add native make uc() and lc() functions Review of attachment 616779 [details] [diff] [review]: ----------------------------------------------------------------- ::: config/makefiles/makeutils.mk @@ +61,5 @@ > +$(strip \ > + $(eval __local_lc:=$(1))\ > + $(foreach transform,$(trans_toLower),\ > + $(eval __local_lc:=$(subst $(call getByDelim,$(transform),$(caret),1),$(call getByDelim,$(transform),$(caret),2),$(__local_lc))))\ > + $(__local_lc)\ (In reply to Joey Armstrong [:joey] from comment #3) > True the functions could be written this way but hardcoding values will > eventually force duplication. If/when more string transforms are needed > later on, next iteration will be to refactor lc & uc so 'trans_lower' and > 'trans_upper' can be passed as a parameter. Please do so in this patch, then.
Attachment #616779 -
Flags: review?(ted.mielczarek) → review-
Updated•12 years ago
|
Status: NEW → RESOLVED
Closed: 12 years ago
Resolution: --- → WONTFIX
Updated•6 years ago
|
Product: Core → Firefox Build System
You need to log in
before you can comment on or make changes to this bug.
Description
•