Browse Source

v4.9.0

pull/15/head
guinux 5 years ago
parent
commit
d661c573f9
  1. 3
      .gitignore
  2. 26
      Makefile
  3. 5
      data/dbus/org.manjaro.pamac.service
  4. 14
      data/dbus/org.manjaro.pamac.system.conf
  5. 5
      data/dbus/org.manjaro.pamac.system.service
  6. 3
      data/dbus/org.manjaro.pamac.user.service
  7. 12
      data/networkmanager/99_update_pamac_tray
  8. 7
      data/systemd/pamac-system.service
  9. 7
      data/systemd/pamac.service
  10. 6
      po/files_to_translate
  11. 137
      po/pamac.pot
  12. 9
      resources/Makefile
  13. 58
      resources/manager_window.ui
  14. BIN
      resources/package-upgrade.png
  15. 2
      resources/pamac.manager.gresource.xml
  16. 1
      resources/pamac.transaction.gresource.xml
  17. 6
      resources/pamac.updater.gresource.xml
  18. 455
      resources/updater_window.ui
  19. 53
      src/Makefile
  20. 25
      src/alpm_config.vala
  21. 4
      src/common.vala
  22. 2
      src/history_dialog.vala
  23. 12
      src/installer.vala
  24. 26
      src/manager.vala
  25. 443
      src/manager_window.vala
  26. 23
      src/mirrors_config.vala
  27. 3
      src/package.vala
  28. 4
      src/preferences_dialog.vala
  29. 100
      src/refresh.vala
  30. 1114
      src/system_daemon.vala
  31. 388
      src/transaction.vala
  32. 90
      src/tray.vala
  33. 105
      src/updater.vala
  34. 384
      src/updater_window.vala
  35. 967
      src/user_daemon.vala
  36. 1
      vapi/libalpm.vapi

3
.gitignore vendored

@ -5,7 +5,8 @@ src/*.c
src/pamac.h
src/pamac.vapi
src/libpamac.so
src/pamac-daemon
src/pamac-user-daemon
src/pamac-system-daemon
src/pamac-tray
src/pamac-tray-appindicator
src/pamac-manager

26
Makefile

@ -28,20 +28,21 @@ install: install_pamac-tray-appindicator
install -Dm644 src/pamac.h $(includedir)/pamac.h
install -Dm644 src/pamac.vapi $(datadir)/vala/vapi/pamac.vapi
install -Dm755 src/libpamac.so $(libdir)/libpamac.so
install -Dm744 src/pamac-daemon $(bindir)/pamac-daemon
install -Dm755 src/pamac-user-daemon $(bindir)/pamac-user-daemon
install -Dm744 src/pamac-system-daemon $(bindir)/pamac-system-daemon
install -Dm755 src/pamac-tray $(bindir)/pamac-tray
install -Dm755 src/pamac-manager $(bindir)/pamac-manager
install -Dm755 src/pamac-updater $(bindir)/pamac-updater
ln -srf $(bindir)/pamac-manager $(bindir)/pamac-updater
install -Dm755 src/pamac-install $(bindir)/pamac-install
install -Dm755 src/pamac-refresh $(bindir)/pamac-refresh
install -Dm644 data/applications/pamac-tray.desktop $(sysconfdir)/xdg/autostart/pamac-tray.desktop
install -Dm644 data/applications/pamac-manager.desktop $(datadir)/applications/pamac-manager.desktop
install -Dm644 data/applications/pamac-updater.desktop $(datadir)/applications/pamac-updater.desktop
install -Dm644 data/applications/pamac-install.desktop $(datadir)/applications/pamac-install.desktop
install -Dm644 data/config/pamac.conf $(sysconfdir)/pamac.conf
install -Dm644 data/dbus/org.manjaro.pamac.conf $(sysconfdir)/dbus-1/system.d/org.manjaro.pamac.conf
install -Dm644 data/dbus/org.manjaro.pamac.service $(datadir)/dbus-1/system-services/org.manjaro.pamac.service
install -Dm644 data/systemd/pamac.service $(libdir)/systemd/system/pamac.service
install -Dm644 data/dbus/org.manjaro.pamac.system.conf $(sysconfdir)/dbus-1/system.d/org.manjaro.pamac.system.conf
install -Dm644 data/dbus/org.manjaro.pamac.user.service $(datadir)/dbus-1/services/org.manjaro.pamac.user.service
install -Dm644 data/dbus/org.manjaro.pamac.system.service $(datadir)/dbus-1/system-services/org.manjaro.pamac.system.service
install -Dm644 data/systemd/pamac-system.service $(libdir)/systemd/system/pamac-system.service
install -Dm644 data/systemd/pamac-cleancache.service $(libdir)/systemd/system/pamac-cleancache.service
install -Dm644 data/systemd/pamac-cleancache.timer $(libdir)/systemd/system/pamac-cleancache.timer
install -Dm644 data/systemd/pamac-mirrorlist.service $(libdir)/systemd/system/pamac-mirrorlist.service
@ -49,7 +50,6 @@ install: install_pamac-tray-appindicator
mkdir -p $(libdir)/systemd/system/multi-user.target.wants
ln -srf $(libdir)/systemd/system/pamac-cleancache.timer $(libdir)/systemd/system/multi-user.target.wants
ln -srf $(libdir)/systemd/system/pamac-mirrorlist.timer $(libdir)/systemd/system/multi-user.target.wants
install -Dm744 data/networkmanager/99_update_pamac_tray $(sysconfdir)/NetworkManager/dispatcher.d/99_update_pamac_tray
install -Dm644 data/polkit/org.manjaro.pamac.policy $(datadir)/polkit-1/actions/org.manjaro.pamac.policy
install -Dm644 data/mime/x-alpm-package.xml $(datadir)/mime/packages/x-alpm-package.xml
@ -66,27 +66,27 @@ uninstall:
rm -f $(includedir)/pamac.h
rm -f $(datadir)/vala/vapi/pamac.vapi
rm -f $(libdir)/libpamac.so
rm -f $(bindir)/pamac-daemon
rm -f $(bindir)/pamac-user-daemon
rm -f $(bindir)/pamac-system-daemon
rm -f $(bindir)/pamac-tray
rm -f $(bindir)/pamac-tray-appindicator
rm -f $(bindir)/pamac-manager
rm -f $(bindir)/pamac-updater
rm -f $(bindir)/pamac-install
rm -f $(bindir)/pamac-refresh
rm -f $(sysconfdir)/xdg/autostart/pamac-tray.desktop
rm -f $(sysconfdir)/xdg/autostart/pamac-tray-appindicator.desktop
rm -f $(datadir)/applications/pamac-manager.desktop
rm -f $(datadir)/applications/pamac-updater.desktop
rm -f $(datadir)/applications/pamac-install.desktop
rm -f $(sysconfdir)/pamac.conf
rm -f $(sysconfdir)/dbus-1/system.d/org.manjaro.pamac.conf
rm -f $(datadir)/dbus-1/system-services/org.manjaro.pamac.service
rm -f $(libdir)/systemd/system/pamac.service
rm -f $(sysconfdir)/dbus-1/system.d/org.manjaro.pamac.system.conf
rm -f $(datadir)/dbus-1/services/org.manjaro.pamac.user.service
rm -f $(datadir)/dbus-1/system-services/org.manjaro.pamac.system.service
rm -f $(libdir)/systemd/system/pamac-system.service
rm -f $(libdir)/systemd/system/pamac-cleancache.service
rm -f $(libdir)/systemd/system/pamac-cleancache.timer
rm -f $(libdir)/systemd/system/pamac-mirrorlist.service
rm -f $(libdir)/systemd/system/pamac-mirrorlist.timer
rm -f $(libdir)/systemd/system/multi-user.target.wants/pamac-cleancache.timer
rm -f $(sysconfdir)/NetworkManager/dispatcher.d/99_update_pamac_tray
rm -f $(datadir)/polkit-1/actions/org.manjaro.pamac.policy
rm -f $(datadir)/mime/packages/x-alpm-package.xml

5
data/dbus/org.manjaro.pamac.service

@ -1,5 +0,0 @@
[D-BUS Service]
Name=org.manjaro.pamac
Exec=/usr/bin/pamac-daemon
User=root
SystemdService=pamac.service

14
data/dbus/org.manjaro.pamac.conf → data/dbus/org.manjaro.pamac.system.conf

@ -4,19 +4,19 @@
<busconfig>
<!-- Only root can own the service -->
<policy user="root">
<allow own="org.manjaro.pamac"/>
<allow own="org.manjaro.pamac.system"/>
</policy>
<!-- Allow anyone to invoke methods on the interfaces -->
<policy context="default">
<allow send_destination="org.manjaro.pamac"
send_interface="org.manjaro.pamac"/>
<allow send_destination="org.manjaro.pamac.system"
send_interface="org.manjaro.pamac.system"/>
<allow send_destination="org.manjaro.pamac"
send_interface="org.freedesktop.DBus.Introspectable"/>
<allow send_destination="org.manjaro.pamac"
<allow send_destination="org.manjaro.pamac.system"
send_interface="org.freedesktop.DBus_Introspectable"/>
<allow send_destination="org.manjaro.pamac.system"
send_interface="org.freedesktop.DBus.Peer"/>
<allow send_destination="org.manjaro.pamac"
<allow send_destination="org.manjaro.pamac.system"
send_interface="org.freedesktop.DBus.Properties"/>
</policy>
</busconfig>

5
data/dbus/org.manjaro.pamac.system.service

@ -0,0 +1,5 @@
[D-BUS Service]
Name=org.manjaro.pamac.system
Exec=/usr/bin/pamac-system-daemon
User=root
SystemdService=pamac-system.service

3
data/dbus/org.manjaro.pamac.user.service

@ -0,0 +1,3 @@
[D-BUS Service]
Name=org.manjaro.pamac.user
Exec=/usr/bin/pamac-user-daemon

12
data/networkmanager/99_update_pamac_tray

@ -1,12 +0,0 @@
#!/bin/sh
INTERFACE=$1 # The interface which is brought up or down
STATUS=$2 # The new state of the interface
case "$STATUS" in
'up') # $INTERFACE is up
[[ -e /usr/bin/mhwd-live ]] && sleep 30
/usr/bin/pamac-refresh
;;
esac

7
data/systemd/pamac-system.service

@ -0,0 +1,7 @@
[Unit]
Description=Pamac System Session
[Service]
Type=dbus
BusName=org.manjaro.pamac.system
ExecStart=/usr/bin/pamac-system-daemon

7
data/systemd/pamac.service

@ -1,7 +0,0 @@
[Unit]
Description=Pamac
[Service]
Type=dbus
BusName=org.manjaro.pamac
ExecStart=/usr/bin/pamac-daemon

6
po/files_to_translate

@ -1,11 +1,10 @@
../src/daemon.vala
../src/user_daemon.vala
../src/system_daemon.vala
../src/transaction.vala
../src/installer.vala
../src/tray.vala
../src/manager.vala
../src/updater.vala
../src/manager_window.vala
../src/updater_window.vala
../src/preferences_dialog.vala
../src/choose_ignorepkgs_dialog.vala
@ -14,6 +13,5 @@
../resources/history_dialog.ui
../resources/transaction_sum_dialog.ui
../resources/manager_window.ui
../resources/updater_window.ui
../resources/preferences_dialog.ui
../resources/choose_ignorepkgs_dialog.ui

137
po/pamac.pot

@ -21,114 +21,110 @@ msgstr ""
msgid "Authentication is required"
msgstr ""
#: ../src/daemon.vala
msgid "Failed to initialize alpm library"
#: ../src/user_daemon.vala
msgid "Unknown"
msgstr ""
#: ../src/daemon.vala ../src/transaction.vala
msgid "Authentication failed"
#: ../src/user_daemon.vala ../src/manager_window.vala
msgid "Explicitly installed"
msgstr ""
#: ../src/daemon.vala
msgid "Failed to synchronize any databases"
#: ../src/user_daemon.vala ../src/manager_window.vala
msgid "Installed as a dependency for another package"
msgstr ""
#: ../src/daemon.vala
msgid "Unknown"
#: ../src/user_daemon.vala
msgid "Yes"
msgstr ""
#: ../src/daemon.vala
msgid "Explicitly installed"
#: ../src/user_daemon.vala
msgid "No"
msgstr ""
#: ../src/daemon.vala ../src/manager_window.vala
msgid "Installed as a dependency for another package"
#: ../src/system_daemon.vala
msgid "Failed to initialize alpm library"
msgstr ""
#: ../src/daemon.vala
msgid "Yes"
#: ../src/system_daemon.vala ../src/transaction.vala
msgid "Authentication failed"
msgstr ""
#: ../src/daemon.vala
msgid "No"
#: ../src/system_daemon.vala
msgid "Failed to synchronize any databases"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
msgid "Failed to init transaction"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
msgid "Failed to prepare transaction"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
#, c-format
msgid "target not found: %s"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
#, c-format
msgid "package %s does not have a valid architecture"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
#, c-format
msgid "%s: requires %s"
msgid "unable to satisfy dependency '%s' required by %s"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
#, c-format
msgid "%s: installing %s (%s) breaks dependency '%s'"
msgid "installing %s (%s) breaks dependency '%s' required by %s"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
#, c-format
msgid "%s: removing %s breaks dependency '%s'"
msgid "removing %s breaks dependency '%s' required by %s"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
#, c-format
msgid "%s and %s are in conflict"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
#, c-format
msgid "%s needs to be removed but it is a locked package"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
msgid "Failed to commit transaction"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
#, c-format
msgid "%s exists in both %s and %s"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
#, c-format
msgid "%s: %s already exists in filesystem"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
#, c-format
msgid "%s is invalid or corrupted"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
#, c-format
msgid "%s appears to be truncated: %jd/%jd bytes\n"
msgstr ""
#: ../src/daemon.vala
#: ../src/system_daemon.vala
#, c-format
msgid "failed retrieving file '%s' from %s : %s\n"
msgstr ""
#: ../src/transaction.vala
msgid "A Gtk3 frontend for libalpm"
msgstr ""
#: ../src/transaction.vala
msgid "Copy"
msgstr ""
@ -174,11 +170,7 @@ msgstr ""
msgid "To reinstall"
msgstr ""
#: ../src/transaction.vala
msgid "To update"
msgstr ""
#: ../src/transaction.vala ../src/updater_window.vala
#: ../src/transaction.vala ../src/manager_window.vala
msgid "Total download size"
msgstr ""
@ -191,10 +183,6 @@ msgstr ""
msgid "Transaction cancelled"
msgstr ""
#: ../src/transaction.vala
msgid "Waiting for another package manager to quit"
msgstr ""
#: ../src/transaction.vala
msgid "Checking dependencies"
msgstr ""
@ -345,6 +333,7 @@ msgid "Warning"
msgstr ""
#: ../src/transaction.vala ../resources/progress_dialog.ui
#: ../resources/history_dialog.ui
msgid "_Close"
msgstr ""
@ -356,18 +345,14 @@ msgstr ""
msgid "Transaction successfully finished"
msgstr ""
#: ../src/installer.vala ../src/manager.vala ../src/updater.vala
#: ../src/installer.vala ../src/manager.vala
msgid "Pamac is already running"
msgstr ""
#: ../src/tray.vala ../src/updater_window.vala
#: ../src/tray.vala ../src/manager_window.vala
msgid "Your system is up-to-date"
msgstr ""
#: ../src/tray.vala ../src/updater_window.vala
msgid "Update Manager"
msgstr ""
#: ../src/tray.vala ../src/manager_window.vala
msgid "Package Manager"
msgstr ""
@ -376,7 +361,7 @@ msgstr ""
msgid "_Quit"
msgstr ""
#: ../src/tray.vala ../src/updater_window.vala
#: ../src/tray.vala
#, c-format
msgid "%u available update"
msgid_plural "%u available updates"
@ -384,7 +369,7 @@ msgstr[0] ""
msgstr[1] ""
#: ../src/tray.vala ../src/manager_window.vala ../resources/progress_dialog.ui
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/manager_window.ui
msgid "Details"
msgstr ""
@ -392,6 +377,10 @@ msgstr ""
msgid "Deselect"
msgstr ""
#: ../src/manager_window.vala
msgid "Upgrade"
msgstr ""
#: ../src/manager_window.vala ../resources/manager_window.ui
msgid "Install"
msgstr ""
@ -400,6 +389,10 @@ msgstr ""
msgid "Remove"
msgstr ""
#: ../src/manager_window.vala
msgid "Waiting for another package manager to quit"
msgstr ""
#: ../src/manager_window.vala
#, c-format
msgid "%u pending operation"
@ -436,7 +429,6 @@ msgid "Licenses"
msgstr ""
#: ../src/manager_window.vala ../resources/manager_window.ui
#: ../resources/updater_window.ui
msgid "Repository"
msgstr ""
@ -525,7 +517,6 @@ msgid "Check Dependencies"
msgstr ""
#: ../src/manager_window.vala ../resources/manager_window.ui
#: ../resources/updater_window.ui
msgid "Name"
msgstr ""
@ -534,8 +525,7 @@ msgid "Install Local Packages"
msgstr ""
#: ../src/manager_window.vala ../resources/transaction_sum_dialog.ui
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/choose_ignorepkgs_dialog.ui
#: ../resources/manager_window.ui ../resources/choose_ignorepkgs_dialog.ui
msgid "_Cancel"
msgstr ""
@ -547,6 +537,10 @@ msgstr ""
msgid "Alpm Package"
msgstr ""
#: ../src/manager_window.vala
msgid "A Gtk3 frontend for libalpm"
msgstr ""
#: ../src/preferences_dialog.vala ../resources/preferences_dialog.ui
msgid "How often to check for updates, value in hours"
msgstr ""
@ -592,19 +586,19 @@ msgstr ""
msgid "Commit"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/manager_window.ui
msgid "Refresh databases"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/manager_window.ui
msgid "View History"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/manager_window.ui
msgid "Preferences"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/manager_window.ui
msgid "About"
msgstr ""
@ -612,19 +606,23 @@ msgstr ""
msgid "Search"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/manager_window.ui
msgid "State"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/manager_window.ui
msgid "Repositories"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/manager_window.ui
msgid "Updates"
msgstr ""
#: ../resources/manager_window.ui
msgid "Version"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/manager_window.ui
msgid "Size"
msgstr ""
@ -632,8 +630,7 @@ msgstr ""
msgid "Popularity"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/preferences_dialog.ui
#: ../resources/manager_window.ui ../resources/preferences_dialog.ui
msgid "AUR"
msgstr ""
@ -653,7 +650,7 @@ msgstr ""
msgid "Files"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/manager_window.ui
msgid "_Apply"
msgstr ""

9
resources/Makefile

@ -9,8 +9,6 @@ MANAGER_RESOURCES_FILES = manager_window.ui \
package-reinstall.png \
package-remove.png
UPDATER_RESOURCES_FILES = updater_window.ui
INSTALLER_RESOURCES_FILES = progress_dialog.ui
TRANSACTION_RESOURCES_FILES = progress_box.ui \
@ -23,11 +21,9 @@ TRANSACTION_GRESOURCE_FILE = pamac.transaction.gresource.xml
MANAGER_GRESOURCE_FILE = pamac.manager.gresource.xml
UPDATER_GRESOURCE_FILE = pamac.updater.gresource.xml
INSTALLER_GRESOURCE_FILE = pamac.installer.gresource.xml
resources: transaction_resources.c manager_resources.c updater_resources.c installer_resources.c
resources: transaction_resources.c manager_resources.c installer_resources.c
clean:
rm -f *.c
@ -38,8 +34,5 @@ transaction_resources.c: $(TRANSACTION_GRESOURCE_FILE) $(TRANSACTION_RESOURCES_F
manager_resources.c: $(MANAGER_GRESOURCE_FILE) $(MANAGER_RESOURCES_FILES)
glib-compile-resources $(MANAGER_GRESOURCE_FILE) --target=manager_resources.c --generate-source
updater_resources.c: $(UPDATER_GRESOURCE_FILE) $(UPDATER_RESOURCES_FILES)
glib-compile-resources $(UPDATER_GRESOURCE_FILE) --target=updater_resources.c --generate-source
installer_resources.c: $(INSTALLER_GRESOURCE_FILE) $(INSTALLER_RESOURCES_FILES)
glib-compile-resources $(INSTALLER_GRESOURCE_FILE) --target=installer_resources.c --generate-source

58
resources/manager_window.ui

@ -294,6 +294,21 @@
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkBox" id="box6">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<child>
<placeholder/>
</child>
</object>
<packing>
<property name="name">updates</property>
<property name="title" translatable="yes">Updates</property>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
@ -311,6 +326,7 @@
<object class="GtkStackSwitcher" id="packages_stackswitcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="stack">packages_stack</property>
</object>
<packing>
@ -394,7 +410,7 @@
<child>
<object class="GtkCellRendererText" id="packages_version_renderertext"/>
<attributes>
<attribute name="text">3</attribute>
<attribute name="markup">3</attribute>
</attributes>
</child>
</object>
@ -512,7 +528,7 @@
<child>
<object class="GtkCellRendererText" id="aur_version_renderertext"/>
<attributes>
<attribute name="text">3</attribute>
<attribute name="markup">3</attribute>
</attributes>
</child>
</object>
@ -543,6 +559,44 @@
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="updated_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="orientation">vertical</property>
<property name="homogeneous">True</property>
<child>
<object class="GtkImage" id="updated_icon">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">end</property>
<property name="icon_name">object-select-symbolic</property>
<property name="icon_size">6</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkLabel" id="updated_label">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">start</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="name">updated</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>

BIN
resources/package-upgrade.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 501 B

2
resources/pamac.manager.gresource.xml

@ -2,6 +2,7 @@
<gresources>
<gresource prefix="/org/manjaro/pamac/manager">
<file preprocess="xml-stripblanks">manager_window.ui</file>
<file preprocess="xml-stripblanks">history_dialog.ui</file>
<file preprocess="to-pixdata">package-available.png</file>
<file preprocess="to-pixdata">package-available-locked.png</file>
<file preprocess="to-pixdata">package-install.png</file>
@ -9,5 +10,6 @@
<file preprocess="to-pixdata">package-installed-updated.png</file>
<file preprocess="to-pixdata">package-reinstall.png</file>
<file preprocess="to-pixdata">package-remove.png</file>
<file preprocess="to-pixdata">package-upgrade.png</file>
</gresource>
</gresources>

1
resources/pamac.transaction.gresource.xml

@ -3,7 +3,6 @@
<gresource prefix="/org/manjaro/pamac/transaction">
<file preprocess="xml-stripblanks">progress_dialog.ui</file>
<file preprocess="xml-stripblanks">progress_box.ui</file>
<file preprocess="xml-stripblanks">history_dialog.ui</file>
<file preprocess="xml-stripblanks">choose_provider_dialog.ui</file>
<file preprocess="xml-stripblanks">transaction_sum_dialog.ui</file>
</gresource>

6
resources/pamac.updater.gresource.xml

@ -1,6 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<gresources>
<gresource prefix="/org/manjaro/pamac/updater">
<file preprocess="xml-stripblanks">updater_window.ui</file>
</gresource>
</gresources>

455
resources/updater_window.ui

@ -1,455 +0,0 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface>
<requires lib="gtk+" version="3.16"/>
<object class="GtkPopoverMenu" id="popovermenu">
<property name="can_focus">False</property>
<child>
<object class="GtkBox" id="menu_box">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkModelButton" id="refresh_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">Refresh databases</property>
<signal name="clicked" handler="on_refresh_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkModelButton" id="history_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">View History</property>
<signal name="clicked" handler="on_history_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkModelButton" id="preferences_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">Preferences</property>
<signal name="clicked" handler="on_preferences_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">3</property>
</packing>
</child>
<child>
<object class="GtkModelButton" id="about_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="text" translatable="yes">About</property>
<signal name="clicked" handler="on_about_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">4</property>
</packing>
</child>
</object>
<packing>
<property name="submenu">main</property>
<property name="position">1</property>
</packing>
</child>
</object>
<template class="PamacUpdaterWindow" parent="GtkApplicationWindow">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="default_height">500</property>
<property name="icon_name">system-software-update</property>
<property name="gravity">center</property>
<property name="show_menubar">False</property>
<child>
<object class="GtkBox" id="box1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<property name="orientation">vertical</property>
<property name="spacing">6</property>
<child>
<object class="GtkStackSwitcher" id="stackswitcher">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="halign">center</property>
<property name="margin_top">6</property>
<property name="stack">stack</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child>
<object class="GtkScrolledWindow" id="repos_scrolledwindow">
<property name="width_request">750</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkTreeView" id="repos_updates_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="search_column">1</property>
<property name="fixed_height_mode">True</property>
<property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection">
<property name="mode">none</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn3">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed_width">50</property>
<property name="min_width">20</property>
<property name="title" translatable="yes">State</property>
<property name="clickable">True</property>
<property name="sort_column_id">0</property>
<child>
<object class="GtkCellRendererToggle" id="repos_select_update">
<signal name="toggled" handler="on_repos_select_update_toggled" swapped="no"/>
</object>
<attributes>
<attribute name="active">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed_width">200</property>
<property name="min_width">20</property>
<property name="title" translatable="yes">Name</property>
<property name="expand">True</property>
<property name="clickable">True</property>
<property name="sort_column_id">1</property>
<child>
<object class="GtkCellRendererText" id="repos_update_name"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn6">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed_width">250</property>
<property name="min_width">20</property>
<property name="title" translatable="yes">Version</property>
<property name="clickable">True</property>
<property name="sort_column_id">2</property>
<child>
<object class="GtkCellRendererText" id="repos_update_new_version"/>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
<child>
<object class="GtkCellRendererText" id="repos_update_old_version"/>
<attributes>
<attribute name="text">3</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn10">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed_width">90</property>
<property name="min_width">20</property>
<property name="title" translatable="yes">Repository</property>
<property name="clickable">True</property>
<property name="sort_column_id">4</property>
<child>
<object class="GtkCellRendererText" id="repos_update_repo"/>
<attributes>
<attribute name="text">4</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn2">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed_width">90</property>
<property name="min_width">20</property>
<property name="title" translatable="yes">Size</property>
<property name="clickable">True</property>
<property name="sort_column_id">6</property>
<child>
<object class="GtkCellRendererText" id="repos_update_size"/>
<attributes>
<attribute name="text">5</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="name">repos</property>
<property name="title" translatable="yes">Repositories</property>
</packing>
</child>
<child>
<object class="GtkScrolledWindow" id="aur_scrolledwindow">
<property name="width_request">750</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<child>
<object class="GtkTreeView" id="aur_updates_treeview">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="vexpand">True</property>
<property name="search_column">1</property>
<property name="fixed_height_mode">True</property>
<property name="show_expanders">False</property>
<child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection2">
<property name="mode">none</property>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn4">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed_width">40</property>
<property name="min_width">20</property>
<property name="title" translatable="yes">State</property>
<property name="clickable">True</property>
<property name="sort_column_id">0</property>
<child>
<object class="GtkCellRendererToggle" id="aur_select_update">
<signal name="toggled" handler="on_aur_select_update_toggled" swapped="no"/>
</object>
<attributes>
<attribute name="active">0</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn5">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed_width">200</property>
<property name="min_width">20</property>
<property name="title" translatable="yes">Name</property>
<property name="expand">True</property>
<property name="clickable">True</property>
<property name="sort_column_id">1</property>
<child>
<object class="GtkCellRendererText" id="aur_update_name"/>
<attributes>
<attribute name="text">1</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn8">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed_width">250</property>
<property name="min_width">20</property>
<property name="title" translatable="yes">Version</property>
<property name="clickable">True</property>
<property name="sort_column_id">2</property>
<child>
<object class="GtkCellRendererText" id="aur_update_new_version"/>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
<child>
<object class="GtkCellRendererText" id="aur_update_old_version"/>
<attributes>
<attribute name="text">3</attribute>
</attributes>
</child>
</object>
</child>
</object>
</child>
</object>
<packing>
<property name="name">aur</property>
<property name="title" translatable="yes">AUR</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkBox" id="transaction_infobox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="border_width">6</property>
<property name="spacing">12</property>
<child>
<placeholder/>
</child>
<child>
<object class="GtkButtonBox" id="transaction_infos_buttonbox">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="valign">end</property>
<property name="spacing">6</property>
<property name="layout_style">start</property>
<child>
<object class="GtkButton" id="details_button">
<property name="label" translatable="yes">Details</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<signal name="clicked" handler="on_details_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">0</property>
</packing>
</child>
<child>
<object class="GtkButton" id="apply_button">
<property name="label" translatable="yes">_Apply</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="has_focus">True</property>
<property name="can_default">True</property>
<property name="has_default">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_apply_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkButton" id="cancel_button">
<property name="label" translatable="yes">_Cancel</property>
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">True</property>
<property name="use_underline">True</property>
<signal name="clicked" handler="on_cancel_button_clicked" swapped="no"/>
</object>
<packing>
<property name="expand">True</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">2</property>
</packing>
</child>
</object>
</child>
<child type="titlebar">
<object class="GtkHeaderBar" id="headerbar">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="show_close_button">True</property>
<child>
<object class="GtkButton" id="button_back">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="halign">start</property>
<signal name="clicked" handler="on_button_back_clicked" swapped="no"/>
<child>
<object class="GtkImage" id="back_image">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">go-previous-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
</child>
<child>
<object class="GtkMenuButton" id="menu_button">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="popover">popovermenu</property>
<signal name="toggled" handler="on_menu_button_toggled" swapped="no"/>
<child>
<object class="GtkImage" id="menu_icon">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="icon_name">open-menu-symbolic</property>
<property name="icon_size">1</property>
</object>
</child>
<style>
<class name="image-button"/>
</style>
</object>
<packing>
<property name="pack_type">end</property>
<property name="position">1</property>
</packing>
</child>
</object>
</child>
</template>
</interface>

53
src/Makefile

@ -21,11 +21,10 @@ PAMAC_LIB_FLAGS = -X -I. \
--pkg=pamac \
COMMON_SOURCES = common.vala \
package.vala \
pamac_config.vala
TRANSACTION_SOURCES = package.vala \
transaction.vala \
history_dialog.vala \
TRANSACTION_SOURCES = transaction.vala \
choose_provider_dialog.vala \
transaction_sum_dialog.vala \
progress_box.vala
@ -38,22 +37,12 @@ TRANSACTION_GRESOURCE_FILE = ../resources/pamac.transaction.gresource.xml
MANAGER_GRESOURCE_FILE = ../resources/pamac.manager.gresource.xml
UPDATER_GRESOURCE_FILE = ../resources/pamac.updater.gresource.xml
INSTALLER_GRESOURCE_FILE = ../resources/pamac.installer.gresource.xml
binaries: pamac-refresh pamac-daemon pamac-tray pamac-updater pamac-manager pamac-install
binaries: pamac-user-daemon pamac-system-daemon pamac-tray pamac-manager pamac-install
clean:
rm -f *.c pamac.h pamac.vapi libpamac.so pamac-refresh pamac-daemon pamac-tray pamac-tray-appindicator pamac-updater pamac-manager pamac-install
pamac-refresh: pamac_config.vala refresh.vala
valac -o pamac-refresh \
-X -w \
--pkg=gio-2.0 \
--pkg=posix \
pamac_config.vala \
refresh.vala
rm -f *.c pamac.h pamac.vapi libpamac.so pamac-user-daemon pamac-system-daemon pamac-tray pamac-tray-appindicator pamac-manager pamac-install
pamac-tray: $(COMMON_SOURCES) alpm_config.vala tray.vala tray-gtk.vala
valac -o pamac-tray \
@ -74,8 +63,21 @@ pamac-tray-appindicator: $(COMMON_SOURCES) alpm_config.vala tray.vala tray-appin
tray-appindicator.vala \
tray.vala
pamac-daemon: ../vapi/libalpm.vapi ../vapi/polkit-gobject-1.vapi ../vapi/libcurl.vapi alpm_config.vala $(COMMON_SOURCES) package.vala aur.vala mirrors_config.vala daemon.vala
valac -o pamac-daemon \
pamac-user-daemon: ../vapi/libalpm.vapi alpm_config.vala common.vala package.vala aur.vala user_daemon.vala
valac -o pamac-user-daemon \
$(COMMON_VALA_FLAGS) \
$(ALPM_VALA_FLAGS) \
--pkg=json-glib-1.0 \
--pkg=libsoup-2.4 \
--thread \
alpm_config.vala \
common.vala \
package.vala \
aur.vala \
user_daemon.vala
pamac-system-daemon: ../vapi/libalpm.vapi ../vapi/polkit-gobject-1.vapi ../vapi/libcurl.vapi alpm_config.vala $(COMMON_SOURCES) aur.vala mirrors_config.vala system_daemon.vala
valac -o pamac-system-daemon \
$(COMMON_VALA_FLAGS) \
$(ALPM_VALA_FLAGS) \
--pkg=polkit-gobject-1 \
@ -85,10 +87,9 @@ pamac-daemon: ../vapi/libalpm.vapi ../vapi/polkit-gobject-1.vapi ../vapi/libcurl
--thread \
alpm_config.vala \
$(COMMON_SOURCES) \
package.vala \
aur.vala \
mirrors_config.vala \
daemon.vala
system_daemon.vala
libpamac.so: $(COMMON_SOURCES) $(TRANSACTION_SOURCES) $(PREFERENCES_SOURCES) ../resources/transaction_resources.c
valac -o libpamac.so \
@ -105,7 +106,7 @@ libpamac.so: $(COMMON_SOURCES) $(TRANSACTION_SOURCES) $(PREFERENCES_SOURCES) ../
$(TRANSACTION_SOURCES) \
$(PREFERENCES_SOURCES)
pamac-manager: libpamac.so ../resources/manager_resources.c manager_window.vala manager.vala
pamac-manager: libpamac.so ../resources/manager_resources.c history_dialog.vala manager_window.vala manager.vala
valac -o pamac-manager \
$(COMMON_VALA_FLAGS) \
$(PAMAC_LIB_FLAGS) \
@ -113,20 +114,10 @@ pamac-manager: libpamac.so ../resources/manager_resources.c manager_window.vala
--pkg=gdk-3.0 \
--gresources=$(MANAGER_GRESOURCE_FILE) \
../resources/manager_resources.c \
history_dialog.vala \
manager_window.vala \
manager.vala
pamac-updater: libpamac.so ../resources/updater_resources.c updater_window.vala updater.vala
valac -o pamac-updater \
$(COMMON_VALA_FLAGS) \
$(PAMAC_LIB_FLAGS) \
--pkg=gtk+-3.0 \
--pkg=gdk-3.0 \
--gresources=$(UPDATER_GRESOURCE_FILE) \
../resources/updater_resources.c \
updater_window.vala \
updater.vala
pamac-install: libpamac.so ../resources/installer_resources.c progress_dialog.vala installer.vala
valac -o pamac-install \
$(COMMON_VALA_FLAGS) \

25
src/alpm_config.vala

@ -51,7 +51,7 @@ class AlpmConfig {
string? arch;
double deltaratio;
int usesyslog;
int checkspace;
public int checkspace;
GLib.List<string> cachedirs;
GLib.List<string> hookdirs;
GLib.List<string> ignoregroups;
@ -134,9 +134,22 @@ class AlpmConfig {
}
}
public Alpm.Handle? get_handle (bool files_db = false) {
Alpm.Errno error;
Alpm.Handle? handle = new Alpm.Handle (rootdir, dbpath, out error);
public Alpm.Handle? get_handle (bool files_db = false, bool tmp_db = false) {
Alpm.Errno error = 0;
Alpm.Handle? handle = null;
if (tmp_db) {
string tmp_dbpath = "/tmp/pamac-checkdbs-%s".printf (Environment.get_user_name ());
try {
Process.spawn_command_line_sync ("mkdir -p %s".printf (tmp_dbpath));
Process.spawn_command_line_sync ("ln -sf %s/local %s".printf (dbpath, tmp_dbpath));
Process.spawn_command_line_sync ("cp -au %s/sync %s".printf (dbpath, tmp_dbpath));
handle = new Alpm.Handle (rootdir, tmp_dbpath, out error);
} catch (SpawnError e) {
stderr.printf ("SpawnError: %s\n", e.message);
}
} else {
handle = new Alpm.Handle (rootdir, dbpath, out error);
}
if (error == Alpm.Errno.DB_VERSION) {
try {
Process.spawn_command_line_sync ("pacman-db-upgrade", null, null, null);
@ -153,7 +166,9 @@ class AlpmConfig {
if (files_db) {
handle.dbext = ".files";
}
handle.logfile = logfile;
if (!tmp_db) {
handle.logfile = logfile;
}
handle.gpgdir = gpgdir;
handle.arch = arch;
handle.deltaratio = deltaratio;

4
src/common.vala

@ -39,8 +39,8 @@ namespace Pamac {
public struct Updates {
public bool is_syncfirst;
public UpdateInfos[] repos_updates;
public UpdateInfos[] aur_updates;
public AlpmPackage[] repos_updates;
public AURPackage[] aur_updates;
}
public struct ErrorInfos {

2
src/history_dialog.vala

@ -19,7 +19,7 @@
namespace Pamac {
[GtkTemplate (ui = "/org/manjaro/pamac/transaction/history_dialog.ui")]
[GtkTemplate (ui = "/org/manjaro/pamac/manager/history_dialog.ui")]
class HistoryDialog : Gtk.Dialog {
[GtkChild]

12
src/installer.vala

@ -26,7 +26,7 @@ namespace Pamac {
bool important_details;
public Installer () {
application_id = "org.manjaro.pamac.install";
application_id = "org.manjaro.pamac.installer";
flags |= ApplicationFlags.HANDLES_OPEN;
}
@ -90,16 +90,6 @@ namespace Pamac {
stderr.printf ("%s\n", e.message);
}
run = app.get_is_remote ();
if (run) {
return run;
}
app = new Application ("org.manjaro.pamac.updater", 0);
try {
app.register ();
} catch (GLib.Error e) {
stderr.printf ("%s\n", e.message);
}
run = app.get_is_remote ();
return run;
}

26
src/manager.vala

@ -22,10 +22,11 @@ namespace Pamac {
class Manager : Gtk.Application {
ManagerWindow manager_window;
bool pamac_run;
bool started;
public Manager () {
application_id = "org.manjaro.pamac.manager";
flags = ApplicationFlags.FLAGS_NONE;
flags = ApplicationFlags.HANDLES_COMMAND_LINE;
}
public override void startup () {
@ -67,13 +68,22 @@ namespace Pamac {
}
}
public override void activate () {
public override int command_line (ApplicationCommandLine cmd) {
if (cmd.get_arguments ()[0] == "pamac-updater") {
manager_window.display_package_queue.clear ();
manager_window.main_stack.visible_child_name = "browse";
manager_window.filters_stack.visible_child_name = "updates";
} else if (!started) {
manager_window.show_default_pkgs ();
started = true;
}
if (!pamac_run) {
manager_window.present ();
while (Gtk.events_pending ()) {
Gtk.main_iteration ();
}
}
return 0;
}
public override void shutdown () {
@ -86,17 +96,7 @@ namespace Pamac {
bool check_pamac_running () {
Application app;
bool run = false;
app = new Application ("org.manjaro.pamac.updater", 0);
try {
app.register ();
} catch (GLib.Error e) {
stderr.printf ("%s\n", e.message);
}
run = app.get_is_remote ();
if (run) {
return run;
}
app = new Application ("org.manjaro.pamac.install", 0);
app = new Application ("org.manjaro.pamac.installer", 0);
try {
app.register ();
} catch (GLib.Error e) {

443
src/manager_window.vala

@ -17,6 +17,8 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
const string VERSION = "4.9.0";
namespace Pamac {
class ActivableCellRendererPixbuf : Gtk.CellRendererPixbuf {