Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions po/pardus-software.pot
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,22 @@ msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"

#: src/MainWindow.py:767
msgid "Invalid file"
msgstr ""

#: src/MainWindow.py:767
msgid "The file does not exist or is not a .deb package."
msgstr ""

#: src/MainWindow.py:774
msgid "Cannot read package"
msgstr ""

#: src/MainWindow.py:774
msgid "This file is not a valid Debian package."
msgstr ""

#: ui/MainWindow.glade:48
msgid "Settings"
msgstr ""
Expand Down
16 changes: 16 additions & 0 deletions po/tr.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,22 @@ msgstr ""
"Plural-Forms: nplurals=1; plural=0;\n"
"X-Generator: Gtranslator 48.0\n"

#: src/MainWindow.py:767
msgid "Invalid file"
msgstr "Geçersiz dosya"

#: src/MainWindow.py:767
msgid "The file does not exist or is not a .deb package."
msgstr "Dosya bulunamadı veya bir .deb paketi değil."

#: src/MainWindow.py:774
msgid "Cannot read package"
msgstr "Paket okunamadı"

#: src/MainWindow.py:774
msgid "This file is not a valid Debian package."
msgstr "Bu dosya geçerli bir Debian paketi değil."

#: ui/MainWindow.glade:48
msgid "Settings"
msgstr "Ayarlar"
Expand Down
3 changes: 2 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def pythonic_version(version):
("/usr/bin", ["pardus-software"]),
("/usr/share/applications",
["tr.org.pardus.software.desktop",
"tr.org.pardus.software-open.desktop"]),
"tr.org.pardus.software-open.desktop",
"tr.org.pardus.software-deb.desktop"]),
("/usr/share/polkit-1/actions",
["tr.org.pardus.pkexec.pardus-software.policy"]),
("/usr/share/pardus/pardus-software/css",
Expand Down
18 changes: 18 additions & 0 deletions src/Actions.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,22 @@ def install(packages):
cmd = ["apt", "install", "-yq", "-o", "APT::Status-Fd=2"] + apt_options + ["--"] + valid_packages
subprocess.call(cmd, env={**os.environ, 'DEBIAN_FRONTEND': 'noninteractive'})

def install_local(debfile):
debfile = os.path.abspath(debfile)

if not os.path.isfile(debfile):
print(f"File not found: {debfile}", file=sys.stderr)
return

if not debfile.endswith(".deb"):
print("Only .deb files can be installed.", file=sys.stderr)
return

# a path (with a slash) makes apt treat it as a local file
cmd = ["apt", "install", "-yq", "-o", "APT::Status-Fd=2",
"-o", "Dpkg::Options::=--force-confnew", "--", debfile]
subprocess.call(cmd, env={**os.environ, 'DEBIAN_FRONTEND': 'noninteractive'})

def remove(packages):
apt_options, valid_packages = parse_packages(packages)

Expand Down Expand Up @@ -156,6 +172,8 @@ def kill(pid):
if control_lock():
if sys.argv[1] == "install":
install(sys.argv[2])
elif sys.argv[1] == "installlocal":
install_local(sys.argv[2])
elif sys.argv[1] == "remove":
remove(sys.argv[2])
elif sys.argv[1] == "upgrade":
Expand Down
9 changes: 9 additions & 0 deletions src/Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,15 @@ def __init__(self, *args, **kwargs):
None,
)

self.add_main_option(
"install-deb",
ord("i"),
GLib.OptionFlags(0),
GLib.OptionArg(1),
"Install a local .deb package",
None,
)

# self.add_main_option(
# "remove",
# ord("r"),
Expand Down
Loading