Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Last revision Both sides next revision
tutorial:program:oppm [2014/08/18 14:11]
vexatos [Tutorial: The OpenPrograms Package Manager (OPPM)]
tutorial:program:oppm [2021/01/20 17:32]
hawk777 [Using OPPM] Add register and unregister commands
Line 2: Line 2:
 ============================================ ============================================
  
-The OpenPrograms Package Manager, called OPPM, is a program available through a dungeon loot disk in OpenComputers. It provides a large variety of programs, ​henceforth ​called "​packages",​ for you to download and install easily. It is meant to make users able to easily distribute their programs, it is supposed to make installing, updating and uninstalling packages just as easy as creating and registering them.+The OpenPrograms Package Manager, called OPPM, is a program available through a dungeon ​[[item:​loot_disks|loot disk]] in OpenComputers. It provides a large variety of programs, ​from now on called "​packages",​ for you to download and install easily. It is meant to make users able to easily distribute their programs, it is supposed to make installing, updating and uninstalling packages just as easy as creating and registering them.
  
 ##Using OPPM ##Using OPPM
 For OPPM to work, you will need at least a Tier 2 case and an Internet card inserted.  ​ For OPPM to work, you will need at least a Tier 2 case and an Internet card inserted.  ​
-The first thing to do once you have acquired the floppy disk containing OPPM, the first thing you should do after insertsion ​is run `oppm install oppm` to install the latest version of the package manager onto your main hard drive. Once that is done, you can shut down your computer, remove the floppy disk and restart.  ​+Once you have acquired the floppy disk containing OPPM, the first thing you should do after insertion ​is run `oppm install oppm` to install the latest version of the package manager onto your main hard drive. Once that is done, you can shut down your computer, remove the floppy disk and restart.  ​
 OPPM supports a few arguments, which will be explained now: OPPM supports a few arguments, which will be explained now:
  
 - `oppm list [filter] [-i]`  ​ - `oppm list [filter] [-i]`  ​
-This command lists all the available packages ​that you can download, every package has a unique name listed here. The list is sorted by alphabet. The optional argument `filter` will make the list only display the packages which have the specified filter in their name. The option -i makes the command only list packages which have already been installed.+This command lists all the available packages ​by their unique name. The list is sorted by alphabet. The optional argument `filter` will make the list only display the packages which have the specified filter in their name. The option -i makes the command only list packages which have already been installed.
  
 -  `oppm info <​package>​`  ​ -  `oppm info <​package>​`  ​
Line 19: Line 19:
  
 - `oppm update <​package>​`  ​ - `oppm update <​package>​`  ​
-This command uninstalls the specified package and re-downloads it, making sure you have the very-most up-to-date version of the package. ​if `package` is "​all",​ every package that is currently installed will be updated.+This command uninstalls the specified package and re-downloads it, making sure you have the very-most up-to-date version of the package. ​If `package` is "​all",​ every package that is currently installed will be updated.
  
 - `oppm uninstall <​package>​`  ​ - `oppm uninstall <​package>​`  ​
 Removes every file of the specified package from your system. Removes every file of the specified package from your system.
 +
 +- `oppm register <​userorgroup>/<​repository>​`
 +Adds the Github repository found at `https://​github.com/<​userorgroup>/<​repository>​` as an additional source of programs. The repository must have a branch named `master`, and that branch must contain a properly structured file named `programs.cfg` in its root directory.
 +
 +- `oppm unregister <​userorgroup>/<​repository>​`
 +Removes the Github repository found at `https://​github.com/<​userorgroup>/<​repository>​` from the list of additional repositories to search.
  
 ##​Registering packages locally ##​Registering packages locally
 _Note_: If you only want to use packages provided by other people and do not want to make any packages yourself, you can stop reading now. _Note_: If you only want to use packages provided by other people and do not want to make any packages yourself, you can stop reading now.
  
-_Note 2_: General knowledge of using Lua and GitHub is henceforth presupposed.+_Note 2_: General knowledge of using Lua and GitHub is being required.
  
 To register a package yourself, you need to have every file the program needs to run on some repository on [[https://​github.com/​|GitHub]]. To register a package yourself, you need to have every file the program needs to run on some repository on [[https://​github.com/​|GitHub]].
Line 35: Line 41:
     --default installation path     --default installation path
     path="/​usr",​     path="/​usr",​
-    --Additional repositories and packages go here, for correct package syntax, check https://​github.com/​OpenPrograms/​Vexatos-Programs/​blob/​master/​op-manager/etc/opconfig.cfg+    --Additional repositories and packages go here, for correct package syntax, check https://​github.com/​OpenPrograms/​Vexatos-Programs/​blob/​master/​oppm/etc/oppm.cfg
     repos={     repos={
     }     }
Line 41: Line 47:
 ``` ```
  
-You might notice the table called `repos`. That's where you can register your own packages. Package registration follows a rather strict syntax to make sure it will be detected properly. This is an example oppm.cfg file, having added two different packages to oppm (The first one as a [[https://​github.com/​OpenPrograms/​Vexatos-Programs/​blob/​master/​op-manager/​etc/​example-config.cfg|reference]],​ the second one as an actual example):+You might notice the table called `repos`. That's where you can register your own packages. Package registration follows a rather strict syntax to make sure it will be detected properly. This is an example oppm.cfg file, having added two different packages to oppm (The first one as a [[https://​github.com/​OpenPrograms/​Vexatos-Programs/​blob/​master/​oppm/​etc/​example-config.cfg|reference]],​ the second one as an actual example):
  
 ```lua ```lua
Line 47: Line 53:
   --default installation path   --default installation path
   path="/​usr",​   path="/​usr",​
-  --Additional repositories and packages go here, for correct package syntax, check https://​github.com/​OpenPrograms/​Vexatos-Programs/​blob/​master/​op-manager/​etc/​example-config.cfg+  --Additional repositories and packages go here, for correct package syntax, check https://​github.com/​OpenPrograms/​Vexatos-Programs/​blob/​master/​oppm/​etc/​example-config.cfg
   repos={   repos={
     ["​YourUsername/​YourRepo"​] = {     ["​YourUsername/​YourRepo"​] = {
Line 54: Line 60:
           ["​master/​somefolder/​bar.lua"​] = "/",​--"/"​ means the file will be placed inside the folder the user specified, defaults to /usr           ["​master/​somefolder/​bar.lua"​] = "/",​--"/"​ means the file will be placed inside the folder the user specified, defaults to /usr
           ["​master/​somefolder/​barinfo.txt"​] = "//​etc",​ -- double slash for using an absolute path           ["​master/​somefolder/​barinfo.txt"​] = "//​etc",​ -- double slash for using an absolute path
 +          [":​master/​otherfolder"​] = "/​share/​something",​ -- A colon marks a folder, will include everything in that folder
 +          [":​master/​otherfolder"​] = "//​etc/​something",​ -- This also works with absolute paths
           ["​master/​somefolder/​barlib.lua"​] = "/​subfolder",​--Places the file in a subfolder in the user-specified folder           ["​master/​somefolder/​barlib.lua"​] = "/​subfolder",​--Places the file in a subfolder in the user-specified folder
           ["​master/​somefolder/​libfolder/"​] = "/"​           ["​master/​somefolder/​libfolder/"​] = "/"​
         },         },
         dependencies = {         dependencies = {
-          ["some-dependency"] = "/​lib"​--This package is installed into the specified subfolder+          ["GML"] = "/​lib"​--This package is installed into the specified subfolder
         },         },
         name = "​Package name",​--This is for "oppm info"         name = "​Package name",​--This is for "oppm info"
Line 68: Line 76:
       },       },
       ["​yet-another-package"​] = {       ["​yet-another-package"​] = {
-                    --...--+              ​...
       }       }
     },     },
Line 93: Line 101:
 ##​Registering packages globally ##​Registering packages globally
  
-If you want to make your packages globally available (so that everyone that wants to is able to easily install your programs), you need to ask Vexatos on the [[http://​oc.cil.li/​index.php?/​index|OpenComputers forums]] or on IRC to register your GitHub repository. This repo will need to have a file called programs.cfg in the root folder for OPPM to recognize it. That is where all your packages are registered. This is the reference for what is allowed to be in your programs.cfg file (See [[https://​github.com/​OpenPrograms/​Vexatos-Programs/​blob/​master/​op-manager/​example.cfg|example.cfg]]):​+If you want to make your packages globally available (so that everyone that wants to is able to easily install your programs), you need to ask Vexatos on the [[http://​oc.cil.li/​index.php?/​index|OpenComputers forums]] or on IRC to register your GitHub repository. This repo will need to have a file called programs.cfg in the root folder for OPPM to recognize it. That is where all your packages are registered. This is the reference for what is allowed to be in your programs.cfg file (See [[https://​github.com/​OpenPrograms/​Vexatos-Programs/​blob/​master/​oppm/​example.cfg|example.cfg]]):​
  
 ```lua ```lua
Line 101: Line 109:
       ["​master/​somefolder/​bar.lua"​] = "/",​--"/"​ means the file will be placed inside the folder the user specified, defaults to /usr       ["​master/​somefolder/​bar.lua"​] = "/",​--"/"​ means the file will be placed inside the folder the user specified, defaults to /usr
       ["​master/​somefolder/​barinfo.txt"​] = "//​etc",​ -- double slash for using an absolute path       ["​master/​somefolder/​barinfo.txt"​] = "//​etc",​ -- double slash for using an absolute path
 +      [":​master/​otherfolder"​] = "/​share/​something",​ -- A colon marks a folder, will include everything in that folder
 +      [":​master/​otherfolder"​] = "//​etc/​something",​ -- This also works with absolute paths
       ["​master/​somefolder/​barlib.lua"​] = "/​subfolder",​--Places the file in a subfolder in the user-specified folder       ["​master/​somefolder/​barlib.lua"​] = "/​subfolder",​--Places the file in a subfolder in the user-specified folder
-      ["​master/​somefolder/​libfolder/"] = "/"​+      ["?master/​somefolder/​something.cfg"] = "/" ​-- This file will only be installed or updated if it doesn'​t exist already, unless option -f is specified
     },     },
     dependencies = {     dependencies = {
Line 115: Line 125:
   },   },
   ["​yet-another-package"​] = {   ["​yet-another-package"​] = {
-      ​...+          ​...
   }   }
 } }
Line 136: Line 146:
   ["​oppm"​] = {   ["​oppm"​] = {
     files = {     files = {
-      ["​master/​op-manager/​oppm.lua"​] = "/​bin",​ +      ["​master/​oppm/​oppm.lua"​] = "/​bin",​ 
-      ["​master/​op-manager/​etc/​oppm.cfg"​] = "//​etc",​ +      ["​master/​oppm/​etc/​oppm.cfg"​] = "//​etc",​ 
-      ["​master/​op-manager/​lib/​oppm.lua"​] = "/​lib"​+      ["​master/​oppm/​lib/​oppm.lua"​] = "/​lib"​
     },     },
     name = "​OpenPrograms Package Manager",​     name = "​OpenPrograms Package Manager",​
Line 144: Line 154:
     authors = "​Vexatos",​     authors = "​Vexatos",​
     note = "If you are running this program on a floppy disk, run 'oppm install oppm' to install this program locally on your main Hard Drive.\n Consider running 'oppm update oppm' to get the latest version of this program.",​     note = "If you are running this program on a floppy disk, run 'oppm install oppm' to install this program locally on your main Hard Drive.\n Consider running 'oppm update oppm' to get the latest version of this program.",​
-    repo = "​tree/​master/​op-manager"+    repo = "​tree/​master/​oppm"
   },   },
   ["​drama"​] = {   ["​drama"​] = {