Giter Club home page Giter Club logo

opt's Introduction

Opt.py

Opt.py is an installation manager for the /opt directory. The /opt directory is reserved for all the software and add-on packages that are not part of the default installation.

If a program does not provide an installation file for the package manager used (e.g. APT), the program can be installed in /opt. However, this installation can be tedious:

  • Files must be unpacked
  • $PATH variable must be extended
  • Desktop entry must be created
  • When uninstalling the program, all these changes should be undone.

To simplify this, Opt.py provides a simple command line interface modeled after APT.

Supported file formats are: .zip, .tar.bz2, .tar, .tar.gz, .tgz, .tar.xz

Install

  1. Install Python3 as follows in Ubuntu/Debian Linux:
sudo apt install python3.6
  1. Download Opt.py and set execute permissions:
curl -LJO https://raw.githubusercontent.com/byte-cook/opt/main/opt.py
curl -LJO https://raw.githubusercontent.com/byte-cook/opt/main/fileutil.py
chmod +x opt.py
  1. Install Opt.py in the /opt directory:
./opt.py install opt opt.py fileutil.py

The $PATH variable is automatically extended!

  1. (Optional) Install shell auto completion:
curl -LJO https://raw.githubusercontent.com/byte-cook/opt/main/opt-sh-prompt.sh
opt.py autocomplete opt opt-sh-prompt.sh

Uninstall

Use this command:

./opt.py remove opt

Example usage

General structure of the commands:

opt.py <command> <app-name> ...

List installed applications:

opt.py list

Install application:

opt.py install application-12-3 application-12.3.tar.gz

Install another version of the same application:

opt.py install application-19-81 application-19.81.tar.gz

Create alias ("application" refers to "application-12-3"):

opt.py alias application application-12-3

Extend $PATH variable:

opt.py path application /opt/application/application.sh

Add desktop entry:

opt.py desktop application application.desktop application.png

Change alias (application refers to application-19-81):

opt.py alias application application-19-81

Delete old version and all related files:

opt.py remove application-12-3

Delete all versions of this application:

opt.py remove application-19-81
opt.py remove application

Testing

Run all tests:

test_opt.py

Run single test:

test_opt.py TestOpt.test_remove_unmanaged_forced

Clean up test directory:

test_opt.py TestOpt.test_clean

opt's People

Contributors

byte-cook avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.