From fd4cdba61e51a949b56fa94591d06cb21b906b98 Mon Sep 17 00:00:00 2001 From: Hisham Muhammad Date: Fri, 1 Dec 2017 14:04:26 -0200 Subject: Use 'dev' instead of 'scm'. Match terminology used in luarocks.org. 'scm' is still supported for compatibility reasons, but is no longer the recommended term. --- src/luarocks/cmd/build.lua | 2 +- src/luarocks/cmd/make.lua | 2 +- src/luarocks/cmd/upload.lua | 6 +++++- src/luarocks/cmd/write_rockspec.lua | 6 +++--- src/luarocks/core/cfg.lua | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/src/luarocks/cmd/build.lua b/src/luarocks/cmd/build.lua index 904a7298..0d969ff6 100644 --- a/src/luarocks/cmd/build.lua +++ b/src/luarocks/cmd/build.lua @@ -33,7 +33,7 @@ or the name of a rock to be fetched from a repository. --branch= Override the `source.branch` field in the loaded rockspec. Allows to specify a different branch to - fetch. Particularly for SCM rocks. + fetch. Particularly for "dev" rocks. --only-deps Installs only the dependencies of the rock. diff --git a/src/luarocks/cmd/make.lua b/src/luarocks/cmd/make.lua index bfdddb37..8f01856e 100644 --- a/src/luarocks/cmd/make.lua +++ b/src/luarocks/cmd/make.lua @@ -45,7 +45,7 @@ only dependencies of the rockspec (see `luarocks help install`). --branch= Override the `source.branch` field in the loaded rockspec. Allows to specify a different branch to - fetch. Particularly for SCM rocks. + fetch. Particularly for "dev" rocks. ]] diff --git a/src/luarocks/cmd/upload.lua b/src/luarocks/cmd/upload.lua index baee47ab..a0b69447 100644 --- a/src/luarocks/cmd/upload.lua +++ b/src/luarocks/cmd/upload.lua @@ -20,6 +20,10 @@ upload.help = [[ increment the revision number instead. ]] +local function is_dev_version(version) + return version:match("^dev") or version:match("^scm") +end + function upload.command(flags, fname) if not fname then return nil, "Missing rockspec. "..util.see_help("upload") @@ -53,7 +57,7 @@ function upload.command(flags, fname) end local rock_fname - if not flags["skip-pack"] and not rockspec.version:match("^scm") then + if not flags["skip-pack"] and not is_dev_version(rockspec.version) then util.printout("Packing " .. tostring(rockspec.package)) rock_fname, err = pack.pack_source_rock(fname) if not rock_fname then diff --git a/src/luarocks/cmd/write_rockspec.lua b/src/luarocks/cmd/write_rockspec.lua index 06d50c69..edb4de3d 100644 --- a/src/luarocks/cmd/write_rockspec.lua +++ b/src/luarocks/cmd/write_rockspec.lua @@ -21,7 +21,7 @@ second one is the location. If only one argument is given, it must be the location. If no arguments are given, current directory is used as location. LuaRocks will attempt to infer name and version if not given, -using 'scm' as default version. +using 'dev' as a fallback default version. Note that the generated file is a _starting point_ for writing a rockspec, and is not guaranteed to be complete or correct. @@ -261,7 +261,7 @@ function write_rockspec.command(flags, name, version, url_or_dir) if not name then return nil, "Could not infer rock name. "..util.see_help("write_rockspec") end - version = version or "scm" + version = version or "dev" local filename = flags["output"] or dir.path(fs.current_dir(), name:lower().."-"..version.."-1.rockspec") @@ -296,7 +296,7 @@ function write_rockspec.command(flags, name, version, url_or_dir) rockspec.source.file = dir.base_name(url_or_dir) rockspec.source.dir = "dummy" if not fetch.is_basic_protocol(rockspec.source.protocol) then - if version ~= "scm" then + if version ~= "dev" then rockspec.source.tag = flags["tag"] or "v" .. version end end diff --git a/src/luarocks/core/cfg.lua b/src/luarocks/core/cfg.lua index f22acbb4..e6351add 100644 --- a/src/luarocks/core/cfg.lua +++ b/src/luarocks/core/cfg.lua @@ -30,7 +30,7 @@ local persist = require("luarocks.core.persist") local require = nil -------------------------------------------------------------------------------- -cfg.program_version = "scm" +cfg.program_version = "dev" cfg.program_series = "3.0" cfg.major_version = (cfg.program_version:match("([^.]%.[^.])")) or cfg.program_series cfg.variables = {} -- cgit v1.2.3-55-g6feb