From d3fe4c0bae96147f96ca6ae03d5cde5c41b8eba7 Mon Sep 17 00:00:00 2001 From: Chris Cromer Date: Thu, 12 Mar 2020 21:22:12 -0300 Subject: [PATCH] fix vala 0.48 build --- src/common.vala | 2 +- src/pamac-system-daemon/system_daemon.vala | 100 ++++++++++----------- src/transaction.vala | 2 +- 3 files changed, 52 insertions(+), 52 deletions(-) diff --git a/src/common.vala b/src/common.vala index 5fecac8..d78f2a8 100644 --- a/src/common.vala +++ b/src/common.vala @@ -51,7 +51,7 @@ namespace Pamac { } public struct ErrorInfos { - public uint errno; + public uint errnos; public string message; public string[] details; public ErrorInfos () { diff --git a/src/pamac-system-daemon/system_daemon.vala b/src/pamac-system-daemon/system_daemon.vala index a59a0e4..a40f3fa 100644 --- a/src/pamac-system-daemon/system_daemon.vala +++ b/src/pamac-system-daemon/system_daemon.vala @@ -485,12 +485,12 @@ namespace Pamac { // fail later with unresolved deps, but that should be rare, and would be expected success = true; } else { - Alpm.Errno errno = handle.errno (); - current_error.errno = (uint) errno; - if (errno != 0) { + Alpm.Errno errnos = handle.errno (); + current_error.errnos = (uint) errnos; + if (errnos != 0) { // download error details are set in cb_fetch - if (errno != Alpm.Errno.EXTERNAL_DOWNLOAD) { - current_error.details = { Alpm.strerror (errno) }; + if (errnos != Alpm.Errno.EXTERNAL_DOWNLOAD) { + current_error.details = { Alpm.strerror (errnos) }; } } } @@ -915,11 +915,11 @@ namespace Pamac { current_error = ErrorInfos (); cancellable.reset (); if (alpm_handle.trans_init (flags) == -1) { - Alpm.Errno errno = alpm_handle.errno (); - current_error.errno = (uint) errno; + Alpm.Errno errnos = alpm_handle.errno (); + current_error.errnos = (uint) errnos; current_error.message = _("Failed to init transaction"); - if (errno != 0) { - current_error.details = { Alpm.strerror (errno) }; + if (errnos != 0) { + current_error.details = { Alpm.strerror (errnos) }; } return false; } @@ -932,11 +932,11 @@ namespace Pamac { if (success) { add_ignorepkgs (); if (alpm_handle.trans_sysupgrade ((enable_downgrade) ? 1 : 0) == -1) { - Alpm.Errno errno = alpm_handle.errno (); - current_error.errno = (uint) errno; + Alpm.Errno errnos = alpm_handle.errno (); + current_error.errnos = (uint) errnos; current_error.message = _("Failed to prepare transaction"); - if (errno != 0) { - current_error.details = { Alpm.strerror (errno) }; + if (errnos != 0) { + current_error.details = { Alpm.strerror (errnos) }; } try { trans_release (lock_id); @@ -970,15 +970,15 @@ namespace Pamac { private bool trans_add_pkg_real (Alpm.Package pkg) { current_error = ErrorInfos (); if (alpm_handle.trans_add_pkg (pkg) == -1) { - Alpm.Errno errno = alpm_handle.errno (); - if (errno == Alpm.Errno.TRANS_DUP_TARGET || errno == Alpm.Errno.PKG_IGNORED) { + Alpm.Errno errnos = alpm_handle.errno (); + if (errnos == Alpm.Errno.TRANS_DUP_TARGET || errnos == Alpm.Errno.PKG_IGNORED) { // just skip duplicate or ignored targets return true; } else { - current_error.errno = (uint) errno; + current_error.errnos = (uint) errnos; current_error.message = _("Failed to prepare transaction"); - if (errno != 0) { - current_error.details = { "%s: %s".printf (pkg.name, Alpm.strerror (errno)) }; + if (errnos != 0) { + current_error.details = { "%s: %s".printf (pkg.name, Alpm.strerror (errnos)) }; } return false; } @@ -1050,23 +1050,23 @@ namespace Pamac { current_error = ErrorInfos (); Alpm.Package* pkg; if (alpm_handle.load_tarball (pkgpath, 1, alpm_handle.localfilesiglevel, out pkg) == -1) { - Alpm.Errno errno = alpm_handle.errno (); - current_error.errno = (uint) errno; + Alpm.Errno errnos = alpm_handle.errno (); + current_error.errnos = (uint) errnos; current_error.message = _("Failed to prepare transaction"); - if (errno != 0) { - current_error.details = { "%s: %s".printf (pkgpath, Alpm.strerror (errno)) }; + if (errnos != 0) { + current_error.details = { "%s: %s".printf (pkgpath, Alpm.strerror (errnos)) }; } return false; } else if (alpm_handle.trans_add_pkg (pkg) == -1) { - Alpm.Errno errno = alpm_handle.errno (); - if (errno == Alpm.Errno.TRANS_DUP_TARGET || errno == Alpm.Errno.PKG_IGNORED) { + Alpm.Errno errnos = alpm_handle.errno (); + if (errnos == Alpm.Errno.TRANS_DUP_TARGET || errnos == Alpm.Errno.PKG_IGNORED) { // just skip duplicate or ignored targets return true; } else { - current_error.errno = (uint) errno; + current_error.errnos = (uint) errnos; current_error.message = _("Failed to prepare transaction"); - if (errno != 0) { - current_error.details = { "%s: %s".printf (pkg->name, Alpm.strerror (errno)) }; + if (errnos != 0) { + current_error.details = { "%s: %s".printf (pkg->name, Alpm.strerror (errnos)) }; } // free the package because it will not be used delete pkg; @@ -1084,15 +1084,15 @@ namespace Pamac { current_error.details = { _("target not found: %s").printf (pkgname) }; return false; } else if (alpm_handle.trans_remove_pkg (pkg) == -1) { - Alpm.Errno errno = alpm_handle.errno (); - if (errno == Alpm.Errno.TRANS_DUP_TARGET) { + Alpm.Errno errnos = alpm_handle.errno (); + if (errnos == Alpm.Errno.TRANS_DUP_TARGET) { // just skip duplicate targets return true; } else { - current_error.errno = (uint) errno; + current_error.errnos = (uint) errnos; current_error.message = _("Failed to prepare transaction"); - if (errno != 0) { - current_error.details = { "%s: %s".printf (pkg.name, Alpm.strerror (errno)) }; + if (errnos != 0) { + current_error.details = { "%s: %s".printf (pkg.name, Alpm.strerror (errnos)) }; } return false; } @@ -1106,14 +1106,14 @@ namespace Pamac { string[] details = {}; Alpm.List err_data; if (alpm_handle.trans_prepare (out err_data) == -1) { - Alpm.Errno errno = alpm_handle.errno (); - current_error.errno = (uint) errno; + Alpm.Errno errnos = alpm_handle.errno (); + current_error.errnos = (uint) errnos; current_error.message = _("Failed to prepare transaction"); - switch (errno) { + switch (errnos) { case 0: break; case Alpm.Errno.PKG_INVALID_ARCH: - details += Alpm.strerror (errno) + ":"; + details += Alpm.strerror (errnos) + ":"; unowned Alpm.List list = err_data; while (list != null) { string* pkgname = list.data; @@ -1123,7 +1123,7 @@ namespace Pamac { } break; case Alpm.Errno.UNSATISFIED_DEPS: - details += Alpm.strerror (errno) + ":"; + details += Alpm.strerror (errnos) + ":"; unowned Alpm.List list = err_data; while (list != null) { Alpm.DepMissing* miss = list.data; @@ -1149,7 +1149,7 @@ namespace Pamac { } break; case Alpm.Errno.CONFLICTING_DEPS: - details += Alpm.strerror (errno) + ":"; + details += Alpm.strerror (errnos) + ":"; unowned Alpm.List list = err_data; while (list != null) { Alpm.Conflict* conflict = list.data; @@ -1164,7 +1164,7 @@ namespace Pamac { } break; default: - details += Alpm.strerror (errno); + details += Alpm.strerror (errnos); break; } current_error.details = (owned) details; @@ -1320,11 +1320,11 @@ namespace Pamac { current_error = ErrorInfos (); bool success = true; if (alpm_handle.trans_init (flags | Alpm.TransFlag.NOLOCK) == -1) { - Alpm.Errno errno = alpm_handle.errno (); - current_error.errno = (uint) errno; + Alpm.Errno errnos = alpm_handle.errno (); + current_error.errnos = (uint) errnos; current_error.message = _("Failed to init transaction"); - if (errno != 0) { - current_error.details = { Alpm.strerror (errno) }; + if (errnos != 0) { + current_error.details = { Alpm.strerror (errnos) }; } success = false; } @@ -1572,10 +1572,10 @@ namespace Pamac { bool success = true; Alpm.List err_data; if (alpm_handle.trans_commit (out err_data) == -1) { - Alpm.Errno errno = alpm_handle.errno (); - current_error.errno = (uint) errno; + Alpm.Errno errnos = alpm_handle.errno (); + current_error.errnos = (uint) errnos; // cancel the download return an EXTERNAL_DOWNLOAD error - if (errno == Alpm.Errno.EXTERNAL_DOWNLOAD && cancellable.is_cancelled ()) { + if (errnos == Alpm.Errno.EXTERNAL_DOWNLOAD && cancellable.is_cancelled ()) { try { trans_release (lock_id); } catch (IOError e) { @@ -1587,12 +1587,12 @@ namespace Pamac { return; } current_error.message = _("Failed to commit transaction"); - switch (errno) { + switch (errnos) { case 0: break; case Alpm.Errno.FILE_CONFLICTS: string[] details = {}; - details += Alpm.strerror (errno) + ":"; + details += Alpm.strerror (errnos) + ":"; //TransFlag flags = alpm_handle.trans_get_flags (); //if ((flags & TransFlag.FORCE) != 0) { //details += _("unable to %s directory-file conflicts").printf ("--force"); @@ -1617,7 +1617,7 @@ namespace Pamac { case Alpm.Errno.PKG_INVALID_CHECKSUM: case Alpm.Errno.PKG_INVALID_SIG: string[] details = {}; - details += Alpm.strerror (errno) + ":"; + details += Alpm.strerror (errnos) + ":"; unowned Alpm.List list = err_data; while (list != null) { string* filename = list.data; @@ -1631,7 +1631,7 @@ namespace Pamac { // details are set in cb_fetch break; default: - current_error.details = {Alpm.strerror (errno)}; + current_error.details = {Alpm.strerror (errnos)}; break; } success = false; diff --git a/src/transaction.vala b/src/transaction.vala index 2d60a85..c5f3f65 100644 --- a/src/transaction.vala +++ b/src/transaction.vala @@ -2037,7 +2037,7 @@ namespace Pamac { // if it is an authentication or a download error, database was not modified var err = get_current_error (); if (err.message == dgettext (null, "Authentication failed") - || err.errno == 54) { //Alpm.Errno.EXTERNAL_DOWNLOAD + || err.errnos == 54) { //Alpm.Errno.EXTERNAL_DOWNLOAD // recover old pkgnames foreach (unowned string name in previous_to_install) { to_install.add (name);