[U-Boot] [PATCH v4] mkimage: add "-V" option to print version information

Wolfgang Denk wd at denx.de
Sun Feb 13 00:35:08 CET 2011


Dear Kim Phillips,

In message <20110212171349.f0f5d472.kim.phillips at freescale.com> you wrote:
> 
> > -		@( printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' "$(U_BOOT_VERSION)" \
> > -		 '$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ) > $@.tmp
> > +		@( localvers='$(shell $(TOPDIR)/tools/setlocalversion $(TOPDIR))' ; \
> > +		   printf '#define PLAIN_VERSION "%s%s"\n' \
> > +		   	"$(U_BOOT_VERSION)" "$${localvers}" ; \
> > +		   printf '#define U_BOOT_VERSION "U-Boot %s%s"\n' \
> > +		   	"$(U_BOOT_VERSION)" "$${localvers}" ; \
> > +		) > $@.tmp
> 
> IMO, PLAIN_VERSION isn't descriptive enough (should really be called
> VERSION..?).  How about going with something like:
> 
> #define U_BOOT_STR "U-Boot"
> #define U_BOOT_VERSION U_BOOT_STR " %s%s"...

No - not unless you guarantee that this syntax is compatible with all
assemblers that may be used to build U-Boot.

> and then
> 
> > +			case 'V':
> > +				printf("mkimage version %s\n", PLAIN_VERSION);
> > +				exit(EXIT_SUCCESS);
> 
> &U_BOOT_VERSION[sizeof(U_BOOT_STR)]
> 
> (the - 1 is not necessary since we want to include the ' ')

No again.  This is, um, ugly, and completely unnecessary.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Man is the best computer we can put aboard a spacecraft ...  and  the
only one that can be mass produced with unskilled labor.
                                                  - Wernher von Braun


More information about the U-Boot mailing list