openSUSE / opi

OBS Package Installer (CLI)
GNU General Public License v3.0
242 stars 22 forks source link

Port to python and add plugin interface #40

Closed asdil12 closed 3 years ago

asdil12 commented 3 years ago

This is essentially a complete rewrite of opi in the python language. It now features a plugin interface that makes it very easy to add support for new proprietary packages. You only need to create a file in opi/plugins/ analog to the existing ones. That's it. It will be used automatically. Also the --help of opi is generated automatically and contains a list of all plugins:

openSUSE Package Installer
==========================

Search and install almost all packages available for openSUSE and SLE:
 1. openSUSE Build Service
 2. Packman
 2. Popular packages for various vendors

Usage: opi <query>

  <query> can be any package name or part of it and will be searched for
  both at the openSUSE Build Service and Packman.

Also this queries can be used to install packages from various other vendors:

  chrome            Google Chrome webbrowser
  codecs            Media Codecs from Packman Repo
  msteams           Microsoft Teams
  plex              Plex Media Server
  skype             Microsoft Skype
  teamviewer        Teamviewer remote access
  vscode            Microsoft Visual Studio Code
  vscodium          Visual Studio Codium
  zoom              ZOOM Video Conference
guoyunhe commented 3 years ago

Overall this is a good move. Some suggestions:

  1. can we name all python files in lowercase?
  2. can we have help formatted like zypper help se?
search (se) [OPTIONS] [QUERYSTRING] ...

Search for packages matching any of the given search strings.

* and ? wildcards can also be used within search strings. If a search string is enclosed in '/',
it's interpreted as a regular expression.

  Command options:

    --match-substrings      Search for a match to partial words (default).
    --match-words           Search for a match to whole words only.
-x, --match-exact           Searches for an exact match of the search strings.
    --provides              Search for packages which provide the search strings.
    --requires              Search for packages which require the search strings.
    --recommends            Search for packages which recommend the search strings.
    --supplements           Search for packages which supplement the search strings.
    --conflicts             Search packages conflicting with search strings.
    --obsoletes             Search for packages which obsolete the search strings.
    --suggests              Search for packages which suggest the search strings.
    --provides-pkg          Search for all packages that provide any of the provides of the
                            package(s) matched by the input parameters.
    --requires-pkg          Search for all packages that require any of the provides of the
                            package(s) matched by the input parameters.
    --recommends-pkg        Search for all packages that recommend any of the provides of the
                            package(s) matched by the input parameters.
    --supplements-pkg       Search for all packages that supplement any of the provides of the
                            package(s) matched by the input parameters.
    --conflicts-pkg         Search for all packages that conflict with any of the package(s) matched
                            by the input parameters.
    --obsoletes-pkg         Search for all packages that obsolete any of the package(s) matched by
                            the input parameters.
    --suggests-pkg          Search for all packages that suggest any of the provides of the
                            package(s) matched by the input parameters.
-t, --type <TYPE>           Search only for packages of the specified type.
-n, --name                  Useful together with dependency options, otherwise searching in package
                            name is default.
-f, --file-list             Search for a match in the file list of packages.
-d, --search-descriptions   Search also in package summaries and descriptions. Default: false
-C, --case-sensitive        Perform case-sensitive search. Default: false
-s, --details               Show each available version in each repository on a separate line.
                            Default: false
-v, --verbose               Like --details, with additional information where the search has matched
                            (useful for search in dependencies). Default: false
-i, --installed-only        Show only installed packages.
-u, --not-installed-only    Show only packages which are not installed.
    --sort-by-name          Sort packages by name (default).
    --sort-by-repo          Sort packages by repository.
-r, --repo <ALIAS|#|URI>    Work only with the specified repository.
asdil12 commented 3 years ago

I renamed the files to lowercase names.

What exactly do you want to have changed within the help text? Should the Usage: opi <query> be moved above the line Search and install almost all packages available for openSUSE and SLE or what do you mean?