webbuild.js: improved 'Start from URL' filename parsing

This commit is contained in:
Silvan Calarco 2013-06-03 13:57:58 +02:00
parent 16b2ff1ce9
commit 92a3d43064

View File

@ -43,9 +43,18 @@ function suggestSpecName(url) {
e != ".orig") break;
specname=specname.substring(0,i);
}
i=specname.lastIndexOf('_');
e=specname.substring(i);
if (e == "_src" || e == "_orig") specname=specname.substring(0,i);
i=specname.lastIndexOf('-');
e=specname.substring(i);
if (e == "-src" || e == "-orig") specname=specname.substring(0,i);
if (specname.lastIndexOf('-') > 0) {
version=specname.substring(specname.lastIndexOf('-')+1);
specname=specname.substring(0,specname.lastIndexOf('-'));
} else if (specname.lastIndexOf('_') > 0) {
version=specname.substring(specname.lastIndexOf('_')+1);
specname=specname.substring(0,specname.lastIndexOf('_'));
}
document.getElementById("speccreateurl").value=url;
if (url.search("cpan.org") >= 0) {