nitpm: rename from picnit
authorAlexis Laferrière <alexis.laf@xymus.net>
Sat, 3 Mar 2018 23:27:43 +0000 (18:27 -0500)
committerAlexis Laferrière <alexis.laf@xymus.net>
Wed, 28 Mar 2018 13:14:04 +0000 (09:14 -0400)
Signed-off-by: Alexis Laferrière <alexis.laf@xymus.net>

share/man/nitpm.md [moved from share/man/picnit.md with 68% similarity]
src/Makefile
src/loader.nit
src/nitpm.nit [moved from src/picnit.nit with 92% similarity]
src/nitpm_shared.nit [moved from src/picnit_shared.nit with 97% similarity]

similarity index 68%
rename from share/man/picnit.md
rename to share/man/nitpm.md
index 6b353d1..56bc3eb 100644 (file)
@@ -1,10 +1,10 @@
 # NAME
 
-picnit - Nit package manager
+nitpm - Nit package manager
 
 # SYNOPSIS
 
-picnit [--help] [--verbose] <command> [<args>]
+nitpm [--help] [--verbose] <command> [<args>]
 
 # OPTIONS
 
@@ -22,33 +22,33 @@ Print more information, may be useful for debugging.
 
 Install a package by searching for its name or directly from a Git repository URL.
 
-       picnit install hello_picnit
-       picnit install https://gitlab.com/xymus/hello_picnit.git
+       nitpm install hello_nitpm
+       nitpm install https://gitlab.com/xymus/hello_nitpm.git
 
 ### list
 
 List installed packages.
 
-       picnit list
+       nitpm list
 
 ### upgrade
 
 Upgrade a package.
 
-       picnit upgrade hello_picnit
+       nitpm upgrade hello_nitpm
 
 ### uninstall
 
 Uninstall a package.
 
-       picnit uninstall hello_picnit
+       nitpm uninstall hello_nitpm
 
 ### help
 
 Show general help message or the help for a command.
 
-       picnit help
-       picnit help install
+       nitpm help
+       nitpm help install
 
 # SEE ALSO
 
index 96ac02e..8d3b867 100644 (file)
@@ -16,7 +16,7 @@
 
 NITCOPT=--semi-global
 OLDNITCOPT=--semi-global
-OBJS=nitc nitpick nit nitls nitunit picnit nitx nitlight nitserial nitrestful
+OBJS=nitc nitpick nit nitls nitunit nitpm nitx nitlight nitserial nitrestful
 SRCS=$(patsubst %,%.nit,$(OBJS))
 BINS=$(patsubst %,../bin/%,$(OBJS))
 MOREOBJS=nitdoc nitweb nitcatalog nitmetrics nitpretty nitweb
index 7edf41a..8bdfcb2 100644 (file)
@@ -39,7 +39,7 @@ module loader
 
 import modelbuilder_base
 import ini
-import picnit_shared
+import nitpm_shared
 
 redef class ToolContext
        # Option --path
@@ -66,9 +66,9 @@ redef class ModelBuilder
                # Setup the paths value
                paths.append(toolcontext.opt_path.value)
 
-               # Packages managed by picnit, only use when not testing with tests.sh
+               # Packages managed by nitpm, only use when not testing with tests.sh
                if "NIT_TESTING_TESTS_SH".environ != "true" then
-                       paths.add picnit_lib_dir
+                       paths.add nitpm_lib_dir
                end
 
                var path_env = "NIT_PATH".environ
similarity index 92%
rename from src/picnit.nit
rename to src/nitpm.nit
index 8875896..526c875 100644 (file)
 # limitations under the License.
 
 # Nit package manager command line interface
-module picnit
+module nitpm
 
 import opts
 import prompt
 import ini
 import curl
 
-import picnit_shared
+import nitpm_shared
 
-# Command line action, passed after `picnit`
+# Command line action, passed after `nitpm`
 abstract class Command
 
        # Short name of the command, specified in the command line
@@ -55,7 +55,7 @@ class CommandInstall
        super Command
 
        redef fun name do return "install"
-       redef fun usage do return "picnit install [package0[=version] [package1 ...]]"
+       redef fun usage do return "nitpm install [package0[=version] [package1 ...]]"
        redef fun description do return "Install packages by name, Git repository address or from the local package.ini"
 
        # Packages installed in this run (identified by the full path)
@@ -108,7 +108,7 @@ class CommandInstall
                        # TODO customizable server list
                        # TODO parse ini file in memory
 
-                       var url = "https://xymus.net/picnit/{package_id}.ini"
+                       var url = "https://xymus.net/nitpm/{package_id}.ini"
                        var ini_path = "/tmp/{package_id}.ini"
 
                        if verbose then print "Looking for a package description at '{url}'"
@@ -161,7 +161,7 @@ class CommandInstall
        do
                check_git
 
-               var target_dir = picnit_lib_dir / name
+               var target_dir = nitpm_lib_dir / name
                if version != null then target_dir += "=" + version
                if installed.has(target_dir) then
                        # Ignore packages installed in this run
@@ -209,7 +209,7 @@ class CommandUpgrade
        super Command
 
        redef fun name do return "upgrade"
-       redef fun usage do return "picnit upgrade <package>"
+       redef fun usage do return "nitpm upgrade <package>"
        redef fun description do return "Upgrade a package"
 
        redef fun apply(args)
@@ -220,7 +220,7 @@ class CommandUpgrade
                end
 
                var name = args.first
-               var target_dir = picnit_lib_dir / name
+               var target_dir = nitpm_lib_dir / name
 
                if not target_dir.file_exists or not target_dir.to_path.is_dir then
                        print_error "Package not found"
@@ -247,7 +247,7 @@ class CommandUninstall
        super Command
 
        redef fun name do return "uninstall"
-       redef fun usage do return "picnit uninstall <package>"
+       redef fun usage do return "nitpm uninstall <package>"
        redef fun description do return "Uninstall a package"
 
        redef fun apply(args)
@@ -258,7 +258,7 @@ class CommandUninstall
                end
 
                var name = args.first
-               var target_dir = picnit_lib_dir / name
+               var target_dir = nitpm_lib_dir / name
 
                if not target_dir.file_exists or not target_dir.to_path.is_dir then
                        print_error "Package not found"
@@ -289,14 +289,14 @@ class CommandList
        super Command
 
        redef fun name do return "list"
-       redef fun usage do return "picnit list"
+       redef fun usage do return "nitpm list"
        redef fun description do return "List installed packages"
 
        redef fun apply(args)
        do
-               var files = picnit_lib_dir.files
+               var files = nitpm_lib_dir.files
                for file in files do
-                       var ini_path = picnit_lib_dir / file / "package.ini"
+                       var ini_path = nitpm_lib_dir / file / "package.ini"
                        if verbose then print "- Reading ini file at {ini_path}"
                        var ini = new ConfigTree(ini_path)
                        var tags = ini["package.tags"]
@@ -315,7 +315,7 @@ class CommandHelp
        super Command
 
        redef fun name do return "help"
-       redef fun usage do return "picnit help [command]"
+       redef fun usage do return "nitpm help [command]"
        redef fun description do return "Show general help message or the help for a command"
 
        redef fun apply(args)
@@ -355,17 +355,17 @@ redef class Sys
        private var command_help = new CommandHelp(commands)
 end
 
-redef fun picnit_lib_dir
+redef fun nitpm_lib_dir
 do
        if "NIT_TESTING".environ == "true" then
-               return "/tmp/picnit-test-" + "NIT_TESTING_ID".environ
+               return "/tmp/nitpm-test-" + "NIT_TESTING_ID".environ
        else return super
 end
 
 # Print the general help message
 private fun print_help
 do
-       print "usage: picnit <command> [options]"
+       print "usage: nitpm <command> [options]"
        print ""
 
        print "commands:"
similarity index 97%
rename from src/picnit_shared.nit
rename to src/nitpm_shared.nit
index bd7f47e..2a93c17 100644 (file)
 # limitations under the License.
 
 # Services related to the Nit package manager
-module picnit_shared
+module nitpm_shared
 
-# Folder where are downloaded picnit packages
-fun picnit_lib_dir: String
+# Folder where are downloaded nitpm packages
+fun nitpm_lib_dir: String
 do
        var dir = "NITPM_PATH".environ
        if not dir.is_empty then return dir