v4.0.0-beta

This commit is contained in:
guinux 2016-04-14 18:19:20 +02:00
parent f7be6e1e88
commit b59e68459b
31 changed files with 4265 additions and 3206 deletions

View File

@ -18,7 +18,7 @@
* along with this program. If not, see <http://www.gnu.org/licenses/>. * along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
// Compile with: valac --pkg=libalpm --vapidir=../vapi --Xcc=-I../util ../util/alpm-util.c pactree.vala -o pactree // Compile with: valac --pkg=libalpm --vapidir=../vapi pactree.vala
using Alpm; using Alpm;
@ -37,10 +37,10 @@ string leaf2_color;
string color_off; string color_off;
/* globals */ /* globals */
unowned Handle? handle; Handle handle;
unowned DB localdb; unowned DB localdb;
Alpm.List<string?> walked = null; Alpm.List<string> walked;
Alpm.List<string?> provisions = null; Alpm.List<string> provisions;
/* options */ /* options */
bool color; bool color;
@ -127,7 +127,7 @@ static int parse_options(ref unowned string[] args) {
static void local_init() { static void local_init() {
Alpm.Errno error; Alpm.Errno error;
handle = Handle.new ("/", dbpath, out error); handle = new Handle ("/", dbpath, out error);
assert (error == 0); assert (error == 0);
localdb = handle.localdb; localdb = handle.localdb;
assert (localdb != null); assert (localdb != null);
@ -187,11 +187,11 @@ static void walk_reverse_deps(Package pkg, int depth) {
if((max_depth >= 0) && (depth > max_depth)) return; if((max_depth >= 0) && (depth > max_depth)) return;
walked.add(pkg.name); walked.add(pkg.name);
Alpm.List<string?> *required_by = pkg.compute_requiredby(); Alpm.List<string> required_by = pkg.compute_requiredby();
int i = 0; unowned Alpm.List<string> list = required_by;
while (i < required_by->length) { while (list != null) {
string? pkgname = required_by->nth_data(i); unowned string pkgname = list.data;
if (walked.find_str(pkgname) != null) { if (walked.find_str(pkgname) != null) {
/* if we've already seen this package, don't print in "unique" output /* if we've already seen this package, don't print in "unique" output
* and don't recurse */ * and don't recurse */
@ -202,9 +202,9 @@ static void walk_reverse_deps(Package pkg, int depth) {
print(pkg.name, pkgname, null, depth); print(pkg.name, pkgname, null, depth);
walk_reverse_deps(localdb.get_pkg(pkgname), depth + 1); walk_reverse_deps(localdb.get_pkg(pkgname), depth + 1);
} }
i++; list.next ();
} }
Alpm.List.free_all(required_by); required_by.free_inner(GLib.free);
} }
/** /**
@ -216,8 +216,10 @@ static void walk_deps(Package pkg, int depth)
walked.add(pkg.name); walked.add(pkg.name);
foreach (unowned Depend depend in pkg.depends) { unowned Alpm.List<unowned Depend> depends = pkg.depends;
string depname = depend.name; while (depends != null) {
unowned Alpm.Depend depend = depends.data;
unowned string depname = depend.name;
unowned Package? provider = find_satisfier (localdb.pkgcache, depname); unowned Package? provider = find_satisfier (localdb.pkgcache, depname);
if (provider != null) { if (provider != null) {
@ -237,6 +239,7 @@ static void walk_deps(Package pkg, int depth)
/* unresolvable package */ /* unresolvable package */
print(pkg.name, null, depname, depth); print(pkg.name, null, depname, depth);
} }
depends.next ();
} }
} }

View File

@ -21,7 +21,7 @@ msgstr ""
msgid "Authentication is required" msgid "Authentication is required"
msgstr "" msgstr ""
#: ../src/daemon.vala ../src/transaction.vala #: ../src/daemon.vala
msgid "Failed to initialize alpm library" msgid "Failed to initialize alpm library"
msgstr "" msgstr ""
@ -29,6 +29,26 @@ msgstr ""
msgid "Failed to synchronize any databases" msgid "Failed to synchronize any databases"
msgstr "" msgstr ""
#: ../src/daemon.vala
msgid "Unknown"
msgstr ""
#: ../src/daemon.vala
msgid "Explicitly installed"
msgstr ""
#: ../src/daemon.vala
msgid "Installed as a dependency for another package"
msgstr ""
#: ../src/daemon.vala
msgid "Yes"
msgstr ""
#: ../src/daemon.vala
msgid "No"
msgstr ""
#: ../src/daemon.vala #: ../src/daemon.vala
msgid "Failed to init transaction" msgid "Failed to init transaction"
msgstr "" msgstr ""
@ -120,7 +140,7 @@ msgstr ""
msgid "Transaction Summary" msgid "Transaction Summary"
msgstr "" msgstr ""
#: ../src/transaction.vala ../src/manager_window.vala #: ../src/transaction.vala
msgid "To remove" msgid "To remove"
msgstr "" msgstr ""
@ -132,7 +152,7 @@ msgstr ""
msgid "To build" msgid "To build"
msgstr "" msgstr ""
#: ../src/transaction.vala ../src/manager_window.vala #: ../src/transaction.vala
msgid "To install" msgid "To install"
msgstr "" msgstr ""
@ -153,11 +173,7 @@ msgid "Building packages"
msgstr "" msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
msgid "Running pre-transaction hooks" msgid "Transaction cancelled"
msgstr ""
#: ../src/transaction.vala
msgid "Running post-transaction hooks"
msgstr "" msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
@ -181,38 +197,30 @@ msgstr ""
msgid "Installing %s" msgid "Installing %s"
msgstr "" msgstr ""
#: ../src/transaction.vala
#, c-format
msgid "Reinstalling %s"
msgstr ""
#: ../src/transaction.vala
#, c-format
msgid "Removing %s"
msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
#, c-format #, c-format
msgid "Upgrading %s" msgid "Upgrading %s"
msgstr "" msgstr ""
#: ../src/transaction.vala
#, c-format
msgid "Reinstalling %s"
msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
#, c-format #, c-format
msgid "Downgrading %s" msgid "Downgrading %s"
msgstr "" msgstr ""
#: ../src/transaction.vala
#, c-format
msgid "Removing %s"
msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
msgid "Checking integrity" msgid "Checking integrity"
msgstr "" msgstr ""
#: ../src/transaction.vala
msgid "Checking keyring"
msgstr ""
#: ../src/transaction.vala
msgid "Downloading required keys"
msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
msgid "Loading packages files" msgid "Loading packages files"
msgstr "" msgstr ""
@ -247,6 +255,11 @@ msgstr ""
msgid "Downloading" msgid "Downloading"
msgstr "" msgstr ""
#: ../src/transaction.vala
#, c-format
msgid "Downloading %s"
msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
msgid "Checking available disk space" msgid "Checking available disk space"
msgstr "" msgstr ""
@ -261,6 +274,14 @@ msgstr ""
msgid "Database file for %s does not exist" msgid "Database file for %s does not exist"
msgstr "" msgstr ""
#: ../src/transaction.vala
msgid "Checking keyring"
msgstr ""
#: ../src/transaction.vala
msgid "Downloading required keys"
msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
#, c-format #, c-format
msgid "%s installed as %s.pacnew" msgid "%s installed as %s.pacnew"
@ -272,13 +293,11 @@ msgid "%s installed as %s.pacsave"
msgstr "" msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
#, c-format msgid "Running pre-transaction hooks"
msgid "Refreshing %s"
msgstr "" msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
#, c-format msgid "Running post-transaction hooks"
msgid "Downloading %s"
msgstr "" msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
@ -294,7 +313,8 @@ msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: ../src/transaction.vala #: ../src/transaction.vala
msgid "Warning" #, c-format
msgid "Refreshing %s"
msgstr "" msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
@ -302,7 +322,7 @@ msgid "Error"
msgstr "" msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
msgid "Transaction cancelled" msgid "Warning"
msgstr "" msgstr ""
#: ../src/transaction.vala #: ../src/transaction.vala
@ -369,8 +389,11 @@ msgid "Mark as explicitly installed"
msgstr "" msgstr ""
#: ../src/manager_window.vala #: ../src/manager_window.vala
msgid "local" #, c-format
msgstr "" msgid "%u pending operation"
msgid_plural "%u pending operations"
msgstr[0] ""
msgstr[1] ""
#: ../src/manager_window.vala #: ../src/manager_window.vala
msgid "Installed" msgid "Installed"
@ -381,11 +404,48 @@ msgid "Orphans"
msgstr "" msgstr ""
#: ../src/manager_window.vala #: ../src/manager_window.vala
msgid "Licenses" msgid "Foreign"
msgstr "" msgstr ""
#: ../src/manager_window.vala #: ../src/manager_window.vala
msgid "Unknown" msgid "Pending"
msgstr ""
#: ../src/manager_window.vala
msgid "Licenses"
msgstr ""
#: ../src/manager_window.vala ../resources/manager_window.ui
#: ../resources/updater_window.ui
msgid "Repository"
msgstr ""
#: ../src/manager_window.vala ../resources/manager_window.ui
msgid "Groups"
msgstr ""
#: ../src/manager_window.vala
msgid "Packager"
msgstr ""
#: ../src/manager_window.vala
msgid "Build Date"
msgstr ""
#: ../src/manager_window.vala
msgid "Install Date"
msgstr ""
#: ../src/manager_window.vala
msgid "Install Reason"
msgstr ""
#: ../src/manager_window.vala
msgid "Signatures"
msgstr ""
#: ../src/manager_window.vala
msgid "Backup files"
msgstr "" msgstr ""
#: ../src/manager_window.vala #: ../src/manager_window.vala
@ -416,62 +476,6 @@ msgstr ""
msgid "Conflicts With" msgid "Conflicts With"
msgstr "" msgstr ""
#: ../src/manager_window.vala
msgid "Make Dependencies"
msgstr ""
#: ../src/manager_window.vala
msgid "Check Dependencies"
msgstr ""
#: ../src/manager_window.vala ../resources/manager_window.ui
msgid "Repository"
msgstr ""
#: ../src/manager_window.vala ../resources/manager_window.ui
msgid "Groups"
msgstr ""
#: ../src/manager_window.vala
msgid "Packager"
msgstr ""
#: ../src/manager_window.vala
msgid "Build Date"
msgstr ""
#: ../src/manager_window.vala
msgid "Install Date"
msgstr ""
#: ../src/manager_window.vala
msgid "Explicitly installed"
msgstr ""
#: ../src/manager_window.vala
msgid "Installed as a dependency for another package"
msgstr ""
#: ../src/manager_window.vala
msgid "Install Reason"
msgstr ""
#: ../src/manager_window.vala
msgid "Yes"
msgstr ""
#: ../src/manager_window.vala
msgid "No"
msgstr ""
#: ../src/manager_window.vala
msgid "Signatures"
msgstr ""
#: ../src/manager_window.vala
msgid "Backup files"
msgstr ""
#: ../src/manager_window.vala #: ../src/manager_window.vala
msgid "Package Base" msgid "Package Base"
msgstr "" msgstr ""
@ -488,7 +492,7 @@ msgstr ""
msgid "Last Modified" msgid "Last Modified"
msgstr "" msgstr ""
#: ../src/manager_window.vala ../resources/manager_window.ui #: ../src/manager_window.vala
msgid "Votes" msgid "Votes"
msgstr "" msgstr ""
@ -496,6 +500,11 @@ msgstr ""
msgid "Out of Date" msgid "Out of Date"
msgstr "" msgstr ""
#: ../src/manager_window.vala ../resources/manager_window.ui
#: ../resources/updater_window.ui
msgid "Name"
msgstr ""
#: ../src/manager_window.vala #: ../src/manager_window.vala
#, c-format #, c-format
msgid "" msgid ""
@ -507,17 +516,13 @@ msgid_plural ""
msgstr[0] "" msgstr[0] ""
msgstr[1] "" msgstr[1] ""
#: ../src/manager_window.vala
msgid "Uninstalled"
msgstr ""
#: ../src/manager_window.vala ../resources/manager_window.ui #: ../src/manager_window.vala ../resources/manager_window.ui
msgid "Install Local Packages" msgid "Install Local Packages"
msgstr "" msgstr ""
#: ../src/manager_window.vala ../resources/progress_dialog.ui #: ../src/manager_window.vala ../resources/progress_dialog.ui
#: ../resources/transaction_sum_dialog.ui ../resources/choose_dep_dialog.ui #: ../resources/transaction_sum_dialog.ui ../resources/choose_dep_dialog.ui
#: ../resources/choose_ignorepkgs_dialog.ui #: ../resources/manager_window.ui ../resources/choose_ignorepkgs_dialog.ui
msgid "_Cancel" msgid "_Cancel"
msgstr "" msgstr ""
@ -571,10 +576,8 @@ msgstr ""
msgid "Progress" msgid "Progress"
msgstr "" msgstr ""
#: ../resources/progress_dialog.ui ../resources/history_dialog.ui #: ../resources/progress_dialog.ui
#: ../resources/transaction_info_dialog.ui ../resources/updater_window.ui msgid "_Hide"
#: ../resources/preferences_dialog.ui
msgid "_Close"
msgstr "" msgstr ""
#: ../resources/progress_dialog.ui ../resources/transaction_info_dialog.ui #: ../resources/progress_dialog.ui ../resources/transaction_info_dialog.ui
@ -586,6 +589,11 @@ msgstr ""
msgid "Pamac History" msgid "Pamac History"
msgstr "" msgstr ""
#: ../resources/history_dialog.ui ../resources/transaction_info_dialog.ui
#: ../resources/updater_window.ui ../resources/preferences_dialog.ui
msgid "_Close"
msgstr ""
#: ../resources/choose_dep_dialog.ui #: ../resources/choose_dep_dialog.ui
msgid "Choose Optional Dependencies" msgid "Choose Optional Dependencies"
msgstr "" msgstr ""
@ -606,14 +614,6 @@ msgstr ""
msgid "Refresh databases" msgid "Refresh databases"
msgstr "" msgstr ""
#: ../resources/manager_window.ui
msgid "Apply changes"
msgstr ""
#: ../resources/manager_window.ui
msgid "Cancel all planned changes"
msgstr ""
#: ../resources/manager_window.ui #: ../resources/manager_window.ui
msgid "Search in AUR" msgid "Search in AUR"
msgstr "" msgstr ""
@ -622,7 +622,7 @@ msgstr ""
msgid "Search" msgid "Search"
msgstr "" msgstr ""
#: ../resources/manager_window.ui #: ../resources/manager_window.ui ../resources/updater_window.ui
msgid "State" msgid "State"
msgstr "" msgstr ""
@ -630,25 +630,29 @@ msgstr ""
msgid "Repositories" msgid "Repositories"
msgstr "" msgstr ""
#: ../resources/manager_window.ui #: ../resources/manager_window.ui ../resources/updater_window.ui
msgid "Name"
msgstr ""
#: ../resources/manager_window.ui
msgid "Version" msgid "Version"
msgstr "" msgstr ""
#: ../resources/manager_window.ui #: ../resources/manager_window.ui ../resources/updater_window.ui
msgid "Size" msgid "Size"
msgstr "" msgstr ""
#: ../resources/manager_window.ui
msgid "Popularity"
msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui #: ../resources/manager_window.ui ../resources/updater_window.ui
#: ../resources/preferences_dialog.ui #: ../resources/preferences_dialog.ui
msgid "AUR" msgid "AUR"
msgstr "" msgstr ""
#: ../resources/manager_window.ui ../resources/updater_window.ui
msgid "_Apply"
msgstr ""
#: ../resources/manager_window.ui #: ../resources/manager_window.ui
msgid "Description" msgid "Browse"
msgstr "" msgstr ""
#: ../resources/manager_window.ui #: ../resources/manager_window.ui
@ -663,10 +667,6 @@ msgstr ""
msgid "_Refresh" msgid "_Refresh"
msgstr "" msgstr ""
#: ../resources/updater_window.ui
msgid "_Apply"
msgstr ""
#: ../resources/preferences_dialog.ui #: ../resources/preferences_dialog.ui
msgid "Preferences" msgid "Preferences"
msgstr "" msgstr ""
@ -689,6 +689,10 @@ msgstr ""
msgid "Check for updates" msgid "Check for updates"
msgstr "" msgstr ""
#: ../resources/preferences_dialog.ui
msgid "6"
msgstr ""
#: ../resources/preferences_dialog.ui #: ../resources/preferences_dialog.ui
msgid "Hide tray icon when no update available" msgid "Hide tray icon when no update available"
msgstr "" msgstr ""

View File

@ -3,6 +3,7 @@ MANAGER_RESOURCES_FILES = manager_window.ui \
choose_dep_dialog.ui \ choose_dep_dialog.ui \
history_dialog.ui \ history_dialog.ui \
package-available.png \ package-available.png \
package-available-locked.png \
package-install.png \ package-install.png \
package-installed-locked.png \ package-installed-locked.png \
package-installed-updated.png \ package-installed-updated.png \

View File

@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<template class="PamacChooseDependenciesDialog" parent="GtkDialog"> <template class="PamacChooseDependenciesDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes">Choose Optional Dependencies</property> <property name="title" translatable="yes">Choose Optional Dependencies</property>
<property name="modal">True</property> <property name="modal">True</property>
<property name="window_position">center-on-parent</property> <property name="window_position">center-on-parent</property>
<property name="icon_name">system-software-install</property> <property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="urgency_hint">True</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property> <property name="can_focus">False</property>
@ -23,25 +26,28 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_focus">True</property> <property name="has_focus">True</property>
<property name="use_underline">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkButton" id="valid_button"> <object class="GtkButton" id="valid_button">
<property name="label" translatable="yes">_OK</property> <property name="label" translatable="yes">_OK</property>
<property name="use_underline">True</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_focus">True</property> <property name="has_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>
@ -49,6 +55,7 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="pack_type">end</property> <property name="pack_type">end</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -59,6 +66,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -112,6 +120,7 @@
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@ -10,6 +10,7 @@
<property name="window_position">center-on-parent</property> <property name="window_position">center-on-parent</property>
<property name="icon_name">system-software-install</property> <property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="urgency_hint">True</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
<property name="can_focus">False</property> <property name="can_focus">False</property>

View File

@ -1,13 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<template class="PamacChooseProviderDialog" parent="GtkDialog"> <template class="PamacChooseProviderDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes">Choose a Provider</property> <property name="title" translatable="yes">Choose a Provider</property>
<property name="modal">True</property> <property name="modal">True</property>
<property name="window_position">center-on-parent</property> <property name="window_position">center-on-parent</property>
<property name="icon_name">system-software-install</property> <property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="urgency_hint">True</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox2"> <object class="GtkBox" id="dialog-vbox2">
<property name="can_focus">False</property> <property name="can_focus">False</property>
@ -20,14 +23,16 @@
<child> <child>
<object class="GtkButton" id="valid_button"> <object class="GtkButton" id="valid_button">
<property name="label" translatable="yes">_OK</property> <property name="label" translatable="yes">_OK</property>
<property name="use_underline">True</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_focus">True</property> <property name="has_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
</object> </object>
@ -35,6 +40,7 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="pack_type">end</property> <property name="pack_type">end</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -52,6 +58,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -62,12 +69,14 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@ -1,9 +1,12 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<template class="PamacHistoryDialog" parent="GtkDialog"> <template class="PamacHistoryDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes">Pamac History</property> <property name="title" translatable="yes">Pamac History</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">600</property> <property name="default_width">600</property>
<property name="default_height">500</property> <property name="default_height">500</property>
<property name="icon_name">system-software-install</property> <property name="icon_name">system-software-install</property>
@ -20,14 +23,16 @@
<child> <child>
<object class="GtkButton" id="close_button"> <object class="GtkButton" id="close_button">
<property name="label" translatable="yes">_Close</property> <property name="label" translatable="yes">_Close</property>
<property name="use_underline">True</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_focus">True</property> <property name="has_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
</object> </object>
@ -35,6 +40,7 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="pack_type">end</property> <property name="pack_type">end</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -58,6 +64,7 @@
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>

File diff suppressed because it is too large Load Diff

Binary file not shown.

After

Width:  |  Height:  |  Size: 411 B

View File

@ -5,6 +5,7 @@
<file preprocess="xml-stripblanks">history_dialog.ui</file> <file preprocess="xml-stripblanks">history_dialog.ui</file>
<file preprocess="xml-stripblanks">choose_dep_dialog.ui</file> <file preprocess="xml-stripblanks">choose_dep_dialog.ui</file>
<file preprocess="to-pixdata">package-available.png</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> <file preprocess="to-pixdata">package-install.png</file>
<file preprocess="to-pixdata">package-installed-locked.png</file> <file preprocess="to-pixdata">package-installed-locked.png</file>
<file preprocess="to-pixdata">package-installed-updated.png</file> <file preprocess="to-pixdata">package-installed-updated.png</file>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0 --> <!-- Generated with glade 3.20.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.14"/> <requires lib="gtk+" version="3.14"/>
<object class="GtkAdjustment" id="adjustment"> <object class="GtkAdjustment" id="adjustment">
@ -9,19 +9,13 @@
<property name="step_increment">1</property> <property name="step_increment">1</property>
<property name="page_increment">10</property> <property name="page_increment">10</property>
</object> </object>
<object class="GtkListStore" id="ignorepkgs_liststore">
<columns>
<!-- column-name name -->
<column type="gchararray"/>
</columns>
</object>
<template class="PamacPreferencesDialog" parent="GtkDialog"> <template class="PamacPreferencesDialog" parent="GtkDialog">
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes">Preferences</property> <property name="title" translatable="yes">Preferences</property>
<property name="window_position">center-on-parent</property> <property name="window_position">center-on-parent</property>
<property name="icon_name">system-software-install</property> <property name="icon_name">system-software-install</property>
<property name="type_hint">normal</property> <property name="type_hint">dialog</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox"> <object class="GtkBox" id="dialog-vbox">
<property name="can_focus">False</property> <property name="can_focus">False</property>
@ -54,13 +48,28 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkNotebook" id="notebook1"> <object class="GtkStackSwitcher" id="stackswitcher">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="halign">center</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> <child>
<object class="GtkBox" id="general_config_box"> <object class="GtkBox" id="general_config_box">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_start">6</property> <property name="margin_start">6</property>
<property name="margin_end">6</property> <property name="margin_end">6</property>
<property name="margin_top">6</property> <property name="margin_top">6</property>
@ -168,6 +177,7 @@
<object class="GtkSwitch" id="check_updates_button"> <object class="GtkSwitch" id="check_updates_button">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Check for updates</property>
<property name="halign">end</property> <property name="halign">end</property>
</object> </object>
<packing> <packing>
@ -192,6 +202,7 @@
<object class="GtkLabel" id="refresh_period_label"> <object class="GtkLabel" id="refresh_period_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">24</property>
<property name="margin_start">24</property> <property name="margin_start">24</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="xalign">0</property> <property name="xalign">0</property>
@ -208,6 +219,7 @@
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">How often to check for updates, value in hours</property> <property name="tooltip_text" translatable="yes">How often to check for updates, value in hours</property>
<property name="halign">end</property> <property name="halign">end</property>
<property name="text" translatable="yes">6</property>
<property name="caps_lock_warning">False</property> <property name="caps_lock_warning">False</property>
<property name="input_purpose">number</property> <property name="input_purpose">number</property>
<property name="adjustment">adjustment</property> <property name="adjustment">adjustment</property>
@ -234,8 +246,10 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="margin_left">22</property>
<property name="margin_start">22</property> <property name="margin_start">22</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
@ -255,6 +269,7 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="halign">start</property> <property name="halign">start</property>
<property name="valign">start</property> <property name="valign">start</property>
<property name="margin_left">26</property>
<property name="margin_start">26</property> <property name="margin_start">26</property>
<property name="label" translatable="yes">Ignore upgrades for:</property> <property name="label" translatable="yes">Ignore upgrades for:</property>
<property name="xalign">0</property> <property name="xalign">0</property>
@ -269,6 +284,7 @@
<object class="GtkBox" id="box10"> <object class="GtkBox" id="box10">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">12</property>
<property name="margin_start">12</property> <property name="margin_start">12</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
@ -284,12 +300,11 @@
<object class="GtkTreeView" id="ignorepkgs_treeview"> <object class="GtkTreeView" id="ignorepkgs_treeview">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="model">ignorepkgs_liststore</property>
<property name="headers_visible">False</property> <property name="headers_visible">False</property>
<property name="search_column">0</property> <property name="search_column">0</property>
<property name="show_expanders">False</property> <property name="show_expanders">False</property>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection1"/> <object class="GtkTreeSelection" id="treeview-selection"/>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1"> <object class="GtkTreeViewColumn" id="treeviewcolumn1">
@ -368,21 +383,17 @@
</packing> </packing>
</child> </child>
</object> </object>
</child>
<child type="tab">
<object class="GtkLabel" id="tab_label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">General</property>
</object>
<packing> <packing>
<property name="tab_fill">False</property> <property name="name">general</property>
<property name="title" translatable="yes">General</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkBox" id="mirrors_config_box"> <object class="GtkBox" id="mirrors_config_box">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_start">6</property> <property name="margin_start">6</property>
<property name="margin_end">6</property> <property name="margin_end">6</property>
<property name="margin_top">6</property> <property name="margin_top">6</property>
@ -483,20 +494,11 @@
</child> </child>
</object> </object>
<packing> <packing>
<property name="name">official_repositories</property>
<property name="title" translatable="yes">Official Repositories</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child type="tab">
<object class="GtkLabel" id="tab_label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Official Repositories</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
<child> <child>
<object class="GtkBox" id="aur_config_box"> <object class="GtkBox" id="aur_config_box">
<property name="visible">True</property> <property name="visible">True</property>
@ -568,6 +570,8 @@ All AUR users should be familiar with the build process.</property>
<object class="GtkLabel" id="enable_aur_label"> <object class="GtkLabel" id="enable_aur_label">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_start">6</property> <property name="margin_start">6</property>
<property name="margin_end">6</property> <property name="margin_end">6</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
@ -586,6 +590,8 @@ All AUR users should be familiar with the build process.</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="tooltip_text" translatable="yes">Allow Pamac to search and install packages from AUR</property> <property name="tooltip_text" translatable="yes">Allow Pamac to search and install packages from AUR</property>
<property name="halign">end</property> <property name="halign">end</property>
<property name="margin_left">6</property>
<property name="margin_right">6</property>
<property name="margin_start">6</property> <property name="margin_start">6</property>
<property name="margin_end">6</property> <property name="margin_end">6</property>
</object> </object>
@ -608,8 +614,10 @@ All AUR users should be familiar with the build process.</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="margin_left">24</property>
<property name="margin_start">24</property> <property name="margin_start">24</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
@ -624,8 +632,10 @@ All AUR users should be familiar with the build process.</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="margin_left">24</property>
<property name="margin_start">24</property> <property name="margin_start">24</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
@ -640,8 +650,10 @@ All AUR users should be familiar with the build process.</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="margin_left">24</property>
<property name="margin_start">24</property> <property name="margin_start">24</property>
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="xalign">0</property>
<property name="draw_indicator">True</property> <property name="draw_indicator">True</property>
</object> </object>
<packing> <packing>
@ -652,25 +664,16 @@ All AUR users should be familiar with the build process.</property>
</child> </child>
</object> </object>
<packing> <packing>
<property name="name">aur</property>
<property name="title" translatable="yes">AUR</property>
<property name="position">2</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
<child type="tab">
<object class="GtkLabel" id="tab_label3">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">AUR</property>
</object>
<packing>
<property name="position">2</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0 --> <!-- Generated with glade 3.20.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<template class="PamacProgressDialog" parent="GtkDialog"> <template class="PamacProgressDialog" parent="GtkDialog">
@ -7,11 +7,9 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes">Progress</property> <property name="title" translatable="yes">Progress</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property> <property name="window_position">center-on-parent</property>
<property name="icon_name">system-software-install</property> <property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="deletable">False</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox1"> <object class="GtkBox" id="dialog-vbox1">
<property name="visible">True</property> <property name="visible">True</property>
@ -39,7 +37,7 @@
</child> </child>
<child> <child>
<object class="GtkButton" id="close_button"> <object class="GtkButton" id="close_button">
<property name="label" translatable="yes">_Close</property> <property name="label" translatable="yes">_Hide</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>

View File

@ -1,11 +1,16 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<template class="PamacTransactionInfoDialog" parent="GtkDialog"> <template class="PamacTransactionInfoDialog" parent="GtkDialog">
<property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="modal">True</property>
<property name="window_position">center-on-parent</property>
<property name="default_width">300</property> <property name="default_width">300</property>
<property name="icon_name">system-software-install</property> <property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property> <property name="type_hint">dialog</property>
<property name="urgency_hint">True</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox4"> <object class="GtkBox" id="dialog-vbox4">
<property name="can_focus">False</property> <property name="can_focus">False</property>
@ -21,11 +26,13 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_focus">True</property> <property name="has_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
</object> </object>
@ -33,6 +40,7 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="pack_type">end</property> <property name="pack_type">end</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -43,6 +51,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -83,6 +92,7 @@
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">2</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@ -1,11 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.20.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<template class="PamacTransactionSumDialog" parent="GtkDialog"> <template class="PamacTransactionSumDialog" parent="GtkDialog">
<property name="title" translatable="yes">Transaction Summary</property> <property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="type_hint">dialog</property> <property name="title" translatable="yes">Transaction Summary</property>
<property name="window_position">center-on-parent</property>
<property name="icon_name">system-software-install</property> <property name="icon_name">system-software-install</property>
<property name="type_hint">dialog</property>
<child internal-child="vbox"> <child internal-child="vbox">
<object class="GtkBox" id="dialog-vbox6"> <object class="GtkBox" id="dialog-vbox6">
<property name="can_focus">False</property> <property name="can_focus">False</property>
@ -21,12 +24,13 @@
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="has_focus">True</property> <property name="has_focus">True</property>
<property name="use_underline">True</property>
<property name="receives_default">False</property> <property name="receives_default">False</property>
<property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -34,11 +38,13 @@
<property name="label" translatable="yes">_OK</property> <property name="label" translatable="yes">_OK</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="receives_default">False</property>
<property name="use_underline">True</property> <property name="use_underline">True</property>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
</object> </object>
@ -46,6 +52,7 @@
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="pack_type">end</property> <property name="pack_type">end</property>
<property name="position">0</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -56,6 +63,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -65,7 +73,7 @@
<property name="hexpand">True</property> <property name="hexpand">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="shadow_type">in</property> <property name="shadow_type">in</property>
<property name="min_content_width">330</property> <property name="min_content_width">450</property>
<property name="min_content_height">250</property> <property name="min_content_height">250</property>
<child> <child>
<object class="GtkTreeView" id="treeview"> <object class="GtkTreeView" id="treeview">
@ -75,7 +83,6 @@
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="headers_visible">False</property> <property name="headers_visible">False</property>
<property name="headers_clickable">False</property> <property name="headers_clickable">False</property>
<property name="enable_search">False</property>
<property name="search_column">0</property> <property name="search_column">0</property>
<property name="show_expanders">False</property> <property name="show_expanders">False</property>
<child internal-child="selection"> <child internal-child="selection">
@ -87,12 +94,11 @@
<object class="GtkTreeViewColumn" id="_action"> <object class="GtkTreeViewColumn" id="_action">
<property name="sizing">autosize</property> <property name="sizing">autosize</property>
<child> <child>
<object class="GtkCellRendererText" id="cellrenderertext5"> <object class="GtkCellRendererText" id="cellrenderertext1">
<property name="yalign">0</property> <property name="yalign">0</property>
<property name="weight">600</property>
</object> </object>
<attributes> <attributes>
<attribute name="text">0</attribute> <attribute name="markup">0</attribute>
</attributes> </attributes>
</child> </child>
</object> </object>
@ -101,19 +107,38 @@
<object class="GtkTreeViewColumn" id="_packages"> <object class="GtkTreeViewColumn" id="_packages">
<property name="sizing">autosize</property> <property name="sizing">autosize</property>
<child> <child>
<object class="GtkCellRendererText" id="cellrenderertext6"/> <object class="GtkCellRendererText" id="cellrenderertext2"/>
<attributes> <attributes>
<attribute name="text">1</attribute> <attribute name="text">1</attribute>
</attributes> </attributes>
</child> </child>
</object> </object>
</child> </child>
<child>
<object class="GtkTreeViewColumn" id="_version">
<property name="sizing">autosize</property>
<property name="title" translatable="yes">column</property>
<child>
<object class="GtkCellRendererText" id="cellrenderertext3"/>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
<child>
<object class="GtkCellRendererText" id="cellrenderertext4"/>
<attributes>
<attribute name="text">3</attribute>
</attributes>
</child>
</object>
</child>
</object> </object>
</child> </child>
</object> </object>
<packing> <packing>
<property name="expand">True</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">2</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -124,6 +149,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">3</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!-- Generated with glade 3.19.0 --> <!-- Generated with glade 3.20.0 -->
<interface> <interface>
<requires lib="gtk+" version="3.12"/> <requires lib="gtk+" version="3.12"/>
<template class="PamacUpdaterWindow" parent="GtkApplicationWindow"> <template class="PamacUpdaterWindow" parent="GtkApplicationWindow">
@ -7,9 +7,9 @@
<property name="can_focus">False</property> <property name="can_focus">False</property>
<property name="border_width">6</property> <property name="border_width">6</property>
<property name="title" translatable="yes">Update Manager</property> <property name="title" translatable="yes">Update Manager</property>
<property name="window_position">center</property> <property name="default_width">600</property>
<property name="default_width">500</property>
<property name="icon_name">system-software-update</property> <property name="icon_name">system-software-update</property>
<property name="gravity">center</property>
<child> <child>
<object class="GtkBox" id="box1"> <object class="GtkBox" id="box1">
<property name="visible">True</property> <property name="visible">True</property>
@ -30,25 +30,35 @@
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkNotebook" id="notebook"> <object class="GtkStackSwitcher" id="stackswitcher">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">False</property>
<property name="halign">center</property>
<property name="stack">stack</property>
</object>
<packing>
<property name="expand">False</property>
<property name="fill">True</property>
<property name="position">1</property>
</packing>
</child>
<child>
<object class="GtkStack" id="stack">
<property name="visible">True</property>
<property name="can_focus">False</property>
<child> <child>
<object class="GtkScrolledWindow" id="repos_scrolledwindow"> <object class="GtkScrolledWindow" id="repos_scrolledwindow">
<property name="width_request">400</property> <property name="width_request">600</property>
<property name="height_request">400</property> <property name="height_request">450</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child> <child>
<object class="GtkTreeView" id="repos_updates_treeview"> <object class="GtkTreeView" id="repos_updates_treeview">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="vexpand">True</property>
<property name="headers_visible">False</property>
<property name="headers_clickable">False</property> <property name="headers_clickable">False</property>
<property name="search_column">0</property> <property name="search_column">1</property>
<property name="show_expanders">False</property>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection"> <object class="GtkTreeSelection" id="treeview-selection">
<property name="mode">none</property> <property name="mode">none</property>
@ -56,6 +66,11 @@
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="treeviewcolumn3"> <object class="GtkTreeViewColumn" id="treeviewcolumn3">
<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>
<child> <child>
<object class="GtkCellRendererToggle" id="repos_select_update"> <object class="GtkCellRendererToggle" id="repos_select_update">
<signal name="toggled" handler="on_repos_select_update_toggled" swapped="no"/> <signal name="toggled" handler="on_repos_select_update_toggled" swapped="no"/>
@ -68,6 +83,11 @@
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="treeviewcolumn1"> <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="expand">True</property>
<child> <child>
<object class="GtkCellRendererText" id="repos_update_name"/> <object class="GtkCellRendererText" id="repos_update_name"/>
@ -78,45 +98,77 @@
</object> </object>
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="treeviewcolumn2"> <object class="GtkTreeViewColumn" id="treeviewcolumn6">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed_width">150</property>
<property name="min_width">20</property>
<property name="title" translatable="yes">Version</property>
<child> <child>
<object class="GtkCellRendererText" id="repos_update_download_size"/> <object class="GtkCellRendererText" id="repos_new_update_version"/>
<attributes> <attributes>
<attribute name="text">2</attribute> <attribute name="text">2</attribute>
</attributes> </attributes>
</child> </child>
<child>
<object class="GtkCellRendererText" id="repos_old_update_version"/>
<attributes>
<attribute name="text">3</attribute>
</attributes>
</child>
</object>
</child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn10">
<property name="resizable">True</property>
<property name="fixed_width">90</property>
<property name="min_width">20</property>
<property name="title" translatable="yes">Repository</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>
<child>
<object class="GtkCellRendererText" id="repos_update_size"/>
<attributes>
<attribute name="text">5</attribute>
</attributes>
</child>
</object> </object>
</child> </child>
</object> </object>
</child> </child>
</object> </object>
</child>
<child type="tab">
<object class="GtkLabel" id="label1">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">Repositories</property>
</object>
<packing> <packing>
<property name="tab_fill">False</property> <property name="name">repos</property>
<property name="title" translatable="yes">Repositories</property>
</packing> </packing>
</child> </child>
<child> <child>
<object class="GtkScrolledWindow" id="aur_scrolledwindow"> <object class="GtkScrolledWindow" id="aur_scrolledwindow">
<property name="width_request">400</property> <property name="width_request">600</property>
<property name="height_request">400</property> <property name="height_request">450</property>
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="hexpand">True</property>
<property name="vexpand">True</property>
<child> <child>
<object class="GtkTreeView" id="aur_updates_treeview"> <object class="GtkTreeView" id="aur_updates_treeview">
<property name="visible">True</property> <property name="visible">True</property>
<property name="can_focus">True</property> <property name="can_focus">True</property>
<property name="vexpand">True</property> <property name="vexpand">True</property>
<property name="headers_visible">False</property>
<property name="headers_clickable">False</property> <property name="headers_clickable">False</property>
<property name="search_column">0</property> <property name="search_column">1</property>
<property name="show_expanders">False</property>
<child internal-child="selection"> <child internal-child="selection">
<object class="GtkTreeSelection" id="treeview-selection2"> <object class="GtkTreeSelection" id="treeview-selection2">
<property name="mode">none</property> <property name="mode">none</property>
@ -124,6 +176,11 @@
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="treeviewcolumn4"> <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>
<child> <child>
<object class="GtkCellRendererToggle" id="aur_select_update"> <object class="GtkCellRendererToggle" id="aur_select_update">
<signal name="toggled" handler="on_aur_select_update_toggled" swapped="no"/> <signal name="toggled" handler="on_aur_select_update_toggled" swapped="no"/>
@ -136,6 +193,11 @@
</child> </child>
<child> <child>
<object class="GtkTreeViewColumn" id="treeviewcolumn5"> <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="expand">True</property>
<child> <child>
<object class="GtkCellRendererText" id="aur_update_name"/> <object class="GtkCellRendererText" id="aur_update_name"/>
@ -145,29 +207,35 @@
</child> </child>
</object> </object>
</child> </child>
<child>
<object class="GtkTreeViewColumn" id="treeviewcolumn8">
<property name="resizable">True</property>
<property name="sizing">fixed</property>
<property name="fixed_width">150</property>
<property name="min_width">20</property>
<property name="title" translatable="yes">Version</property>
<child>
<object class="GtkCellRendererText" id="aur_update_version"/>
<attributes>
<attribute name="text">2</attribute>
</attributes>
</child>
</object>
</child>
</object> </object>
</child> </child>
</object> </object>
<packing> <packing>
<property name="name">aur</property>
<property name="title" translatable="yes">AUR</property>
<property name="position">1</property> <property name="position">1</property>
</packing> </packing>
</child> </child>
<child type="tab">
<object class="GtkLabel" id="label2">
<property name="visible">True</property>
<property name="can_focus">False</property>
<property name="label" translatable="yes">AUR</property>
</object>
<packing>
<property name="position">1</property>
<property name="tab_fill">False</property>
</packing>
</child>
</object> </object>
<packing> <packing>
<property name="expand">False</property> <property name="expand">True</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">1</property> <property name="position">2</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -178,7 +246,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">2</property> <property name="position">3</property>
</packing> </packing>
</child> </child>
<child> <child>
@ -277,7 +345,7 @@
<packing> <packing>
<property name="expand">False</property> <property name="expand">False</property>
<property name="fill">True</property> <property name="fill">True</property>
<property name="position">3</property> <property name="position">4</property>
</packing> </packing>
</child> </child>
</object> </object>

View File

@ -1,30 +1,30 @@
ALPM_VALA_FLAGS = --pkg=libalpm \
--pkg=gio-2.0 \
--vapidir=../vapi \
-X -D_FILE_OFFSET_BITS=64
COMMON_VALA_FLAGS = -X -w \ COMMON_VALA_FLAGS = -X -w \
--pkg=libalpm \
--pkg=gio-2.0 \
--pkg=posix \ --pkg=posix \
--vapidir=./ \
--vapidir=../vapi \
-X -I../util \
-X -D_FILE_OFFSET_BITS=64 \
-X -DGETTEXT_PACKAGE="pamac" \ -X -DGETTEXT_PACKAGE="pamac" \
--target-glib=2.38 --target-glib=2.38
TRANSACTION_VALA_FLAGS = --pkg=json-glib-1.0 \ TRANSACTION_VALA_FLAGS = --pkg=gtk+-3.0 \
--pkg=libsoup-2.4 \
--pkg=gtk+-3.0 \
--pkg=gdk-3.0 \ --pkg=gdk-3.0 \
--pkg=vte-2.91 \ --pkg=vte-2.91 \
-X -lm -X -lm
COMMON_SOURCES = ../util/alpm-util.c \ PAMAC_LIB_FLAGS = -X -I. \
common.vala \ -X -L. \
pamac_config.vala \ -X -lpamac \
alpm_config.vala \ --vapidir=./ \
--pkg=pamac \
TRANSACTION_SOURCES = transaction.vala \ COMMON_SOURCES = common.vala \
alpm_utils.vala \ pamac_config.vala
aur.vala \
TRANSACTION_SOURCES = package.vala \
transaction.vala \
choose_provider_dialog.vala \ choose_provider_dialog.vala \
transaction_sum_dialog.vala \ transaction_sum_dialog.vala \
transaction_info_dialog.vala \ transaction_info_dialog.vala \
@ -42,7 +42,7 @@ UPDATER_GRESOURCE_FILE = ../resources/pamac.updater.gresource.xml
INSTALLER_GRESOURCE_FILE = ../resources/pamac.installer.gresource.xml INSTALLER_GRESOURCE_FILE = ../resources/pamac.installer.gresource.xml
binaries: pamac-refresh pamac-daemon pamac-tray libpamac.so pamac-updater pamac-manager pamac-install binaries: pamac-refresh pamac-daemon pamac-tray pamac-updater pamac-manager pamac-install
clean: clean:
rm -f *.c pamac.h pamac.vapi libpamac.so pamac-refresh pamac-daemon pamac-tray pamac-updater pamac-manager pamac-install rm -f *.c pamac.h pamac.vapi libpamac.so pamac-refresh pamac-daemon pamac-tray pamac-updater pamac-manager pamac-install
@ -55,7 +55,7 @@ pamac-refresh: pamac_config.vala refresh.vala
pamac_config.vala \ pamac_config.vala \
refresh.vala refresh.vala
pamac-tray: ../vapi/libalpm.vapi $(COMMON_SOURCES) tray.vala pamac-tray: $(COMMON_SOURCES) alpm_config.vala tray.vala
valac -o pamac-tray \ valac -o pamac-tray \
$(COMMON_VALA_FLAGS) \ $(COMMON_VALA_FLAGS) \
--pkg=gtk+-3.0 \ --pkg=gtk+-3.0 \
@ -63,20 +63,23 @@ pamac-tray: ../vapi/libalpm.vapi $(COMMON_SOURCES) tray.vala
$(COMMON_SOURCES) \ $(COMMON_SOURCES) \
tray.vala tray.vala
pamac-daemon: ../vapi/libalpm.vapi ../vapi/polkit-gobject-1.vapi ../vapi/libcurl.vapi $(COMMON_SOURCES) aur.vala mirrors_config.vala daemon.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 \ valac -o pamac-daemon \
$(COMMON_VALA_FLAGS) \ $(COMMON_VALA_FLAGS) \
$(ALPM_VALA_FLAGS) \
--pkg=polkit-gobject-1 \ --pkg=polkit-gobject-1 \
--pkg=libcurl \ --pkg=libcurl \
--pkg=json-glib-1.0 \ --pkg=json-glib-1.0 \
--pkg=libsoup-2.4 \ --pkg=libsoup-2.4 \
--thread \ --thread \
alpm_config.vala \
$(COMMON_SOURCES) \ $(COMMON_SOURCES) \
package.vala \
aur.vala \ aur.vala \
mirrors_config.vala \ mirrors_config.vala \
daemon.vala daemon.vala
libpamac.so: ../vapi/libalpm.vapi $(COMMON_SOURCES) $(TRANSACTION_SOURCES) $(PREFERENCES_SOURCES) ../resources/transaction_resources.c libpamac.so: $(COMMON_SOURCES) $(TRANSACTION_SOURCES) $(PREFERENCES_SOURCES) ../resources/transaction_resources.c
valac -o libpamac.so \ valac -o libpamac.so \
-X -fPIC \ -X -fPIC \
-X --shared \ -X --shared \
@ -91,33 +94,24 @@ libpamac.so: ../vapi/libalpm.vapi $(COMMON_SOURCES) $(TRANSACTION_SOURCES) $(PRE
$(TRANSACTION_SOURCES) \ $(TRANSACTION_SOURCES) \
$(PREFERENCES_SOURCES) $(PREFERENCES_SOURCES)
pamac-manager: libpamac.so choose_dep_dialog.vala history_dialog.vala transaction_info_dialog.vala ../resources/manager_resources.c ../util/alpm-util.c packages_model.vala aur_model.vala manager_window.vala manager.vala pamac-manager: libpamac.so choose_dep_dialog.vala history_dialog.vala transaction_info_dialog.vala ../resources/manager_resources.c manager_window.vala manager.vala
valac -o pamac-manager \ valac -o pamac-manager \
$(COMMON_VALA_FLAGS) \ $(COMMON_VALA_FLAGS) \
-X -I. \ $(PAMAC_LIB_FLAGS) \
-X -L. \
-X -lpamac \
--pkg=pamac \
--pkg=json-glib-1.0 \ --pkg=json-glib-1.0 \
--pkg=gtk+-3.0 \ --pkg=gtk+-3.0 \
--pkg=gdk-3.0 \ --pkg=gdk-3.0 \
--gresources=$(MANAGER_GRESOURCE_FILE) \ --gresources=$(MANAGER_GRESOURCE_FILE) \
../resources/manager_resources.c \ ../resources/manager_resources.c \
../util/alpm-util.c \
choose_dep_dialog.vala \ choose_dep_dialog.vala \
history_dialog.vala \ history_dialog.vala \
packages_model.vala \
aur_model.vala \
manager_window.vala \ manager_window.vala \
manager.vala manager.vala
pamac-updater: libpamac.so ../resources/updater_resources.c updater_window.vala updater.vala pamac-updater: libpamac.so ../resources/updater_resources.c updater_window.vala updater.vala
valac -o pamac-updater \ valac -o pamac-updater \
$(COMMON_VALA_FLAGS) \ $(COMMON_VALA_FLAGS) \
-X -I. \ $(PAMAC_LIB_FLAGS) \
-X -L. \
-X -lpamac \
--pkg=pamac \
--pkg=json-glib-1.0 \ --pkg=json-glib-1.0 \
--pkg=gtk+-3.0 \ --pkg=gtk+-3.0 \
--pkg=gdk-3.0 \ --pkg=gdk-3.0 \
@ -129,10 +123,7 @@ pamac-updater: libpamac.so ../resources/updater_resources.c updater_window.vala
pamac-install: libpamac.so installer.vala pamac-install: libpamac.so installer.vala
valac -o pamac-install \ valac -o pamac-install \
$(COMMON_VALA_FLAGS) \ $(COMMON_VALA_FLAGS) \
-X -I. \ $(PAMAC_LIB_FLAGS) \
-X -L. \
-X -lpamac \
--pkg=pamac \
--pkg=json-glib-1.0 \ --pkg=json-glib-1.0 \
--pkg=gtk+-3.0 \ --pkg=gtk+-3.0 \
installer.vala installer.vala

View File

@ -1,5 +1,5 @@
/* /*
* pamac-vala * alpm_config
* *
* Copyright (C) 2014-2016 Guillaume Benoit <guillaume@manjaro.org> * Copyright (C) 2014-2016 Guillaume Benoit <guillaume@manjaro.org>
* *
@ -18,7 +18,7 @@
*/ */
[Compact] [Compact]
public class AlpmRepo { class AlpmRepo {
public string name; public string name;
public Alpm.Signature.Level siglevel; public Alpm.Signature.Level siglevel;
public Alpm.Signature.Level siglevel_mask; public Alpm.Signature.Level siglevel_mask;
@ -42,68 +42,55 @@ public class AlpmRepo {
} }
[Compact] class AlpmConfig {
public class AlpmConfig { string conf_path;
public string conf_path; string? rootdir;
public string? rootdir; string? dbpath;
public string? dbpath; string? logfile;
public string? logfile; string? gpgdir;
public string? gpgdir; string? arch;
public string? arch; double deltaratio;
public double deltaratio; int usesyslog;
public int usesyslog; int checkspace;
public int checkspace; GLib.List<string> cachedirs;
public Alpm.List<string?>? cachedirs; GLib.List<string> hookdirs;
public Alpm.List<string?>? hookdirs; GLib.List<string> ignoregroups;
public Alpm.List<string?>? ignoregroups; GLib.List<string> ignorepkgs;
public Alpm.List<string?>? ignorepkgs; GLib.List<string> noextracts;
public Alpm.List<string?>? noextracts; GLib.List<string> noupgrades;
public Alpm.List<string?>? noupgrades; GLib.List<string> holdpkgs;
public GLib.List<string>? holdpkgs; GLib.List<string> syncfirsts;
public GLib.List<string>? syncfirsts; Alpm.Signature.Level siglevel;
public Alpm.Signature.Level siglevel; Alpm.Signature.Level localfilesiglevel;
public Alpm.Signature.Level localfilesiglevel; Alpm.Signature.Level remotefilesiglevel;
public Alpm.Signature.Level remotefilesiglevel; Alpm.Signature.Level siglevel_mask;
public Alpm.Signature.Level siglevel_mask; Alpm.Signature.Level localfilesiglevel_mask;
public Alpm.Signature.Level localfilesiglevel_mask; Alpm.Signature.Level remotefilesiglevel_mask;
public Alpm.Signature.Level remotefilesiglevel_mask; GLib.List<AlpmRepo> repo_order;
public GLib.List<AlpmRepo> repo_order;
public Alpm.Handle? handle;
public AlpmConfig (string path) { public AlpmConfig (string path) {
conf_path = path; conf_path = path;
reload (); reload ();
} }
public unowned GLib.List<string> get_holdpkgs () {
return holdpkgs;
}
public unowned GLib.List<string> get_syncfirsts () {
return syncfirsts;
}
public void reload () { public void reload () {
// set default options // set default options
cachedirs = new GLib.List<string> ();
hookdirs = new GLib.List<string> ();
ignoregroups = new GLib.List<string> ();
ignorepkgs = new GLib.List<string> ();
noextracts = new GLib.List<string> ();
noupgrades = new GLib.List<string> ();
holdpkgs = new GLib.List<string> (); holdpkgs = new GLib.List<string> ();
syncfirsts = new GLib.List<string> (); syncfirsts = new GLib.List<string> ();
// free internal data of alpm lists
if (cachedirs != null) {
cachedirs.free_data ();
cachedirs = new Alpm.List<string> ();
}
if (hookdirs != null) {
hookdirs.free_data ();
hookdirs = new Alpm.List<string?> ();
}
if (ignoregroups != null) {
ignoregroups.free_data ();
ignoregroups = new Alpm.List<string> ();
}
if (ignorepkgs != null) {
ignorepkgs.free_data ();
ignorepkgs = new Alpm.List<string> ();
}
if (noextracts != null) {
noextracts.free_data ();
noextracts = new Alpm.List<string> ();
}
if (noupgrades != null) {
noupgrades.free_data ();
noupgrades = new Alpm.List<string> ();
}
usesyslog = 0; usesyslog = 0;
checkspace = 0; checkspace = 0;
deltaratio = 0.7; deltaratio = 0.7;
@ -131,11 +118,11 @@ public class AlpmConfig {
logfile = "/var/log/pacman.log"; logfile = "/var/log/pacman.log";
} }
} }
if (cachedirs.length == 0) { if (cachedirs.length () == 0) {
cachedirs.add ("/var/cache/pacman/pkg/"); cachedirs.append ("/var/cache/pacman/pkg/");
} }
if (hookdirs.length == 0) { if (hookdirs.length () == 0) {
hookdirs.add ("/etc/pacman.d/hooks/"); hookdirs.append ("/etc/pacman.d/hooks/");
} }
if (gpgdir == null) { if (gpgdir == null) {
// gpgdir it is not relative to rootdir, even if // gpgdir it is not relative to rootdir, even if
@ -147,12 +134,12 @@ public class AlpmConfig {
} }
} }
public void set_handle () { public Alpm.Handle? get_handle () {
Alpm.Errno error; Alpm.Errno error;
handle = Alpm.Handle.new (rootdir, dbpath, out error); Alpm.Handle? handle = new Alpm.Handle (rootdir, dbpath, out error);
if (handle == null) { if (handle == null) {
stderr.printf ("Failed to initialize alpm library" + " (%s)\n".printf(Alpm.strerror (error))); stderr.printf ("Failed to initialize alpm library" + " (%s)\n".printf (Alpm.strerror (error)));
return; return null;
} }
// define options // define options
handle.logfile = logfile; handle.logfile = logfile;
@ -166,15 +153,24 @@ public class AlpmConfig {
remotefilesiglevel = merge_siglevel (siglevel, remotefilesiglevel, remotefilesiglevel_mask); remotefilesiglevel = merge_siglevel (siglevel, remotefilesiglevel, remotefilesiglevel_mask);
handle.localfilesiglevel = localfilesiglevel; handle.localfilesiglevel = localfilesiglevel;
handle.remotefilesiglevel = remotefilesiglevel; handle.remotefilesiglevel = remotefilesiglevel;
handle.cachedirs = cachedirs; foreach (unowned string cachedir in cachedirs) {
// add hook directories 1-by-1 to avoid overwriting the system directory handle.add_cachedir (cachedir);
}
foreach (unowned string hookdir in hookdirs) { foreach (unowned string hookdir in hookdirs) {
handle.add_hookdir (hookdir); handle.add_hookdir (hookdir);
} }
handle.ignoregroups = ignoregroups; foreach (unowned string ignoregroup in ignoregroups) {
handle.ignorepkgs = ignorepkgs; handle.add_ignoregroup (ignoregroup);
handle.noextracts = noextracts; }
handle.noupgrades = noupgrades; foreach (unowned string ignorepkg in ignorepkgs) {
handle.add_ignorepkg (ignorepkg);
}
foreach (unowned string noextract in noextracts) {
handle.add_noextract (noextract);
}
foreach (unowned string noupgrade in noupgrades) {
handle.add_noupgrade (noupgrade);
}
// register dbs // register dbs
foreach (unowned AlpmRepo repo in repo_order) { foreach (unowned AlpmRepo repo in repo_order) {
repo.siglevel = merge_siglevel (siglevel, repo.siglevel, repo.siglevel_mask); repo.siglevel = merge_siglevel (siglevel, repo.siglevel, repo.siglevel_mask);
@ -188,9 +184,10 @@ public class AlpmConfig {
db.usage = repo.usage; db.usage = repo.usage;
} }
} }
return handle;
} }
public void parse_file (string path, string? section = null) { void parse_file (string path, string? section = null) {
string? current_section = section; string? current_section = section;
var file = GLib.File.new_for_path (path); var file = GLib.File.new_for_path (path);
if (file.query_exists ()) { if (file.query_exists ()) {
@ -236,11 +233,11 @@ public class AlpmConfig {
dbpath = val; dbpath = val;
} else if (key == "CacheDir") { } else if (key == "CacheDir") {
foreach (unowned string dir in val.split (" ")) { foreach (unowned string dir in val.split (" ")) {
cachedirs.add (dir); cachedirs.append (dir);
} }
} else if (key == "HookDir") { } else if (key == "HookDir") {
foreach (unowned string dir in val.split (" ")) { foreach (unowned string dir in val.split (" ")) {
hookdirs.add (dir); hookdirs.append (dir);
} }
} else if (key == "LogFile") { } else if (key == "LogFile") {
logfile = val; logfile = val;
@ -276,19 +273,19 @@ public class AlpmConfig {
} }
} else if (key == "IgnoreGroup") { } else if (key == "IgnoreGroup") {
foreach (unowned string name in val.split (" ")) { foreach (unowned string name in val.split (" ")) {
ignoregroups.add (name); ignoregroups.append (name);
} }
} else if (key == "IgnorePkg") { } else if (key == "IgnorePkg") {
foreach (unowned string name in val.split (" ")) { foreach (unowned string name in val.split (" ")) {
ignorepkgs.add (name); ignorepkgs.append (name);
} }
} else if (key == "Noextract") { } else if (key == "Noextract") {
foreach (unowned string name in val.split (" ")) { foreach (unowned string name in val.split (" ")) {
noextracts.add (name); noextracts.append (name);
} }
} else if (key == "NoUpgrade") { } else if (key == "NoUpgrade") {
foreach (unowned string name in val.split (" ")) { foreach (unowned string name in val.split (" ")) {
noupgrades.add (name); noupgrades.append (name);
} }
} }
} else { } else {
@ -364,6 +361,7 @@ public class AlpmConfig {
// writing a short string to the stream // writing a short string to the stream
dos.put_string (new_line); dos.put_string (new_line);
} }
reload ();
} catch (GLib.Error e) { } catch (GLib.Error e) {
GLib.stderr.printf("%s\n", e.message); GLib.stderr.printf("%s\n", e.message);
} }
@ -372,7 +370,7 @@ public class AlpmConfig {
} }
} }
public Alpm.DB.Usage define_usage (string conf_string) { Alpm.DB.Usage define_usage (string conf_string) {
Alpm.DB.Usage usage = 0; Alpm.DB.Usage usage = 0;
foreach (unowned string directive in conf_string.split(" ")) { foreach (unowned string directive in conf_string.split(" ")) {
if (directive == "Sync") { if (directive == "Sync") {
@ -390,7 +388,7 @@ public class AlpmConfig {
return usage; return usage;
} }
public void process_siglevel (string conf_string, ref Alpm.Signature.Level siglevel, ref Alpm.Signature.Level siglevel_mask) { void process_siglevel (string conf_string, ref Alpm.Signature.Level siglevel, ref Alpm.Signature.Level siglevel_mask) {
foreach (unowned string directive in conf_string.split(" ")) { foreach (unowned string directive in conf_string.split(" ")) {
bool affect_package = false; bool affect_package = false;
bool affect_database = false; bool affect_database = false;
@ -458,7 +456,7 @@ public class AlpmConfig {
siglevel &= ~Alpm.Signature.Level.USE_DEFAULT; siglevel &= ~Alpm.Signature.Level.USE_DEFAULT;
} }
public Alpm.Signature.Level merge_siglevel(Alpm.Signature.Level sigbase, Alpm.Signature.Level sigover, Alpm.Signature.Level sigmask) { Alpm.Signature.Level merge_siglevel(Alpm.Signature.Level sigbase, Alpm.Signature.Level sigover, Alpm.Signature.Level sigmask) {
return (sigmask != 0) ? (sigover & sigmask) | (sigbase & ~sigmask) : sigover; return (sigmask != 0) ? (sigover & sigmask) | (sigbase & ~sigmask) : sigover;
} }
} }

View File

@ -25,107 +25,66 @@ namespace AUR {
const string rpc_multiinfo = "&type=info"; const string rpc_multiinfo = "&type=info";
const string rpc_multiinfo_arg = "&arg[]="; const string rpc_multiinfo_arg = "&arg[]=";
public Json.Array search (string[] needles) { Json.Array rpc_query (string uri) {
var prev_inter = new Json.Array (); var results = new Json.Array ();
string uri = rpc_url + rpc_search + Uri.escape_string (needles[0]);
var session = new Soup.Session (); var session = new Soup.Session ();
// set a 15 seconds timeout because it is also the dbus daemon timeout
session.timeout = 15;
var message = new Soup.Message ("GET", uri); var message = new Soup.Message ("GET", uri);
var parser = new Json.Parser (); var parser = new Json.Parser ();
session.send_message (message); session.send_message (message);
try { try {
parser.load_from_data ((string) message.response_body.flatten ().data, -1); parser.load_from_data ((string) message.response_body.flatten ().data, -1);
} catch (Error e) { } catch (Error e) {
print (e.message); critical (e.message);
} }
unowned Json.Node? root = parser.get_root (); unowned Json.Node? root = parser.get_root ();
if (root != null) { if (root != null) {
if (root.get_object ().get_string_member ("type") == "error") { if (root.get_object ().get_string_member ("type") == "error") {
stderr.printf ("Failed to search %s from AUR\n", needles[0]); critical ("Failed to query %s from AUR", uri);
} else {
prev_inter = root.get_object ().get_array_member ("results");
}
}
int needles_length = needles.length;
if (needles_length == 1) {
return prev_inter;
}
int i = 1;
var inter = new Json.Array ();
var found = new Json.Array ();
while (i < needles_length) {
inter = new Json.Array ();
uri = rpc_url + rpc_search + Uri.escape_string (needles[i]);
message = new Soup.Message ("GET", uri);
session.send_message (message);
try {
parser.load_from_data ((string) message.response_body.flatten ().data, -1);
} catch (Error e) {
print (e.message);
}
root = parser.get_root ();
if (root != null) {
if (root.get_object ().get_string_member ("type") == "error") {
stderr.printf ("Failed to search %s from AUR\n", needles[i]);
} else {
found = root.get_object ().get_array_member ("results");
uint j = 0;
uint k;
uint found_length = found.get_length ();
while (j < found_length) {
unowned Json.Node found_node = found.get_element (j);
k = 0;
uint prev_inter_length = prev_inter.get_length ();
while (k < prev_inter_length) {
unowned Json.Node prev_inter_node = prev_inter.get_element (k);
if (strcmp (found_node.get_object ().get_string_member ("Name"),
prev_inter_node.get_object ().get_string_member ("Name")) == 0) {
inter.add_element (prev_inter_node);
prev_inter.remove_element (k);
break;
}
k++;
}
j++;
}
}
}
if (i != (needles_length -1)) {
prev_inter = inter;
}
i++;
}
return inter;
}
public Json.Array multiinfo (string[] pkgnames) {
Json.Array results = new Json.Array ();
if (pkgnames.length == 0) {
return results;
}
var builder = new StringBuilder ();
builder.append (rpc_url);
builder.append (rpc_multiinfo);
foreach (string pkgname in pkgnames) {
builder.append (rpc_multiinfo_arg);
builder.append (Uri.escape_string (pkgname));
}
var session = new Soup.Session ();
var message = new Soup.Message ("GET", builder.str);
session.send_message (message);
var parser = new Json.Parser ();
try {
parser.load_from_data ((string) message.response_body.flatten ().data, -1);
} catch (Error e) {
print (e.message);
}
unowned Json.Node? root = parser.get_root ();
if (root != null) {
if (root.get_object ().get_string_member ("type") == "error") {
stderr.printf ("Failed to multiinfo %s from AUR\n", builder.str);
} else { } else {
results = root.get_object ().get_array_member ("results"); results = root.get_object ().get_array_member ("results");
} }
} }
return results; return results;
} }
public async Json.Array search (string[] needles) {
if (needles.length == 0) {
return new Json.Array ();
} else if (needles.length == 1) {
return rpc_query (rpc_url + rpc_search + Uri.escape_string (needles[0]));
} else {
var inter = new Json.Array ();
var prev_inter = new Json.Array ();
foreach (unowned string needle in needles) {
inter = new Json.Array ();
var found = rpc_query (rpc_url + rpc_search + Uri.escape_string (needle));
prev_inter.foreach_element ((prev_inter_array, prev_inter_index, prev_inter_node) => {
found.foreach_element ((found_array, found_index, found_node) => {
if (strcmp (prev_inter_node.get_object ().get_string_member ("Name"),
found_node.get_object ().get_string_member ("Name")) == 0) {
inter.add_element (prev_inter_node);
}
});
});
prev_inter = (owned) inter;
}
return inter;
}
}
public async Json.Array multiinfo (string[] pkgnames) {
if (pkgnames.length == 0) {
return new Json.Array ();
}
var builder = new StringBuilder ();
builder.append (rpc_url);
builder.append (rpc_multiinfo);
foreach (unowned string pkgname in pkgnames) {
builder.append (rpc_multiinfo_arg);
builder.append (Uri.escape_string (pkgname));
}
return rpc_query (builder.str);
}
} }

View File

@ -32,17 +32,17 @@ namespace Pamac {
public ChooseDependenciesDialog (Gtk.ApplicationWindow? window) { public ChooseDependenciesDialog (Gtk.ApplicationWindow? window) {
Object (transient_for: window, use_header_bar: 0); Object (transient_for: window, use_header_bar: 0);
deps_list = new Gtk.ListStore (3, typeof (bool), typeof (string), typeof (string)); deps_list = new Gtk.ListStore (2, typeof (bool), typeof (string));
treeview.set_model (deps_list); treeview.set_model (deps_list);
} }
[GtkCallback] [GtkCallback]
void on_renderertoggle_toggled (string path) { void on_renderertoggle_toggled (string path) {
Gtk.TreeIter iter; Gtk.TreeIter iter;
GLib.Value selected; bool selected;
if (deps_list.get_iter_from_string (out iter, path)) {; if (deps_list.get_iter_from_string (out iter, path)) {;
deps_list.get_value (iter, 0, out selected); deps_list.get (iter, 0, out selected);
deps_list.set_value (iter, 0, !((bool) selected)); deps_list.set (iter, 0, !selected);
} }
} }
} }

View File

@ -18,17 +18,26 @@
*/ */
namespace Pamac { namespace Pamac {
public struct PackageInfos { public struct UpdateInfos {
public string name; public string name;
public string version; public string old_version;
public string db_name; public string new_version;
public string repo;
public uint64 download_size; public uint64 download_size;
} }
public struct TransactionSummary {
public UpdateInfos[] to_install;
public UpdateInfos[] to_upgrade;
public UpdateInfos[] to_downgrade;
public UpdateInfos[] to_reinstall;
public UpdateInfos[] to_remove;
}
public struct Updates { public struct Updates {
public bool is_syncfirst; public bool is_syncfirst;
public PackageInfos[] repos_updates; public UpdateInfos[] repos_updates;
public PackageInfos[] aur_updates; public UpdateInfos[] aur_updates;
} }
public struct ErrorInfos { public struct ErrorInfos {

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -18,13 +18,32 @@
*/ */
namespace Pamac { namespace Pamac {
[Compact] class MirrorsConfig {
public class MirrorsConfig { string conf_path;
public string conf_path; GLib.List<string> _countrys ;
public string mirrorlists_dir;
public string choosen_generation_method;
public string choosen_country; public string mirrorlists_dir { get; private set; }
public GLib.List<string> countrys; public string choosen_generation_method { get; private set; }
public string choosen_country { get; private set; }
public unowned GLib.List<string> countrys {
get {
try {
var directory = GLib.File.new_for_path (mirrorlists_dir);
var enumerator = directory.enumerate_children (FileAttribute.STANDARD_NAME, 0);
FileInfo file_info;
_countrys = new GLib.List<string> ();
while ((file_info = enumerator.next_file ()) != null) {
_countrys.append(file_info.get_name ());
}
_countrys.sort (strcmp);
} catch (Error e) {
stderr.printf ("%s\n", e.message);
}
return _countrys;
}
}
public MirrorsConfig (string path) { public MirrorsConfig (string path) {
conf_path = path; conf_path = path;
@ -39,22 +58,7 @@ namespace Pamac {
parse_file (conf_path); parse_file (conf_path);
} }
public void get_countrys () { void parse_file (string path) {
try {
var directory = GLib.File.new_for_path (mirrorlists_dir);
var enumerator = directory.enumerate_children (FileAttribute.STANDARD_NAME, 0);
FileInfo file_info;
countrys = new GLib.List<string> ();
while ((file_info = enumerator.next_file ()) != null) {
countrys.append(file_info.get_name ());
}
countrys.sort (strcmp);
} catch (Error e) {
stderr.printf ("%s\n", e.message);
}
}
public void parse_file (string path) {
var file = GLib.File.new_for_path (path); var file = GLib.File.new_for_path (path);
if (file.query_exists ()) { if (file.query_exists ()) {
try { try {

82
src/package.vala Normal file
View File

@ -0,0 +1,82 @@
/*
* pamac-vala
*
* Copyright (C) 2014-2016 Guillaume Benoit <guillaume@manjaro.org>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a get of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
namespace Pamac {
public struct AlpmPackage {
public string name;
public string version;
public string desc;
public string repo;
public uint64 size;
public uint origin;
}
public struct AlpmPackageDetails {
public string name;
public string version;
public string desc;
public string repo;
public string url;
public string packager;
public string builddate;
public string installdate;
public string reason;
public string has_signature;
public string[] licenses;
public string[] depends;
public string[] optdepends;
public string[] requiredby;
public string[] optionalfor;
public string[] provides;
public string[] replaces;
public string[] conflicts;
public string[] groups;
public string[] backups;
public string[] files;
}
public struct AURPackage {
public string name;
public string version;
public string desc;
public double popularity;
}
public struct AURPackageDetails {
public string name;
public string version;
public string desc;
public double popularity;
public string packagebase;
public string url;
public string maintainer;
public int64 firstsubmitted;
public int64 lastmodified;
public int64 outofdate;
public int64 numvotes;
public string[] licenses;
public string[] depends;
public string[] makedepends;
public string[] checkdepends;
public string[] optdepends;
public string[] provides;
public string[] replaces;
public string[] conflicts;
}
}

View File

@ -18,43 +18,48 @@
*/ */
namespace Pamac { namespace Pamac {
[Compact] class Config {
public class Config { string conf_path;
public string conf_path; HashTable<string,string> _environment_variables;
public bool recurse;
public uint64 refresh_period; public bool recurse { get; private set; }
public bool no_update_hide_icon; public uint64 refresh_period { get; private set; }
public bool enable_aur; public bool no_update_hide_icon { get; private set; }
public bool search_aur; public bool enable_aur { get; private set; }
public bool check_aur_updates; public bool search_aur { get; private set; }
public bool no_confirm_build; public bool check_aur_updates { get; private set; }
public HashTable<string,string> environment_variables; public bool no_confirm_build { get; private set; }
public unowned HashTable<string,string> environment_variables {
get {
return _environment_variables;
}
}
public Config (string path) { public Config (string path) {
conf_path = path; conf_path = path;
//get environment variables //get environment variables
environment_variables = new HashTable<string,string> (str_hash, str_equal); _environment_variables = new HashTable<string,string> (str_hash, str_equal);
var utsname = Posix.utsname(); var utsname = Posix.utsname();
environment_variables.insert ("HTTP_USER_AGENT", "pamac (%s %s)".printf (utsname.sysname, utsname.machine)); _environment_variables.insert ("HTTP_USER_AGENT", "pamac (%s %s)".printf (utsname.sysname, utsname.machine));
unowned string? variable = Environment.get_variable ("http_proxy"); unowned string? variable = Environment.get_variable ("http_proxy");
if (variable != null) { if (variable != null) {
environment_variables.insert ("http_proxy", variable); _environment_variables.insert ("http_proxy", variable);
} }
variable = Environment.get_variable ("https_proxy"); variable = Environment.get_variable ("https_proxy");
if (variable != null) { if (variable != null) {
environment_variables.insert ("https_proxy", variable); _environment_variables.insert ("https_proxy", variable);
} }
variable = Environment.get_variable ("ftp_proxy"); variable = Environment.get_variable ("ftp_proxy");
if (variable != null) { if (variable != null) {
environment_variables.insert ("ftp_proxy", variable); _environment_variables.insert ("ftp_proxy", variable);
} }
variable = Environment.get_variable ("socks_proxy"); variable = Environment.get_variable ("socks_proxy");
if (variable != null) { if (variable != null) {
environment_variables.insert ("socks_proxy", variable); _environment_variables.insert ("socks_proxy", variable);
} }
variable = Environment.get_variable ("no_proxy"); variable = Environment.get_variable ("no_proxy");
if (variable != null) { if (variable != null) {
environment_variables.insert ("no_proxy", variable); _environment_variables.insert ("no_proxy", variable);
} }
// set default option // set default option
refresh_period = 6; refresh_period = 6;
@ -72,7 +77,7 @@ namespace Pamac {
parse_file (conf_path); parse_file (conf_path);
} }
public void parse_file (string path) { void parse_file (string path) {
var file = GLib.File.new_for_path (path); var file = GLib.File.new_for_path (path);
if (file.query_exists ()) { if (file.query_exists ()) {
try { try {

View File

@ -37,8 +37,6 @@ namespace Pamac {
[GtkChild] [GtkChild]
Gtk.Box ignorepkgs_box; Gtk.Box ignorepkgs_box;
[GtkChild] [GtkChild]
Gtk.ListStore ignorepkgs_liststore;
[GtkChild]
Gtk.TreeView ignorepkgs_treeview; Gtk.TreeView ignorepkgs_treeview;
[GtkChild] [GtkChild]
Gtk.Box mirrors_config_box; Gtk.Box mirrors_config_box;
@ -59,6 +57,7 @@ namespace Pamac {
[GtkChild] [GtkChild]
Gtk.CheckButton no_confirm_build_checkbutton; Gtk.CheckButton no_confirm_build_checkbutton;
Gtk.ListStore ignorepkgs_liststore;
Transaction transaction; Transaction transaction;
uint64 previous_refresh_period; uint64 previous_refresh_period;
@ -67,9 +66,9 @@ namespace Pamac {
this.transaction = transaction; this.transaction = transaction;
refresh_period_label.set_markup (dgettext (null, "How often to check for updates, value in hours") +":"); refresh_period_label.set_markup (dgettext (null, "How often to check for updates, value in hours") +":");
remove_unrequired_deps_button.active = transaction.pamac_config.recurse; remove_unrequired_deps_button.active = transaction.recurse;
check_space_button.active = (transaction.alpm_utils.get_checkspace () == 1); check_space_button.active = transaction.get_checkspace ();
if (transaction.pamac_config.refresh_period == 0) { if (transaction.refresh_period == 0) {
check_updates_button.active = false; check_updates_button.active = false;
refresh_period_label.sensitive = false; refresh_period_label.sensitive = false;
// set default value // set default value
@ -80,15 +79,16 @@ namespace Pamac {
ignorepkgs_box.sensitive = false; ignorepkgs_box.sensitive = false;
} else { } else {
check_updates_button.active = true; check_updates_button.active = true;
refresh_period_spin_button.value = transaction.pamac_config.refresh_period; refresh_period_spin_button.value = transaction.refresh_period;
previous_refresh_period = transaction.pamac_config.refresh_period; previous_refresh_period = transaction.refresh_period;
} }
no_update_hide_icon_checkbutton.active = transaction.pamac_config.no_update_hide_icon; no_update_hide_icon_checkbutton.active = transaction.no_update_hide_icon;
// populate ignorepkgs_liststore // populate ignorepkgs_liststore
Gtk.TreeIter iter; ignorepkgs_liststore = new Gtk.ListStore (1, typeof (string));
foreach (unowned string ignorepkg in transaction.alpm_utils.get_ignorepkgs ()) { ignorepkgs_treeview.set_model (ignorepkgs_liststore);
ignorepkgs_liststore.insert_with_values (out iter, -1, 0, ignorepkg); foreach (unowned string ignorepkg in transaction.get_ignorepkgs ()) {
ignorepkgs_liststore.insert_with_values (null, -1, 0, ignorepkg);
} }
remove_unrequired_deps_button.state_set.connect (on_remove_unrequired_deps_button_state_set); remove_unrequired_deps_button.state_set.connect (on_remove_unrequired_deps_button_state_set);
check_space_button.state_set.connect (on_check_space_button_state_set); check_space_button.state_set.connect (on_check_space_button_state_set);
@ -98,15 +98,14 @@ namespace Pamac {
no_update_hide_icon_checkbutton.toggled.connect (on_no_update_hide_icon_checkbutton_toggled); no_update_hide_icon_checkbutton.toggled.connect (on_no_update_hide_icon_checkbutton_toggled);
transaction.write_pamac_config_finished.connect (on_write_pamac_config_finished); transaction.write_pamac_config_finished.connect (on_write_pamac_config_finished);
unowned Alpm.Package? pkg = Alpm.find_satisfier (transaction.alpm_utils.get_installed_pkgs (), "pacman-mirrorlist"); AlpmPackage pkg = transaction.find_installed_satisfier ("pacman-mirrorlist");
if (pkg == null) { if (pkg.name == "") {
mirrors_config_box.visible = false; mirrors_config_box.visible = false;
} else { } else {
var mirrors_config = new MirrorsConfig ("/etc/pacman-mirrors.conf"); var mirrors_config = new MirrorsConfig ("/etc/pacman-mirrors.conf");
mirrors_country_comboboxtext.append_text (dgettext (null, "Worldwide")); mirrors_country_comboboxtext.append_text (dgettext (null, "Worldwide"));
mirrors_country_comboboxtext.active = 0; mirrors_country_comboboxtext.active = 0;
int index = 1; int index = 1;
mirrors_config.get_countrys ();
foreach (unowned string country in mirrors_config.countrys) { foreach (unowned string country in mirrors_config.countrys) {
mirrors_country_comboboxtext.append_text (country); mirrors_country_comboboxtext.append_text (country);
if (country == mirrors_config.choosen_country) { if (country == mirrors_config.choosen_country) {
@ -126,17 +125,17 @@ namespace Pamac {
transaction.write_mirrors_config_finished.connect (on_write_mirrors_config_finished); transaction.write_mirrors_config_finished.connect (on_write_mirrors_config_finished);
} }
pkg = Alpm.find_satisfier (transaction.alpm_utils.get_installed_pkgs (), "yaourt"); pkg = transaction.find_installed_satisfier ("yaourt");
if (pkg == null) { if (pkg.name == "") {
aur_config_box.visible = false; aur_config_box.visible = false;
} else { } else {
enable_aur_button.active = transaction.pamac_config.enable_aur; enable_aur_button.active = transaction.enable_aur;
search_aur_checkbutton.active = transaction.pamac_config.search_aur; search_aur_checkbutton.active = transaction.search_aur;
search_aur_checkbutton.sensitive = transaction.pamac_config.enable_aur; search_aur_checkbutton.sensitive = transaction.enable_aur;
check_aur_updates_checkbutton.active = transaction.pamac_config.check_aur_updates; check_aur_updates_checkbutton.active = transaction.check_aur_updates;
check_aur_updates_checkbutton.sensitive = transaction.pamac_config.enable_aur; check_aur_updates_checkbutton.sensitive = transaction.enable_aur;
no_confirm_build_checkbutton.active = transaction.pamac_config.no_confirm_build; no_confirm_build_checkbutton.active = transaction.no_confirm_build;
no_confirm_build_checkbutton.sensitive = transaction.pamac_config.enable_aur; no_confirm_build_checkbutton.sensitive = transaction.enable_aur;
enable_aur_button.state_set.connect (on_enable_aur_button_state_set); enable_aur_button.state_set.connect (on_enable_aur_button_state_set);
search_aur_checkbutton.toggled.connect (on_search_aur_checkbutton_toggled); search_aur_checkbutton.toggled.connect (on_search_aur_checkbutton_toggled);
check_aur_updates_checkbutton.toggled.connect (on_check_aur_updates_checkbutton_toggled); check_aur_updates_checkbutton.toggled.connect (on_check_aur_updates_checkbutton_toggled);
@ -248,40 +247,45 @@ namespace Pamac {
[GtkCallback] [GtkCallback]
void on_add_ignorepkgs_button_clicked () { void on_add_ignorepkgs_button_clicked () {
var choose_ignorepkgs_dialog = new ChooseIgnorepkgsDialog (this); var choose_ignorepkgs_dialog = new ChooseIgnorepkgsDialog (this);
foreach (var pkg in transaction.alpm_utils.get_installed_pkgs ()) { this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH));
Gtk.TreeIter iter; while (Gtk.events_pending ()) {
if (transaction.alpm_utils.get_ignorepkgs ().find_str (pkg.name) == null) { Gtk.main_iteration ();
choose_ignorepkgs_dialog.pkgs_list.insert_with_values (out iter, -1, 0, false, 1, pkg.name);
} else {
choose_ignorepkgs_dialog.pkgs_list.insert_with_values (out iter, -1, 0, true, 1, pkg.name);
}
} }
if (choose_ignorepkgs_dialog.run () == Gtk.ResponseType.OK) { transaction.get_installed_pkgs.begin ((obj, res) => {
var ignorepkg_string = new StringBuilder (); var pkgs = transaction.get_installed_pkgs.end (res);
choose_ignorepkgs_dialog.pkgs_list.foreach ((model, path, iter) => { foreach (unowned AlpmPackage pkg in pkgs) {
GLib.Value val; if (pkg.name in transaction.get_ignorepkgs ()) {
// get value at column 0 to know if it is selected choose_ignorepkgs_dialog.pkgs_list.insert_with_values (null, -1, 0, true, 1, pkg.name);
choose_ignorepkgs_dialog.pkgs_list.get_value (iter, 0, out val); } else {
if ((bool) val) { choose_ignorepkgs_dialog.pkgs_list.insert_with_values (null, -1, 0, false, 1, pkg.name);
// get value at column 1 to get the pkg name
choose_ignorepkgs_dialog.pkgs_list.get_value (iter, 1, out val);
if (ignorepkg_string.len != 0) {
ignorepkg_string.append (" ");
}
ignorepkg_string.append ((string) val);
} }
return false; }
}); this.get_window ().set_cursor (null);
if (ignorepkg_string.len != 0) { if (choose_ignorepkgs_dialog.run () == Gtk.ResponseType.OK) {
var ignorepkg_string = new StringBuilder ();
choose_ignorepkgs_dialog.pkgs_list.foreach ((model, path, iter) => {
GLib.Value val;
// get value at column 0 to know if it is selected
model.get_value (iter, 0, out val);
if ((bool) val) {
// get value at column 1 to get the pkg name
model.get_value (iter, 1, out val);
if (ignorepkg_string.len != 0) {
ignorepkg_string.append (" ");
}
ignorepkg_string.append ((string) val);
}
return false;
});
var new_alpm_conf = new HashTable<string,Variant> (str_hash, str_equal); var new_alpm_conf = new HashTable<string,Variant> (str_hash, str_equal);
new_alpm_conf.insert ("IgnorePkg", new Variant.string (ignorepkg_string.str)); new_alpm_conf.insert ("IgnorePkg", new Variant.string (ignorepkg_string.str));
transaction.start_write_alpm_config (new_alpm_conf); transaction.start_write_alpm_config (new_alpm_conf);
} }
} choose_ignorepkgs_dialog.destroy ();
choose_ignorepkgs_dialog.destroy (); while (Gtk.events_pending ()) {
while (Gtk.events_pending ()) { Gtk.main_iteration ();
Gtk.main_iteration (); }
} });
} }
[GtkCallback] [GtkCallback]
@ -293,7 +297,7 @@ namespace Pamac {
var ignorepkg_string = new StringBuilder (); var ignorepkg_string = new StringBuilder ();
ignorepkgs_liststore.foreach ((model, path, iter) => { ignorepkgs_liststore.foreach ((model, path, iter) => {
GLib.Value name; GLib.Value name;
ignorepkgs_liststore.get_value (iter, 0, out name); model.get_value (iter, 0, out name);
if (ignorepkg_string.len != 0) { if (ignorepkg_string.len != 0) {
ignorepkg_string.append (" "); ignorepkg_string.append (" ");
} }
@ -303,16 +307,15 @@ namespace Pamac {
var new_alpm_conf = new HashTable<string,Variant> (str_hash, str_equal); var new_alpm_conf = new HashTable<string,Variant> (str_hash, str_equal);
new_alpm_conf.insert ("IgnorePkg", new Variant.string (ignorepkg_string.str)); new_alpm_conf.insert ("IgnorePkg", new Variant.string (ignorepkg_string.str));
transaction.start_write_alpm_config (new_alpm_conf); transaction.start_write_alpm_config (new_alpm_conf);
} }
} }
void on_write_alpm_config_finished (bool checkspace) { void on_write_alpm_config_finished (bool checkspace) {
check_space_button.state = checkspace; check_space_button.state = checkspace;
// re-populate ignorepkgs_liststore
Gtk.TreeIter iter;
ignorepkgs_liststore.clear (); ignorepkgs_liststore.clear ();
foreach (unowned string ignorepkg in transaction.alpm_utils.get_ignorepkgs ()) { foreach (unowned string ignorepkg in transaction.get_ignorepkgs ()) {
ignorepkgs_liststore.insert_with_values (out iter, -1, 0, ignorepkg); ignorepkgs_liststore.insert_with_values (null, -1, 0, ignorepkg);
} }
} }

File diff suppressed because it is too large Load Diff

View File

@ -34,7 +34,7 @@ namespace Pamac {
public TransactionSumDialog (Gtk.ApplicationWindow? window) { public TransactionSumDialog (Gtk.ApplicationWindow? window) {
Object (transient_for: window, use_header_bar: 0); Object (transient_for: window, use_header_bar: 0);
sum_list = new Gtk.ListStore (2, typeof (string), typeof (string)); sum_list = new Gtk.ListStore (4, typeof (string), typeof (string), typeof (string), typeof (string));
treeview.set_model (sum_list); treeview.set_model (sum_list);
} }
} }

View File

@ -27,6 +27,7 @@ const string noupdate_info = _("Your system is up-to-date");
namespace Pamac { namespace Pamac {
[DBus (name = "org.manjaro.pamac")] [DBus (name = "org.manjaro.pamac")]
interface Daemon : Object { interface Daemon : Object {
public abstract string get_lockfile () throws IOError;
public abstract void start_refresh (bool force) throws IOError; public abstract void start_refresh (bool force) throws IOError;
public abstract void start_get_updates (bool check_aur_updates) throws IOError; public abstract void start_get_updates (bool check_aur_updates) throws IOError;
[DBus (no_reply = true)] [DBus (no_reply = true)]
@ -320,10 +321,14 @@ namespace Pamac {
Notify.init (_("Update Manager")); Notify.init (_("Update Manager"));
var alpm_config = new AlpmConfig ("/etc/pacman.conf");
alpm_config.set_handle ();
lockfile = GLib.File.new_for_path (alpm_config.handle.lockfile);
start_daemon (); start_daemon ();
try {
lockfile = GLib.File.new_for_path (daemon.get_lockfile ());
} catch (IOError e) {
stderr.printf ("IOError: %s\n", e.message);
//try standard lock file
lockfile = GLib.File.new_for_path ("var/lib/pacman/db.lck");
}
Timeout.add (200, check_pacman_running); Timeout.add (200, check_pacman_running);
start_refresh (); start_refresh ();
launch_refresh_timeout (pamac_config.refresh_period); launch_refresh_timeout (pamac_config.refresh_period);

View File

@ -25,7 +25,7 @@ namespace Pamac {
[GtkChild] [GtkChild]
Gtk.Label top_label; Gtk.Label top_label;
[GtkChild] [GtkChild]
Gtk.Notebook notebook; Gtk.StackSwitcher stackswitcher;
[GtkChild] [GtkChild]
Gtk.ScrolledWindow repos_scrolledwindow; Gtk.ScrolledWindow repos_scrolledwindow;
[GtkChild] [GtkChild]
@ -51,10 +51,10 @@ namespace Pamac {
public UpdaterWindow (Gtk.Application application) { public UpdaterWindow (Gtk.Application application) {
Object (application: application); Object (application: application);
bottom_label.set_visible (false); bottom_label.visible = false;
apply_button.set_sensitive (false); apply_button.sensitive = false;
notebook.set_show_tabs (false); stackswitcher.visible = false;
aur_scrolledwindow.set_visible (false); aur_scrolledwindow.visible = false;
Timeout.add (100, populate_window); Timeout.add (100, populate_window);
} }
@ -62,9 +62,9 @@ namespace Pamac {
bool populate_window () { bool populate_window () {
this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH)); this.get_window ().set_cursor (new Gdk.Cursor.for_display (Gdk.Display.get_default (), Gdk.CursorType.WATCH));
repos_updates_list = new Gtk.ListStore (3, typeof (bool), typeof (string), typeof (string)); repos_updates_list = new Gtk.ListStore (6, typeof (bool), typeof (string), typeof (string), typeof (string),typeof (string), typeof (string));
repos_updates_treeview.set_model (repos_updates_list); repos_updates_treeview.set_model (repos_updates_list);
aur_updates_list = new Gtk.ListStore (2, typeof (bool), typeof (string)); aur_updates_list = new Gtk.ListStore (3, typeof (bool), typeof (string), typeof (string));
aur_updates_treeview.set_model (aur_updates_list); aur_updates_treeview.set_model (aur_updates_list);
transaction = new Transaction (this as Gtk.ApplicationWindow); transaction = new Transaction (this as Gtk.ApplicationWindow);
@ -80,31 +80,29 @@ namespace Pamac {
void set_apply_button_sensitive () { void set_apply_button_sensitive () {
bool sensitive = false; bool sensitive = false;
repos_updates_list.foreach ((model, path, iter) => { repos_updates_list.foreach ((model, path, iter) => {
GLib.Value selected; bool selected;
repos_updates_list.get_value (iter, 0, out selected); repos_updates_list.get (iter, 0, out selected);
sensitive = (bool) selected; sensitive = selected;
return sensitive; return sensitive;
}); });
if (!sensitive) { if (!sensitive) {
aur_updates_list.foreach ((model, path, iter) => { aur_updates_list.foreach ((model, path, iter) => {
GLib.Value selected; bool selected;
aur_updates_list.get_value (iter, 0, out selected); aur_updates_list.get (iter, 0, out selected);
sensitive = (bool) selected; sensitive = selected;
return sensitive; return sensitive;
}); });
} }
apply_button.set_sensitive (sensitive); apply_button.sensitive = sensitive;
} }
[GtkCallback] [GtkCallback]
void on_repos_select_update_toggled (string path) { void on_repos_select_update_toggled (string path) {
Gtk.TreePath treepath = new Gtk.TreePath.from_string (path); Gtk.TreePath treepath = new Gtk.TreePath.from_string (path);
Gtk.TreeIter iter; Gtk.TreeIter iter;
GLib.Value name_string; string pkgname;
repos_updates_list.get_iter (out iter, treepath); repos_updates_list.get_iter (out iter, treepath);
repos_updates_list.get_value (iter, 1, out name_string); repos_updates_list.get (iter, 1, out pkgname);
// string has the form "pkgname pkgversion"
string pkgname = name_string.get_string ().split (" ", 2)[0];
if (repos_select_update.active) { if (repos_select_update.active) {
repos_updates_list.set (iter, 0, false); repos_updates_list.set (iter, 0, false);
transaction.temporary_ignorepkgs.add (pkgname); transaction.temporary_ignorepkgs.add (pkgname);
@ -119,11 +117,9 @@ namespace Pamac {
void on_aur_select_update_toggled (string path) { void on_aur_select_update_toggled (string path) {
Gtk.TreePath treepath = new Gtk.TreePath.from_string (path); Gtk.TreePath treepath = new Gtk.TreePath.from_string (path);
Gtk.TreeIter iter; Gtk.TreeIter iter;
GLib.Value name_string; string pkgname;
aur_updates_list.get_iter (out iter, treepath); aur_updates_list.get_iter (out iter, treepath);
aur_updates_list.get_value (iter, 1, out name_string); aur_updates_list.get (iter, 1, out pkgname);
// string has the form "pkgname pkgversion"
string pkgname = name_string.get_string ().split (" ", 2)[0];
if (aur_select_update.active) { if (aur_select_update.active) {
aur_updates_list.set (iter, 0, false); aur_updates_list.set (iter, 0, false);
transaction.temporary_ignorepkgs.add (pkgname); transaction.temporary_ignorepkgs.add (pkgname);
@ -166,34 +162,32 @@ namespace Pamac {
void on_get_updates_finished (Updates updates) { void on_get_updates_finished (Updates updates) {
top_label.set_markup (""); top_label.set_markup ("");
repos_updates_list.clear (); repos_updates_list.clear ();
notebook.set_show_tabs (false); stackswitcher.visible = false;
repos_scrolledwindow.set_visible (true); repos_scrolledwindow.visible = true;
aur_updates_list.clear (); aur_updates_list.clear ();
aur_scrolledwindow.set_visible (false); aur_scrolledwindow.visible = false;
bottom_label.set_visible (false); bottom_label.visible = false;
Gtk.TreeIter iter;
uint64 dsize = 0; uint64 dsize = 0;
uint repos_updates_nb = 0; uint repos_updates_nb = 0;
uint aur_updates_nb = 0; uint aur_updates_nb = 0;
foreach (unowned PackageInfos infos in updates.repos_updates) { foreach (unowned UpdateInfos infos in updates.repos_updates) {
string name = infos.name + " " + infos.version;
string size = infos.download_size != 0 ? format_size (infos.download_size) : ""; string size = infos.download_size != 0 ? format_size (infos.download_size) : "";
dsize += infos.download_size; dsize += infos.download_size;
repos_updates_nb++; repos_updates_nb++;
if (infos.name in transaction.temporary_ignorepkgs) { repos_updates_list.insert_with_values (null, -1,
repos_updates_list.insert_with_values (out iter, -1, 0, false, 1, name, 2, size); 0, !transaction.temporary_ignorepkgs.contains (infos.name),
} else { 1, infos.name,
repos_updates_list.insert_with_values (out iter, -1, 0, true, 1, name, 2, size); 2, infos.new_version,
} 3, "(%s)".printf (infos.old_version),
4, infos.repo,
5, size);
} }
foreach (unowned PackageInfos infos in updates.aur_updates) { foreach (unowned UpdateInfos infos in updates.aur_updates) {
string name = infos.name + " " + infos.version;
aur_updates_nb++; aur_updates_nb++;
if (infos.name in transaction.temporary_ignorepkgs) { aur_updates_list.insert_with_values (null, -1,
aur_updates_list.insert_with_values (out iter, -1, 0, false, 1, name); 0, !transaction.temporary_ignorepkgs.contains (infos.name),
} else { 1, infos.name,
aur_updates_list.insert_with_values (out iter, -1, 0, true, 1, name); 2, "%s\t (%s)".printf (infos.new_version, infos.old_version));
}
} }
uint updates_nb = repos_updates_nb + aur_updates_nb; uint updates_nb = repos_updates_nb + aur_updates_nb;
if (updates_nb == 0) { if (updates_nb == 0) {
@ -204,16 +198,16 @@ namespace Pamac {
set_apply_button_sensitive (); set_apply_button_sensitive ();
if (dsize != 0) { if (dsize != 0) {
bottom_label.set_markup("<b>%s: %s</b>".printf (dgettext (null, "Total download size"), format_size(dsize))); bottom_label.set_markup("<b>%s: %s</b>".printf (dgettext (null, "Total download size"), format_size(dsize)));
bottom_label.set_visible (true); bottom_label.visible = true;
} else { } else {
bottom_label.set_visible (false); bottom_label.visible = false;
} }
if (aur_updates_nb != 0) { if (aur_updates_nb != 0) {
aur_scrolledwindow.set_visible (true); aur_scrolledwindow.visible = true;
if (repos_updates_nb == 0) { if (repos_updates_nb == 0) {
repos_scrolledwindow.set_visible (false); repos_scrolledwindow.visible = false;
} }
notebook.set_show_tabs (true); stackswitcher.visible = true;
} }
this.get_window ().set_cursor (null); this.get_window ().set_cursor (null);
} }

View File

@ -1,8 +1,7 @@
/* /*
* libalpm-vala
* Vala bindings for libalpm * Vala bindings for libalpm
* *
* Copyright (C) 2014-2015 Guillaume Benoit <guillaume@manjaro.org> * Copyright (C) 2014-2016 Guillaume Benoit <guillaume@manjaro.org>
* Copyright (c) 2011 Rémy Oudompheng <remy@archlinux.org> * Copyright (c) 2011 Rémy Oudompheng <remy@archlinux.org>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
@ -45,7 +44,11 @@ namespace Alpm {
public int pkg_vercmp(string a, string b); public int pkg_vercmp(string a, string b);
public unowned Alpm.List<unowned Package?> find_group_pkgs(Alpm.List<DB> dbs, string name); /** Find group members across a list of databases.
* If a member exists in several databases, only the first database is used.
* IgnorePkg is also handled.
*/
public Alpm.List<unowned Package?> find_group_pkgs(Alpm.List<DB> dbs, string name);
/** Returns the string corresponding to an error number. */ /** Returns the string corresponding to an error number. */
public unowned string strerror(Errno err); public unowned string strerror(Errno err);
@ -57,7 +60,7 @@ namespace Alpm {
[Compact] [Compact]
public class Handle { public class Handle {
[CCode (cname = "alpm_initialize")] [CCode (cname = "alpm_initialize")]
public static Handle? @new(string root, string dbpath, out Alpm.Errno error); public Handle (string root, string dbpath, out Alpm.Errno error);
public unowned string root { public unowned string root {
[CCode (cname = "alpm_option_get_root")] get; [CCode (cname = "alpm_option_get_root")] get;
@ -69,7 +72,7 @@ namespace Alpm {
[CCode (cname = "alpm_option_get_arch")] get; [CCode (cname = "alpm_option_get_arch")] get;
[CCode (cname = "alpm_option_set_arch")] set; [CCode (cname = "alpm_option_set_arch")] set;
} }
public unowned Alpm.List<unowned string?> cachedirs { public unowned Alpm.List<unowned string> cachedirs {
[CCode (cname = "alpm_option_get_cachedirs")] get; [CCode (cname = "alpm_option_get_cachedirs")] get;
[CCode (cname = "alpm_option_set_cachedirs")] set; [CCode (cname = "alpm_option_set_cachedirs")] set;
} }
@ -78,7 +81,7 @@ namespace Alpm {
[CCode (cname = "alpm_option_remove_cachedir")] [CCode (cname = "alpm_option_remove_cachedir")]
public int remove_cachedir(string cachedir); public int remove_cachedir(string cachedir);
public unowned Alpm.List<unowned string?> hookdirs { public unowned Alpm.List<unowned string> hookdirs {
[CCode (cname = "alpm_option_get_hookdirs")] get; [CCode (cname = "alpm_option_get_hookdirs")] get;
[CCode (cname = "alpm_option_set_hookdirs")] set; [CCode (cname = "alpm_option_set_hookdirs")] set;
} }
@ -103,7 +106,7 @@ namespace Alpm {
/** Sets whether to use syslog (0 is FALSE, TRUE otherwise). */ /** Sets whether to use syslog (0 is FALSE, TRUE otherwise). */
[CCode (cname = "alpm_option_set_usesyslog")] set; [CCode (cname = "alpm_option_set_usesyslog")] set;
} }
public unowned Alpm.List<unowned string?> noupgrades { public unowned Alpm.List<unowned string> noupgrades {
[CCode (cname = "alpm_option_get_noupgrades")] get; [CCode (cname = "alpm_option_get_noupgrades")] get;
[CCode (cname = "alpm_option_set_noupgrades")] set; [CCode (cname = "alpm_option_set_noupgrades")] set;
} }
@ -112,7 +115,7 @@ namespace Alpm {
[CCode (cname = "alpm_option_remove_noupgrade")] [CCode (cname = "alpm_option_remove_noupgrade")]
public int remove_noupgrade(string path); public int remove_noupgrade(string path);
public unowned Alpm.List<unowned string?> noextracts { public unowned Alpm.List<unowned string> noextracts {
[CCode (cname = "alpm_option_get_noextracts")] get; [CCode (cname = "alpm_option_get_noextracts")] get;
[CCode (cname = "alpm_option_set_noextracts")] set; [CCode (cname = "alpm_option_set_noextracts")] set;
} }
@ -123,7 +126,7 @@ namespace Alpm {
[CCode (cname = "alpm_option_match_noextract")] [CCode (cname = "alpm_option_match_noextract")]
public int match_noextract(string path); public int match_noextract(string path);
public unowned Alpm.List<unowned string?> ignorepkgs { public unowned Alpm.List<unowned string> ignorepkgs {
[CCode (cname = "alpm_option_get_ignorepkgs")] get; [CCode (cname = "alpm_option_get_ignorepkgs")] get;
[CCode (cname = "alpm_option_set_ignorepkgs")] set; [CCode (cname = "alpm_option_set_ignorepkgs")] set;
} }
@ -132,7 +135,7 @@ namespace Alpm {
[CCode (cname = "alpm_option_remove_ignorepkg")] [CCode (cname = "alpm_option_remove_ignorepkg")]
public int remove_ignorepkg(string pkg); public int remove_ignorepkg(string pkg);
public unowned Alpm.List<unowned string?> ignoregroups { public unowned Alpm.List<unowned string> ignoregroups {
[CCode (cname = "alpm_option_get_ignoregroups")] get; [CCode (cname = "alpm_option_get_ignoregroups")] get;
[CCode (cname = "alpm_option_set_ignoregroups")] set; [CCode (cname = "alpm_option_set_ignoregroups")] set;
} }
@ -141,7 +144,7 @@ namespace Alpm {
[CCode (cname = "alpm_option_remove_ignorepkg")] [CCode (cname = "alpm_option_remove_ignorepkg")]
public int remove_ignoregroup(string grp); public int remove_ignoregroup(string grp);
public unowned Alpm.List<unowned Depend?> assumeinstalled { public unowned Alpm.List<unowned Depend> assumeinstalled {
[CCode (cname = "alpm_option_get_assumeinstalled")] get; [CCode (cname = "alpm_option_get_assumeinstalled")] get;
[CCode (cname = "alpm_option_set_assumeinstalled")] set; [CCode (cname = "alpm_option_set_assumeinstalled")] set;
} }
@ -178,10 +181,10 @@ namespace Alpm {
[CCode (cname = "alpm_option_set_remote_file_siglevel")] set; [CCode (cname = "alpm_option_set_remote_file_siglevel")] set;
} }
public unowned DB? localdb { public unowned DB localdb {
[CCode (cname = "alpm_get_localdb")] get; [CCode (cname = "alpm_get_localdb")] get;
} }
public unowned Alpm.List<unowned DB?> syncdbs { public unowned Alpm.List<unowned DB> syncdbs {
[CCode (cname = "alpm_get_syncdbs")] get; [CCode (cname = "alpm_get_syncdbs")] get;
} }
@ -218,14 +221,14 @@ namespace Alpm {
public int unlock(); public int unlock();
[CCode (cname = "alpm_register_syncdb")] [CCode (cname = "alpm_register_syncdb")]
public unowned DB? register_syncdb(string treename, Signature.Level level); public unowned DB register_syncdb(string treename, Signature.Level level);
[CCode (cname = "alpm_unregister_all_syncdbs")] [CCode (cname = "alpm_unregister_all_syncdbs")]
public int unregister_all_syncdbs(); public int unregister_all_syncdbs();
// the return package can be freed except if it is added to a transaction, // the return package can be freed except if it is added to a transaction,
// it will be freed upon Handle.trans_release() invocation. // it will be freed upon Handle.trans_release() invocation.
[CCode (cname = "alpm_pkg_load_file")] [CCode (cname = "alpm_pkg_load")]
public Package? load_file(string filename, int full, Signature.Level level); public int load_tarball(string filename, int full, Signature.Level level, out Package pkg);
/** Test if a package should be ignored. /** Test if a package should be ignored.
* Checks if the package is ignored via IgnorePkg, or if the package is * Checks if the package is ignored via IgnorePkg, or if the package is
@ -252,11 +255,11 @@ namespace Alpm {
/** Returns a list of packages added by the transaction.*/ /** Returns a list of packages added by the transaction.*/
[CCode (cname = "alpm_trans_get_add")] [CCode (cname = "alpm_trans_get_add")]
public unowned Alpm.List<unowned Package?> trans_to_add(); public unowned Alpm.List<unowned Package> trans_to_add();
/** Returns the list of packages removed by the transaction.*/ /** Returns the list of packages removed by the transaction.*/
[CCode (cname = "alpm_trans_get_remove")] [CCode (cname = "alpm_trans_get_remove")]
public unowned Alpm.List<unowned Package?> trans_to_remove(); public unowned Alpm.List<unowned Package> trans_to_remove();
/** Initialize the transaction. /** Initialize the transaction.
* @param flags flags of the transaction (like nodeps, etc) * @param flags flags of the transaction (like nodeps, etc)
@ -333,16 +336,16 @@ namespace Alpm {
[CCode (cname = "alpm_db_get_siglevel")] get; [CCode (cname = "alpm_db_get_siglevel")] get;
} }
public unowned Alpm.List<unowned string?> servers { public unowned Alpm.List<unowned string> servers {
[CCode (cname = "alpm_db_get_servers")] get; [CCode (cname = "alpm_db_get_servers")] get;
[CCode (cname = "alpm_db_set_servers")] set; [CCode (cname = "alpm_db_set_servers")] set;
} }
public unowned Alpm.List<unowned Package?> pkgcache { public unowned Alpm.List<unowned Package> pkgcache {
[CCode (cname = "alpm_db_get_pkgcache")] get; [CCode (cname = "alpm_db_get_pkgcache")] get;
} }
public unowned Alpm.List<unowned Group?> groupcache { public unowned Alpm.List<unowned Group> groupcache {
[CCode (cname = "alpm_db_get_groupcache")] get; [CCode (cname = "alpm_db_get_groupcache")] get;
} }
@ -368,7 +371,7 @@ namespace Alpm {
public unowned Package? get_pkg(string name); public unowned Package? get_pkg(string name);
public unowned Group? get_group(string name); public unowned Group? get_group(string name);
public Alpm.List<unowned Package?> search(Alpm.List<string> needles); public Alpm.List<unowned Package> search(Alpm.List<string> needles);
public int check_pgp_signature(out SigList siglist); public int check_pgp_signature(out SigList siglist);
} }
@ -440,37 +443,37 @@ namespace Alpm {
*/ */
[CCode (cname = "alpm_pkg_set_reason")] set; [CCode (cname = "alpm_pkg_set_reason")] set;
} }
public unowned Alpm.List<unowned string?> licenses { public unowned Alpm.List<unowned string> licenses {
[CCode (cname = "alpm_pkg_get_licenses")] get; [CCode (cname = "alpm_pkg_get_licenses")] get;
} }
public unowned Alpm.List<unowned string?> groups { public unowned Alpm.List<unowned string> groups {
[CCode (cname = "alpm_pkg_get_groups")] get; [CCode (cname = "alpm_pkg_get_groups")] get;
} }
public unowned Alpm.List<unowned Depend?> depends { public unowned Alpm.List<unowned Depend> depends {
[CCode (cname = "alpm_pkg_get_depends")] get; [CCode (cname = "alpm_pkg_get_depends")] get;
} }
public unowned Alpm.List<unowned Depend?> optdepends { public unowned Alpm.List<unowned Depend> optdepends {
[CCode (cname = "alpm_pkg_get_optdepends")] get; [CCode (cname = "alpm_pkg_get_optdepends")] get;
} }
public unowned Alpm.List<unowned Depend?> conflicts { public unowned Alpm.List<unowned Depend> conflicts {
[CCode (cname = "alpm_pkg_get_conflicts")] get; [CCode (cname = "alpm_pkg_get_conflicts")] get;
} }
public unowned Alpm.List<unowned Depend?> provides { public unowned Alpm.List<unowned Depend> provides {
[CCode (cname = "alpm_pkg_get_provides")] get; [CCode (cname = "alpm_pkg_get_provides")] get;
} }
public unowned Alpm.List<unowned string?> deltas { public unowned Alpm.List<unowned string> deltas {
[CCode (cname = "alpm_pkg_get_deltas")] get; [CCode (cname = "alpm_pkg_get_deltas")] get;
} }
public unowned Alpm.List<unowned Depend?> replaces { public unowned Alpm.List<unowned Depend> replaces {
[CCode (cname = "alpm_pkg_get_replaces")] get; [CCode (cname = "alpm_pkg_get_replaces")] get;
} }
public unowned Alpm.List<unowned File?> files { public unowned FileList files {
[CCode (cname = "alpm_pkg_get_files_list")] get; [CCode (cname = "alpm_pkg_get_files")] get;
} }
public unowned Alpm.List<unowned string?> unused_deltas { public unowned Alpm.List<unowned string> unused_deltas {
[CCode (cname = "alpm_pkg_unused_deltas")] get; [CCode (cname = "alpm_pkg_unused_deltas")] get;
} }
public unowned Alpm.List<unowned Backup?> backups { public unowned Alpm.List<unowned Backup> backups {
[CCode (cname = "alpm_pkg_get_backup")] get; [CCode (cname = "alpm_pkg_get_backup")] get;
} }
public unowned DB? db { public unowned DB? db {
@ -528,8 +531,8 @@ namespace Alpm {
public int checkmd5sum(); public int checkmd5sum();
public int has_scriptlet(); public int has_scriptlet();
public Alpm.List<string?> compute_requiredby(); public Alpm.List<string> compute_requiredby();
public Alpm.List<string?> compute_optionalfor(); public Alpm.List<string> compute_optionalfor();
[CCode (cname = "alpm_sync_newversion")] [CCode (cname = "alpm_sync_newversion")]
public unowned Package? sync_newversion(Alpm.List<DB> dbs); public unowned Package? sync_newversion(Alpm.List<DB> dbs);
@ -613,13 +616,15 @@ namespace Alpm {
/** Package group */ /** Package group */
[CCode (cname = "alpm_group_t", has_type_id = false)] [CCode (cname = "alpm_group_t", has_type_id = false)]
[Compact]
public class Group { public class Group {
public string name; public string name;
public unowned Alpm.List<unowned Package?> packages; public unowned Alpm.List<unowned Package> packages;
} }
/** Package upgrade delta */ /** Package upgrade delta */
[CCode (cname = "alpm_delta_t", has_type_id = false)] [CCode (cname = "alpm_delta_t", has_type_id = false)]
[Compact]
public class Delta { public class Delta {
/** filename of the delta patch */ /** filename of the delta patch */
public string delta; public string delta;
@ -637,6 +642,7 @@ namespace Alpm {
/** File in a package */ /** File in a package */
[CCode (cname = "alpm_file_t", has_type_id = false)] [CCode (cname = "alpm_file_t", has_type_id = false)]
[Compact]
public class File { public class File {
public string name; public string name;
public uint64 size; public uint64 size;
@ -645,10 +651,15 @@ namespace Alpm {
/** Package filelist container */ /** Package filelist container */
[CCode (cname = "alpm_filelist_t", has_type_id = false)] [CCode (cname = "alpm_filelist_t", has_type_id = false)]
[Compact]
public class FileList { public class FileList {
// Usage:
// Alpm.File* files = filelist.files;
// for (size_t i = 0; i < filelist.count; i++, files++) {
// stdout.printf("%s\n", files->name);
// }
public size_t count; public size_t count;
[CCode (array_length_cname = "count", array_length_type = "size_t")] public Alpm.File* files;
public unowned Alpm.File[] files;
/** Determines whether a package filelist contains a given path. /** Determines whether a package filelist contains a given path.
* The provided path should be relative to the install root with no leading * The provided path should be relative to the install root with no leading
* slashes, e.g. "etc/localtime". When searching for directories, the path must * slashes, e.g. "etc/localtime". When searching for directories, the path must
@ -662,6 +673,7 @@ namespace Alpm {
/** Local package or package file backup entry */ /** Local package or package file backup entry */
[CCode (cname = "alpm_backup_t", has_type_id = false)] [CCode (cname = "alpm_backup_t", has_type_id = false)]
[Compact]
public class Backup { public class Backup {
public string name; public string name;
public string hash; public string hash;
@ -669,6 +681,7 @@ namespace Alpm {
namespace Signature { namespace Signature {
[CCode (cname = "alpm_pgpkey_t", has_type_id = false)] [CCode (cname = "alpm_pgpkey_t", has_type_id = false)]
[Compact]
public class PGPKey { public class PGPKey {
public void *data; public void *data;
public string fingerprint; public string fingerprint;
@ -687,6 +700,7 @@ namespace Alpm {
* signature. * signature.
*/ */
[CCode (cname = "alpm_sigresult_t", has_type_id = false)] [CCode (cname = "alpm_sigresult_t", has_type_id = false)]
[Compact]
public class Result { public class Result {
public PGPKey key; public PGPKey key;
public Status status; public Status status;
@ -865,12 +879,14 @@ namespace Alpm {
} }
[CCode (cname = "alpm_event_any_t", has_type_id = false)] [CCode (cname = "alpm_event_any_t", has_type_id = false)]
[Compact]
public class Any { public class Any {
/** Type of event. */ /** Type of event. */
public Type type; public Type type;
} }
[CCode (cname = "alpm_event_package_operation_t", has_type_id = false)] [CCode (cname = "alpm_event_package_operation_t", has_type_id = false)]
[Compact]
public class PackageOperation { public class PackageOperation {
/** Type of event. */ /** Type of event. */
public Type type; public Type type;
@ -883,6 +899,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_event_optdep_removal_t", has_type_id = false)] [CCode (cname = "alpm_event_optdep_removal_t", has_type_id = false)]
[Compact]
public class OptDepRemoval { public class OptDepRemoval {
/** Type of event. */ /** Type of event. */
public Type type; public Type type;
@ -893,6 +910,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_event_delta_patch_t", has_type_id = false)] [CCode (cname = "alpm_event_delta_patch_t", has_type_id = false)]
[Compact]
public class DeltaPatch { public class DeltaPatch {
/** Type of event. */ /** Type of event. */
public Type type; public Type type;
@ -901,6 +919,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_event_scriptlet_info_t", has_type_id = false)] [CCode (cname = "alpm_event_scriptlet_info_t", has_type_id = false)]
[Compact]
public class ScriptletInfo { public class ScriptletInfo {
/** Type of event. */ /** Type of event. */
public Type type; public Type type;
@ -909,6 +928,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_event_database_missing_t", has_type_id = false)] [CCode (cname = "alpm_event_database_missing_t", has_type_id = false)]
[Compact]
public class DatabaseMissing { public class DatabaseMissing {
/** Type of event. */ /** Type of event. */
public Type type; public Type type;
@ -917,6 +937,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_event_pkgdownload_t", has_type_id = false)] [CCode (cname = "alpm_event_pkgdownload_t", has_type_id = false)]
[Compact]
public class PkgDownload { public class PkgDownload {
/** Type of event. */ /** Type of event. */
public Type type; public Type type;
@ -925,6 +946,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_event_pacnew_created_t", has_type_id = false)] [CCode (cname = "alpm_event_pacnew_created_t", has_type_id = false)]
[Compact]
public class PacnewCreated { public class PacnewCreated {
/** Type of event. */ /** Type of event. */
public Type type; public Type type;
@ -939,6 +961,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_event_pacsave_created_t", has_type_id = false)] [CCode (cname = "alpm_event_pacsave_created_t", has_type_id = false)]
[Compact]
public class PacsaveCreated { public class PacsaveCreated {
/** Type of event. */ /** Type of event. */
public Type type; public Type type;
@ -949,6 +972,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_event_hook_t", has_type_id = false)] [CCode (cname = "alpm_event_hook_t", has_type_id = false)]
[Compact]
public class Hook { public class Hook {
/** Type of event.*/ /** Type of event.*/
public Type type; public Type type;
@ -957,6 +981,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_event_hook_run_t", has_type_id = false)] [CCode (cname = "alpm_event_hook_run_t", has_type_id = false)]
[Compact]
public class HookRun { public class HookRun {
/** Type of event.*/ /** Type of event.*/
public Type type; public Type type;
@ -975,6 +1000,7 @@ namespace Alpm {
* typecast the pointer to the right structure, or use the union field, in order * typecast the pointer to the right structure, or use the union field, in order
* to access event-specific data. */ * to access event-specific data. */
[CCode (cname = "alpm_event_t", has_type_id = false)] [CCode (cname = "alpm_event_t", has_type_id = false)]
[Compact]
public class Data { public class Data {
/** Type of event. */ /** Type of event. */
public Type type; public Type type;
@ -1054,6 +1080,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_question_any_t", has_type_id = false)] [CCode (cname = "alpm_question_any_t", has_type_id = false)]
[Compact]
public class Any { public class Any {
/** Type of question. */ /** Type of question. */
public Type type; public Type type;
@ -1062,6 +1089,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_question_install_ignorepkg_t", has_type_id = false)] [CCode (cname = "alpm_question_install_ignorepkg_t", has_type_id = false)]
[Compact]
public class InstallIgnorePkg { public class InstallIgnorePkg {
/** Type of question. */ /** Type of question. */
public Type type; public Type type;
@ -1072,6 +1100,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_question_replace_t", has_type_id = false)] [CCode (cname = "alpm_question_replace_t", has_type_id = false)]
[Compact]
public class Replace { public class Replace {
/** Type of question. */ /** Type of question. */
public Type type; public Type type;
@ -1086,6 +1115,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_question_conflict_t", has_type_id = false)] [CCode (cname = "alpm_question_conflict_t", has_type_id = false)]
[Compact]
public class Conflict { public class Conflict {
/** Type of question. */ /** Type of question. */
public Type type; public Type type;
@ -1096,6 +1126,7 @@ namespace Alpm {
} }
[CCode (cname = "alpm_question_corrupted_t", has_type_id = false)] [CCode (cname = "alpm_question_corrupted_t", has_type_id = false)]
[Compact]
public class Corrupted { public class Corrupted {
/** Type of question. */ /** Type of question. */
public Type type; public Type type;
@ -1108,28 +1139,31 @@ namespace Alpm {
} }
[CCode (cname = "alpm_question_remove_pkgs_t", has_type_id = false)] [CCode (cname = "alpm_question_remove_pkgs_t", has_type_id = false)]
[Compact]
public class RemovePkgs { public class RemovePkgs {
/** Type of question. */ /** Type of question. */
public Type type; public Type type;
/** Answer: whether or not to skip packages. */ /** Answer: whether or not to skip packages. */
public int skip; public int skip;
/** List of alpm_pkg_t* with unresolved dependencies. */ /** List of alpm_pkg_t* with unresolved dependencies. */
public unowned Alpm.List<unowned Package?> packages; public unowned Alpm.List<unowned Package> packages;
} }
[CCode (cname = "alpm_question_select_provider_t", has_type_id = false)] [CCode (cname = "alpm_question_select_provider_t", has_type_id = false)]
[Compact]
public class SelectProvider { public class SelectProvider {
/** Type of question. */ /** Type of question. */
public Type type; public Type type;
/** Answer: which provider to use (index from providers). */ /** Answer: which provider to use (index from providers). */
public int use_index; public int use_index;
/** List of alpm_pkg_t* as possible providers. */ /** List of alpm_pkg_t* as possible providers. */
public unowned Alpm.List<unowned Package?> providers; public unowned Alpm.List<unowned Package> providers;
/** What providers provide for. */ /** What providers provide for. */
public unowned Depend depend; public unowned Depend depend;
} }
[CCode (cname = "alpm_question_import_key_t", has_type_id = false)] [CCode (cname = "alpm_question_import_key_t", has_type_id = false)]
[Compact]
public class ImportKey { public class ImportKey {
/** Type of question. */ /** Type of question. */
public Type type; public Type type;
@ -1144,6 +1178,7 @@ namespace Alpm {
* typecast the pointer to the right structure, or use the union field, in order * typecast the pointer to the right structure, or use the union field, in order
* to access question-specific data. */ * to access question-specific data. */
[CCode (cname = "alpm_question_t", has_type_id = false)] [CCode (cname = "alpm_question_t", has_type_id = false)]
[Compact]
public class Data { public class Data {
public Type type; public Type type;
// Any any; // Any any;
@ -1179,12 +1214,12 @@ namespace Alpm {
[CCode (cname = "remove_pkgs.skip")] [CCode (cname = "remove_pkgs.skip")]
public int remove_pkgs_skip; public int remove_pkgs_skip;
[CCode (cname = "remove_pkgs.packages")] [CCode (cname = "remove_pkgs.packages")]
public unowned Alpm.List<unowned Package?> remove_pkgs_packages; public unowned Alpm.List<unowned Package> remove_pkgs_packages;
// SelectProvider select_provider; // SelectProvider select_provider;
[CCode (cname = "select_provider.use_index")] [CCode (cname = "select_provider.use_index")]
public int select_provider_use_index; public int select_provider_use_index;
[CCode (cname = "select_provider.providers")] [CCode (cname = "select_provider.providers")]
public unowned Alpm.List<unowned Package?> select_provider_providers; public unowned Alpm.List<unowned Package> select_provider_providers;
[CCode (cname = "select_provider.depend")] [CCode (cname = "select_provider.depend")]
public unowned Depend select_provider_depend; public unowned Depend select_provider_depend;
// ImportKey import_key; // ImportKey import_key;
@ -1348,24 +1383,25 @@ namespace Alpm {
GPGME GPGME
} }
[CCode (cname = "alpm_list_t", cprefix = "alpm_list_", cheader_filename = "alpm_list.h,alpm-util.h", [CCode (cname = "alpm_list_t", cprefix = "alpm_list_", cheader_filename = "alpm_list.h",
dup_function = "alpm_list_copy", free_function = "alpm_list_free")] dup_function = "alpm_list_copy", free_function = "alpm_list_free")]
[Compact] [Compact]
public class List<G> { public class List<G> {
public List ();
/* comparator */ /* comparator */
[CCode (cname = "alpm_list_fn_cmp", has_target = false)] [CCode (cname = "alpm_list_fn_cmp", has_target = false)]
public delegate int CompareFunc<G>(G a, G b); public delegate int CompareFunc<G>(G a, G b);
/* deallocator */
[CCode (cname = "alpm_list_fn_free", has_target = false)]
public delegate void FreeFunc<G>(G a);
/* properties */ /* properties */
public size_t length { public size_t length {
[CCode (cname = "alpm_list_count")] get; [CCode (cname = "alpm_list_count")] get;
} }
public unowned G? data {
[CCode (cname = "alpm_list_get_data")] get; /* field */
} public G data;
/* item mutators */ /* item mutators */
[ReturnsModifiedPointer ()] [ReturnsModifiedPointer ()]
@ -1374,42 +1410,32 @@ namespace Alpm {
[ReturnsModifiedPointer ()] [ReturnsModifiedPointer ()]
public void join(owned List<G> list); public void join(owned List<G> list);
[CCode (cname = "alpm_list_msort", has_target = false)]
[ReturnsModifiedPointer ()] [ReturnsModifiedPointer ()]
public void sort(CompareFunc fn); public void sort(size_t n, CompareFunc fn);
[ReturnsModifiedPointer ()] [ReturnsModifiedPointer ()]
public void remove(G data, CompareFunc fn, out G removed_data ); public void remove(G data, CompareFunc fn, out G removed_data );
/* free the internal data of this */ /* free the internal data of this */
public void free_data(); public void free_inner(FreeFunc fn);
public List<unowned G> copy(); public List<unowned G> copy();
public List<G> copy_data();
[ReturnsModifiedPointer ()] [ReturnsModifiedPointer ()]
public void reverse (); public void reverse ();
/* item accessors */ /* item accessors */
public unowned List<G>? first(); public unowned List<G> nth(size_t index);
public unowned List<G>? last(); [ReturnsModifiedPointer ()]
public unowned List<G>? nth(size_t index); public void next();
public unowned List<G>? next();
public unowned List<G>? previous();
/* misc */ /* misc */
public unowned G? find(G needle, CompareFunc fn); public unowned G find(G needle, CompareFunc fn);
public unowned string? find_str(string needle); public unowned string? find_str(string needle);
/** @return a list containing all items in `this` not present in `list` */ /** @return a list containing all items in `this` not present in `list` */
public List<unowned G>? diff(List<G>? list, CompareFunc fn); public List<unowned G> diff(List<G> list, CompareFunc fn);
/* iterator */
public Iterator<G> iterator();
[CCode (cname = "alpm_list_iterator_t", cprefix = "alpm_list_iterator_")]
public struct Iterator<G> {
public unowned G? next_value();
}
} }
} }