lua-platform-info: allow . character in image names

Additionally, multiple . will be collapsed to one, and combinations of - and .
with at least one - will be replaced by a single -
This commit is contained in:
Matthias Schiffer 2014-11-26 21:32:38 +01:00
parent 3d91fb8537
commit 78927d65a2
2 changed files with 2 additions and 2 deletions

View File

@ -33,5 +33,5 @@ end
-- The image name for sysupgrades
function get_image_name()
return (model:lower():gsub('[^%w]+', '-'):gsub('%-+$', ''))
return (model:lower():gsub('[^%w%.]+', '-'):gsub('%.+', '.'):gsub('[%-%.]*%-[%-%.]*', '-'):gsub('%-+$', ''))
end

View File

@ -33,5 +33,5 @@ end
-- The image name for sysupgrades
function get_image_name()
return (model:lower():gsub('[^%w]+', '-'):gsub('%-+$', ''))
return (model:lower():gsub('[^%w%.]+', '-'):gsub('%.+', '.'):gsub('[%-%.]*%-[%-%.]*', '-'):gsub('%-+$', ''))
end