-
Notifications
You must be signed in to change notification settings - Fork 153
Description
Currently, the version extraction logic uses the source image file as presented by the vendor with a sed expression parsing the version out of this sometimes long and complex file name.
This makes sane people sad when looking at these seds.
The proposal is to unify the way the source qcow/vmdk image files are provided to the make to reduce the ambiguity and drive the sed complexity to zero.
I propose to use the following file name format:
vendor_nos_[type]_(anyVersionString).qcow2
where:
vendoris a lowercase vendor name, as used in the makefile'sVENDORvariablenosis a name of the network os, as used in the makefile'sNAMEvariabletypeis a hardware emulated type. An optional field
The version extraction logic then can be centralized in the core make file and removed from the individual make files of a NOS. The version extraction for most systems can use awk and fetch anything from the last _ char until it reaches .qcow2.
NOSes that can't rely on the centralized version extraction should define the VERSION variable in their own make file. This should avoid version detection logic in the centralized make file as it should check if the VERSION variable is set.