From b59e68459b9c0f0f841ae38fedbc572171a2ca69 Mon Sep 17 00:00:00 2001 From: guinux Date: Thu, 14 Apr 2016 18:19:20 +0200 Subject: [PATCH] v4.0.0-beta --- examples/pactree.vala | 29 +- po/pamac.pot | 248 +-- resources/Makefile | 1 + resources/choose_dep_dialog.ui | 13 +- resources/choose_ignorepkgs_dialog.ui | 1 + resources/choose_provider_dialog.ui | 11 +- resources/history_dialog.ui | 9 +- resources/manager_window.ui | 1563 +++++++++--------- resources/package-available-locked.png | Bin 0 -> 411 bytes resources/pamac.manager.gresource.xml | 1 + resources/preferences_dialog.ui | 89 +- resources/progress_dialog.ui | 6 +- resources/transaction_info_dialog.ui | 10 + resources/transaction_sum_dialog.ui | 44 +- resources/updater_window.ui | 154 +- src/Makefile | 63 +- src/alpm_config.vala | 154 +- src/aur.vala | 131 +- src/choose_dep_dialog.vala | 8 +- src/common.vala | 19 +- src/daemon.vala | 1092 ++++++++++-- src/manager_window.vala | 2109 +++++++++++------------- src/mirrors_config.vala | 50 +- src/package.vala | 82 + src/pamac_config.vala | 43 +- src/preferences_dialog.vala | 115 +- src/transaction.vala | 1167 +++++++------ src/transaction_sum_dialog.vala | 2 +- src/tray.vala | 11 +- src/updater_window.vala | 86 +- vapi/libalpm.vapi | 160 +- 31 files changed, 4265 insertions(+), 3206 deletions(-) create mode 100644 resources/package-available-locked.png create mode 100644 src/package.vala diff --git a/examples/pactree.vala b/examples/pactree.vala index d738d7f..a76c69d 100644 --- a/examples/pactree.vala +++ b/examples/pactree.vala @@ -18,7 +18,7 @@ * along with this program. If not, see . */ -// 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; @@ -37,10 +37,10 @@ string leaf2_color; string color_off; /* globals */ -unowned Handle? handle; +Handle handle; unowned DB localdb; -Alpm.List walked = null; -Alpm.List provisions = null; +Alpm.List walked; +Alpm.List provisions; /* options */ bool color; @@ -127,7 +127,7 @@ static int parse_options(ref unowned string[] args) { static void local_init() { Alpm.Errno error; - handle = Handle.new ("/", dbpath, out error); + handle = new Handle ("/", dbpath, out error); assert (error == 0); localdb = handle.localdb; assert (localdb != null); @@ -187,11 +187,11 @@ static void walk_reverse_deps(Package pkg, int depth) { if((max_depth >= 0) && (depth > max_depth)) return; walked.add(pkg.name); - Alpm.List *required_by = pkg.compute_requiredby(); + Alpm.List required_by = pkg.compute_requiredby(); - int i = 0; - while (i < required_by->length) { - string? pkgname = required_by->nth_data(i); + unowned Alpm.List list = required_by; + while (list != null) { + unowned string pkgname = list.data; if (walked.find_str(pkgname) != null) { /* if we've already seen this package, don't print in "unique" output * and don't recurse */ @@ -202,9 +202,9 @@ static void walk_reverse_deps(Package pkg, int depth) { print(pkg.name, pkgname, null, depth); 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); - foreach (unowned Depend depend in pkg.depends) { - string depname = depend.name; + unowned Alpm.List depends = pkg.depends; + while (depends != null) { + unowned Alpm.Depend depend = depends.data; + unowned string depname = depend.name; unowned Package? provider = find_satisfier (localdb.pkgcache, depname); if (provider != null) { @@ -237,6 +239,7 @@ static void walk_deps(Package pkg, int depth) /* unresolvable package */ print(pkg.name, null, depname, depth); } + depends.next (); } } diff --git a/po/pamac.pot b/po/pamac.pot index f987d85..dfe1773 100644 --- a/po/pamac.pot +++ b/po/pamac.pot @@ -21,7 +21,7 @@ msgstr "" msgid "Authentication is required" msgstr "" -#: ../src/daemon.vala ../src/transaction.vala +#: ../src/daemon.vala msgid "Failed to initialize alpm library" msgstr "" @@ -29,6 +29,26 @@ msgstr "" msgid "Failed to synchronize any databases" 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 msgid "Failed to init transaction" msgstr "" @@ -120,7 +140,7 @@ msgstr "" msgid "Transaction Summary" msgstr "" -#: ../src/transaction.vala ../src/manager_window.vala +#: ../src/transaction.vala msgid "To remove" msgstr "" @@ -132,7 +152,7 @@ msgstr "" msgid "To build" msgstr "" -#: ../src/transaction.vala ../src/manager_window.vala +#: ../src/transaction.vala msgid "To install" msgstr "" @@ -153,11 +173,7 @@ msgid "Building packages" msgstr "" #: ../src/transaction.vala -msgid "Running pre-transaction hooks" -msgstr "" - -#: ../src/transaction.vala -msgid "Running post-transaction hooks" +msgid "Transaction cancelled" msgstr "" #: ../src/transaction.vala @@ -181,38 +197,30 @@ msgstr "" msgid "Installing %s" msgstr "" -#: ../src/transaction.vala -#, c-format -msgid "Reinstalling %s" -msgstr "" - -#: ../src/transaction.vala -#, c-format -msgid "Removing %s" -msgstr "" - #: ../src/transaction.vala #, c-format msgid "Upgrading %s" msgstr "" +#: ../src/transaction.vala +#, c-format +msgid "Reinstalling %s" +msgstr "" + #: ../src/transaction.vala #, c-format msgid "Downgrading %s" msgstr "" +#: ../src/transaction.vala +#, c-format +msgid "Removing %s" +msgstr "" + #: ../src/transaction.vala msgid "Checking integrity" msgstr "" -#: ../src/transaction.vala -msgid "Checking keyring" -msgstr "" - -#: ../src/transaction.vala -msgid "Downloading required keys" -msgstr "" - #: ../src/transaction.vala msgid "Loading packages files" msgstr "" @@ -247,6 +255,11 @@ msgstr "" msgid "Downloading" msgstr "" +#: ../src/transaction.vala +#, c-format +msgid "Downloading %s" +msgstr "" + #: ../src/transaction.vala msgid "Checking available disk space" msgstr "" @@ -261,6 +274,14 @@ msgstr "" msgid "Database file for %s does not exist" msgstr "" +#: ../src/transaction.vala +msgid "Checking keyring" +msgstr "" + +#: ../src/transaction.vala +msgid "Downloading required keys" +msgstr "" + #: ../src/transaction.vala #, c-format msgid "%s installed as %s.pacnew" @@ -272,13 +293,11 @@ msgid "%s installed as %s.pacsave" msgstr "" #: ../src/transaction.vala -#, c-format -msgid "Refreshing %s" +msgid "Running pre-transaction hooks" msgstr "" #: ../src/transaction.vala -#, c-format -msgid "Downloading %s" +msgid "Running post-transaction hooks" msgstr "" #: ../src/transaction.vala @@ -294,7 +313,8 @@ msgstr[0] "" msgstr[1] "" #: ../src/transaction.vala -msgid "Warning" +#, c-format +msgid "Refreshing %s" msgstr "" #: ../src/transaction.vala @@ -302,7 +322,7 @@ msgid "Error" msgstr "" #: ../src/transaction.vala -msgid "Transaction cancelled" +msgid "Warning" msgstr "" #: ../src/transaction.vala @@ -369,8 +389,11 @@ msgid "Mark as explicitly installed" msgstr "" #: ../src/manager_window.vala -msgid "local" -msgstr "" +#, c-format +msgid "%u pending operation" +msgid_plural "%u pending operations" +msgstr[0] "" +msgstr[1] "" #: ../src/manager_window.vala msgid "Installed" @@ -381,11 +404,48 @@ msgid "Orphans" msgstr "" #: ../src/manager_window.vala -msgid "Licenses" +msgid "Foreign" msgstr "" #: ../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 "" #: ../src/manager_window.vala @@ -416,62 +476,6 @@ msgstr "" msgid "Conflicts With" 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 msgid "Package Base" msgstr "" @@ -488,7 +492,7 @@ msgstr "" msgid "Last Modified" msgstr "" -#: ../src/manager_window.vala ../resources/manager_window.ui +#: ../src/manager_window.vala msgid "Votes" msgstr "" @@ -496,6 +500,11 @@ msgstr "" msgid "Out of Date" msgstr "" +#: ../src/manager_window.vala ../resources/manager_window.ui +#: ../resources/updater_window.ui +msgid "Name" +msgstr "" + #: ../src/manager_window.vala #, c-format msgid "" @@ -507,17 +516,13 @@ msgid_plural "" msgstr[0] "" msgstr[1] "" -#: ../src/manager_window.vala -msgid "Uninstalled" -msgstr "" - #: ../src/manager_window.vala ../resources/manager_window.ui msgid "Install Local Packages" msgstr "" #: ../src/manager_window.vala ../resources/progress_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" msgstr "" @@ -571,10 +576,8 @@ msgstr "" msgid "Progress" msgstr "" -#: ../resources/progress_dialog.ui ../resources/history_dialog.ui -#: ../resources/transaction_info_dialog.ui ../resources/updater_window.ui -#: ../resources/preferences_dialog.ui -msgid "_Close" +#: ../resources/progress_dialog.ui +msgid "_Hide" msgstr "" #: ../resources/progress_dialog.ui ../resources/transaction_info_dialog.ui @@ -586,6 +589,11 @@ msgstr "" msgid "Pamac History" 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 msgid "Choose Optional Dependencies" msgstr "" @@ -606,14 +614,6 @@ msgstr "" msgid "Refresh databases" msgstr "" -#: ../resources/manager_window.ui -msgid "Apply changes" -msgstr "" - -#: ../resources/manager_window.ui -msgid "Cancel all planned changes" -msgstr "" - #: ../resources/manager_window.ui msgid "Search in AUR" msgstr "" @@ -622,7 +622,7 @@ msgstr "" msgid "Search" msgstr "" -#: ../resources/manager_window.ui +#: ../resources/manager_window.ui ../resources/updater_window.ui msgid "State" msgstr "" @@ -630,25 +630,29 @@ msgstr "" msgid "Repositories" msgstr "" -#: ../resources/manager_window.ui -msgid "Name" -msgstr "" - -#: ../resources/manager_window.ui +#: ../resources/manager_window.ui ../resources/updater_window.ui msgid "Version" msgstr "" -#: ../resources/manager_window.ui +#: ../resources/manager_window.ui ../resources/updater_window.ui msgid "Size" msgstr "" +#: ../resources/manager_window.ui +msgid "Popularity" +msgstr "" + #: ../resources/manager_window.ui ../resources/updater_window.ui #: ../resources/preferences_dialog.ui msgid "AUR" msgstr "" +#: ../resources/manager_window.ui ../resources/updater_window.ui +msgid "_Apply" +msgstr "" + #: ../resources/manager_window.ui -msgid "Description" +msgid "Browse" msgstr "" #: ../resources/manager_window.ui @@ -663,10 +667,6 @@ msgstr "" msgid "_Refresh" msgstr "" -#: ../resources/updater_window.ui -msgid "_Apply" -msgstr "" - #: ../resources/preferences_dialog.ui msgid "Preferences" msgstr "" @@ -689,6 +689,10 @@ msgstr "" msgid "Check for updates" msgstr "" +#: ../resources/preferences_dialog.ui +msgid "6" +msgstr "" + #: ../resources/preferences_dialog.ui msgid "Hide tray icon when no update available" msgstr "" diff --git a/resources/Makefile b/resources/Makefile index 898cd7c..ba1e352 100644 --- a/resources/Makefile +++ b/resources/Makefile @@ -3,6 +3,7 @@ MANAGER_RESOURCES_FILES = manager_window.ui \ choose_dep_dialog.ui \ history_dialog.ui \ package-available.png \ + package-available-locked.png \ package-install.png \ package-installed-locked.png \ package-installed-updated.png \ diff --git a/resources/choose_dep_dialog.ui b/resources/choose_dep_dialog.ui index 5262dc0..e98fb2b 100644 --- a/resources/choose_dep_dialog.ui +++ b/resources/choose_dep_dialog.ui @@ -1,13 +1,16 @@ +