forked from cromer/pamac-classic
add relative path support to pamac-install
This commit is contained in:
parent
ba85214300
commit
0e8d52c1bb
@ -1,5 +1,6 @@
|
|||||||
./pamac-daemon.py
|
./pamac-daemon.py
|
||||||
./pamac-tray.py
|
./pamac-tray.py
|
||||||
|
./pamac-install.py
|
||||||
./pamac/main.py
|
./pamac/main.py
|
||||||
./pamac/common.py
|
./pamac/common.py
|
||||||
./gui/manager.glade
|
./gui/manager.glade
|
||||||
|
@ -359,8 +359,8 @@ class PamacDBusService(dbus.service.Object):
|
|||||||
pkg = self.handle.load_pkg(tarball_path)
|
pkg = self.handle.load_pkg(tarball_path)
|
||||||
if pkg:
|
if pkg:
|
||||||
self.t.add_pkg(pkg)
|
self.t.add_pkg(pkg)
|
||||||
except pyalpm.error as e:
|
except pyalpm.error:
|
||||||
self.error += ' --> '+str(e)+'\n'
|
self.error += _('{pkgname} is not a valid path or package name').format(pkgname = tarball_path)
|
||||||
finally:
|
finally:
|
||||||
return self.error
|
return self.error
|
||||||
|
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
from gi.repository import GObject
|
from gi.repository import GObject
|
||||||
from sys import argv
|
from sys import argv
|
||||||
import dbus
|
import dbus
|
||||||
|
from os.path import abspath
|
||||||
from pamac import common, transaction, main
|
from pamac import common, transaction, main
|
||||||
|
|
||||||
# i18n
|
# i18n
|
||||||
@ -42,7 +43,9 @@ def get_pkgs(pkgs):
|
|||||||
get_error = ''
|
get_error = ''
|
||||||
for pkg in pkgs:
|
for pkg in pkgs:
|
||||||
if '.pkg.tar.' in pkg:
|
if '.pkg.tar.' in pkg:
|
||||||
transaction.to_load.add(pkg)
|
full_path = abspath(pkg)
|
||||||
|
print('path',full_path)
|
||||||
|
transaction.to_load.add(full_path)
|
||||||
elif pkg in transaction.syncpkgs.keys():
|
elif pkg in transaction.syncpkgs.keys():
|
||||||
transaction.to_add.add(pkg)
|
transaction.to_add.add(pkg)
|
||||||
else:
|
else:
|
||||||
@ -73,6 +76,7 @@ def install(pkgs):
|
|||||||
exiting(_error)
|
exiting(_error)
|
||||||
else:
|
else:
|
||||||
main.set_transaction_sum()
|
main.set_transaction_sum()
|
||||||
|
if len(main.transaction_sum) != 0:
|
||||||
main.ConfDialog.show_all()
|
main.ConfDialog.show_all()
|
||||||
loop.run()
|
loop.run()
|
||||||
else:
|
else:
|
||||||
@ -81,6 +85,12 @@ def install(pkgs):
|
|||||||
if response:
|
if response:
|
||||||
main.WarningDialog.hide()
|
main.WarningDialog.hide()
|
||||||
exiting('')
|
exiting('')
|
||||||
|
else:
|
||||||
|
main.WarningDialog.format_secondary_text(_('Nothing to do'))
|
||||||
|
response = main.WarningDialog.run()
|
||||||
|
if response:
|
||||||
|
main.WarningDialog.hide()
|
||||||
|
exiting('')
|
||||||
|
|
||||||
loop = GObject.MainLoop()
|
loop = GObject.MainLoop()
|
||||||
|
|
||||||
|
@ -545,6 +545,8 @@ def finalize():
|
|||||||
handle_error(str(e))
|
handle_error(str(e))
|
||||||
|
|
||||||
def check_conflicts():
|
def check_conflicts():
|
||||||
|
warning = ''
|
||||||
|
error = ''
|
||||||
print('checking...')
|
print('checking...')
|
||||||
ManagerWindow.get_root_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH))
|
ManagerWindow.get_root_window().set_cursor(Gdk.Cursor(Gdk.CursorType.WATCH))
|
||||||
while Gtk.events_pending():
|
while Gtk.events_pending():
|
||||||
@ -552,13 +554,14 @@ def check_conflicts():
|
|||||||
to_check = [transaction.syncpkgs[name] for name in transaction.to_add | transaction.to_update]
|
to_check = [transaction.syncpkgs[name] for name in transaction.to_add | transaction.to_update]
|
||||||
if transaction.to_load:
|
if transaction.to_load:
|
||||||
for path in transaction.to_load:
|
for path in transaction.to_load:
|
||||||
|
try:
|
||||||
pkg = transaction.handle.load_pkg(path)
|
pkg = transaction.handle.load_pkg(path)
|
||||||
if pkg:
|
if pkg:
|
||||||
to_check.append(pkg)
|
to_check.append(pkg)
|
||||||
|
except pyalpm.error:
|
||||||
|
error += _('{pkgname} is not a valid path or package name').format(pkgname = path)
|
||||||
already_checked = set(pkg.name for pkg in to_check)
|
already_checked = set(pkg.name for pkg in to_check)
|
||||||
depends = [to_check]
|
depends = [to_check]
|
||||||
warning = ''
|
|
||||||
error = ''
|
|
||||||
pkgs = transaction.handle.get_localdb().search('linux3')
|
pkgs = transaction.handle.get_localdb().search('linux3')
|
||||||
installed_linux = []
|
installed_linux = []
|
||||||
# get packages to remove
|
# get packages to remove
|
||||||
|
Loading…
Reference in New Issue
Block a user