Skip to content

Commit

Permalink
Merge pull request #156 from asdil12/oc
Browse files Browse the repository at this point in the history
Add ocenaudio
  • Loading branch information
asdil12 authored Oct 6, 2023
2 parents 8697b2a + a9e8849 commit a5010d0
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 4 deletions.
6 changes: 5 additions & 1 deletion opi/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -280,11 +280,13 @@ def install_packages(packages, **kwargs):
def dist_upgrade(**kwargs):
pkgmgr_action('dup', **kwargs)

def pkgmgr_action(action, packages=[], from_repo=None, allow_vendor_change=False, allow_arch_change=False, allow_downgrade=False, allow_name_change=False):
def pkgmgr_action(action, packages=[], from_repo=None, allow_vendor_change=False, allow_arch_change=False, allow_downgrade=False, allow_name_change=False, allow_unsigned=False):
if get_backend() == BackendConstants.zypp:
args = ['sudo', 'zypper']
if global_state.arg_non_interactive:
args.append('-n')
if allow_unsigned:
args.append('--no-gpg-checks')
args.append(action)
if from_repo:
args.extend(['--from', from_repo])
Expand All @@ -308,6 +310,8 @@ def pkgmgr_action(action, packages=[], from_repo=None, allow_vendor_change=False
# allow_downgrade and allow_name_change are default in DNF
if allow_vendor_change:
args.append('--setopt=allow_vendor_change=True')
if allow_unsigned:
args.append('--nogpgcheck')
args.extend(packages)
subprocess.call(args)

Expand Down
2 changes: 1 addition & 1 deletion opi/plugins/dotnet.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

class MSDotnet(BasePlugin):
main_query = 'dotnet'
description = 'Microsoft .NET'
description = 'Microsoft .NET framework'
queries = ['dotnet-sdk', 'dotnet']

@classmethod
Expand Down
2 changes: 1 addition & 1 deletion opi/plugins/maptool.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def install_github_release(org, repo):
print(f"No RPM asset found for {org}/{repo} release {latest_release['tag_name']}")
return
rpm_url = rpm_assets[0]['browser_download_url']
opi.install_packages([rpm_url])
opi.install_packages([rpm_url], allow_unsigned=True) # no key available

class MapTool(BasePlugin):
main_query = 'maptool'
Expand Down
2 changes: 1 addition & 1 deletion opi/plugins/ms_edge.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

class MSEdge(BasePlugin):
main_query = 'msedge'
description = 'Microsoft Edge'
description = 'Microsoft Edge web browser'
queries = ['microsoft-edge', 'msedge', 'edge']

@classmethod
Expand Down
14 changes: 14 additions & 0 deletions opi/plugins/ocenaudio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import opi
from opi.plugins import BasePlugin

class Ocenaudio(BasePlugin):
main_query = 'ocenaudio'
description = 'Audio Editor'
queries = [main_query]

@classmethod
def run(cls, query):
if not opi.ask_yes_or_no('Do you want to install ocenaudio from ocenaudio.com?'):
return

opi.install_packages(['https://www.ocenaudio.com/downloads/index.php/ocenaudio_opensuse.rpm'], allow_unsigned=True) # rpm is unsigned

0 comments on commit a5010d0

Please sign in to comment.