fix vala 0.48 build

This commit is contained in:
Chris Cromer 2020-03-12 21:22:12 -03:00
parent 9b9880e65d
commit d3fe4c0bae
Signed by untrusted user: cromer
GPG Key ID: 39CC813FF3C8708A
3 changed files with 52 additions and 52 deletions

View File

@ -51,7 +51,7 @@ namespace Pamac {
} }
public struct ErrorInfos { public struct ErrorInfos {
public uint errno; public uint errnos;
public string message; public string message;
public string[] details; public string[] details;
public ErrorInfos () { public ErrorInfos () {

View File

@ -485,12 +485,12 @@ namespace Pamac {
// fail later with unresolved deps, but that should be rare, and would be expected // fail later with unresolved deps, but that should be rare, and would be expected
success = true; success = true;
} else { } else {
Alpm.Errno errno = handle.errno (); Alpm.Errno errnos = handle.errno ();
current_error.errno = (uint) errno; current_error.errnos = (uint) errnos;
if (errno != 0) { if (errnos != 0) {
// download error details are set in cb_fetch // download error details are set in cb_fetch
if (errno != Alpm.Errno.EXTERNAL_DOWNLOAD) { if (errnos != Alpm.Errno.EXTERNAL_DOWNLOAD) {
current_error.details = { Alpm.strerror (errno) }; current_error.details = { Alpm.strerror (errnos) };
} }
} }
} }
@ -915,11 +915,11 @@ namespace Pamac {
current_error = ErrorInfos (); current_error = ErrorInfos ();
cancellable.reset (); cancellable.reset ();
if (alpm_handle.trans_init (flags) == -1) { if (alpm_handle.trans_init (flags) == -1) {
Alpm.Errno errno = alpm_handle.errno (); Alpm.Errno errnos = alpm_handle.errno ();
current_error.errno = (uint) errno; current_error.errnos = (uint) errnos;
current_error.message = _("Failed to init transaction"); current_error.message = _("Failed to init transaction");
if (errno != 0) { if (errnos != 0) {
current_error.details = { Alpm.strerror (errno) }; current_error.details = { Alpm.strerror (errnos) };
} }
return false; return false;
} }
@ -932,11 +932,11 @@ namespace Pamac {
if (success) { if (success) {
add_ignorepkgs (); add_ignorepkgs ();
if (alpm_handle.trans_sysupgrade ((enable_downgrade) ? 1 : 0) == -1) { if (alpm_handle.trans_sysupgrade ((enable_downgrade) ? 1 : 0) == -1) {
Alpm.Errno errno = alpm_handle.errno (); Alpm.Errno errnos = alpm_handle.errno ();
current_error.errno = (uint) errno; current_error.errnos = (uint) errnos;
current_error.message = _("Failed to prepare transaction"); current_error.message = _("Failed to prepare transaction");
if (errno != 0) { if (errnos != 0) {
current_error.details = { Alpm.strerror (errno) }; current_error.details = { Alpm.strerror (errnos) };
} }
try { try {
trans_release (lock_id); trans_release (lock_id);
@ -970,15 +970,15 @@ namespace Pamac {
private bool trans_add_pkg_real (Alpm.Package pkg) { private bool trans_add_pkg_real (Alpm.Package pkg) {
current_error = ErrorInfos (); current_error = ErrorInfos ();
if (alpm_handle.trans_add_pkg (pkg) == -1) { if (alpm_handle.trans_add_pkg (pkg) == -1) {
Alpm.Errno errno = alpm_handle.errno (); Alpm.Errno errnos = alpm_handle.errno ();
if (errno == Alpm.Errno.TRANS_DUP_TARGET || errno == Alpm.Errno.PKG_IGNORED) { if (errnos == Alpm.Errno.TRANS_DUP_TARGET || errnos == Alpm.Errno.PKG_IGNORED) {
// just skip duplicate or ignored targets // just skip duplicate or ignored targets
return true; return true;
} else { } else {
current_error.errno = (uint) errno; current_error.errnos = (uint) errnos;
current_error.message = _("Failed to prepare transaction"); current_error.message = _("Failed to prepare transaction");
if (errno != 0) { if (errnos != 0) {
current_error.details = { "%s: %s".printf (pkg.name, Alpm.strerror (errno)) }; current_error.details = { "%s: %s".printf (pkg.name, Alpm.strerror (errnos)) };
} }
return false; return false;
} }
@ -1050,23 +1050,23 @@ namespace Pamac {
current_error = ErrorInfos (); current_error = ErrorInfos ();
Alpm.Package* pkg; Alpm.Package* pkg;
if (alpm_handle.load_tarball (pkgpath, 1, alpm_handle.localfilesiglevel, out pkg) == -1) { if (alpm_handle.load_tarball (pkgpath, 1, alpm_handle.localfilesiglevel, out pkg) == -1) {
Alpm.Errno errno = alpm_handle.errno (); Alpm.Errno errnos = alpm_handle.errno ();
current_error.errno = (uint) errno; current_error.errnos = (uint) errnos;
current_error.message = _("Failed to prepare transaction"); current_error.message = _("Failed to prepare transaction");
if (errno != 0) { if (errnos != 0) {
current_error.details = { "%s: %s".printf (pkgpath, Alpm.strerror (errno)) }; current_error.details = { "%s: %s".printf (pkgpath, Alpm.strerror (errnos)) };
} }
return false; return false;
} else if (alpm_handle.trans_add_pkg (pkg) == -1) { } else if (alpm_handle.trans_add_pkg (pkg) == -1) {
Alpm.Errno errno = alpm_handle.errno (); Alpm.Errno errnos = alpm_handle.errno ();
if (errno == Alpm.Errno.TRANS_DUP_TARGET || errno == Alpm.Errno.PKG_IGNORED) { if (errnos == Alpm.Errno.TRANS_DUP_TARGET || errnos == Alpm.Errno.PKG_IGNORED) {
// just skip duplicate or ignored targets // just skip duplicate or ignored targets
return true; return true;
} else { } else {
current_error.errno = (uint) errno; current_error.errnos = (uint) errnos;
current_error.message = _("Failed to prepare transaction"); current_error.message = _("Failed to prepare transaction");
if (errno != 0) { if (errnos != 0) {
current_error.details = { "%s: %s".printf (pkg->name, Alpm.strerror (errno)) }; current_error.details = { "%s: %s".printf (pkg->name, Alpm.strerror (errnos)) };
} }
// free the package because it will not be used // free the package because it will not be used
delete pkg; delete pkg;
@ -1084,15 +1084,15 @@ namespace Pamac {
current_error.details = { _("target not found: %s").printf (pkgname) }; current_error.details = { _("target not found: %s").printf (pkgname) };
return false; return false;
} else if (alpm_handle.trans_remove_pkg (pkg) == -1) { } else if (alpm_handle.trans_remove_pkg (pkg) == -1) {
Alpm.Errno errno = alpm_handle.errno (); Alpm.Errno errnos = alpm_handle.errno ();
if (errno == Alpm.Errno.TRANS_DUP_TARGET) { if (errnos == Alpm.Errno.TRANS_DUP_TARGET) {
// just skip duplicate targets // just skip duplicate targets
return true; return true;
} else { } else {
current_error.errno = (uint) errno; current_error.errnos = (uint) errnos;
current_error.message = _("Failed to prepare transaction"); current_error.message = _("Failed to prepare transaction");
if (errno != 0) { if (errnos != 0) {
current_error.details = { "%s: %s".printf (pkg.name, Alpm.strerror (errno)) }; current_error.details = { "%s: %s".printf (pkg.name, Alpm.strerror (errnos)) };
} }
return false; return false;
} }
@ -1106,14 +1106,14 @@ namespace Pamac {
string[] details = {}; string[] details = {};
Alpm.List err_data; Alpm.List err_data;
if (alpm_handle.trans_prepare (out err_data) == -1) { if (alpm_handle.trans_prepare (out err_data) == -1) {
Alpm.Errno errno = alpm_handle.errno (); Alpm.Errno errnos = alpm_handle.errno ();
current_error.errno = (uint) errno; current_error.errnos = (uint) errnos;
current_error.message = _("Failed to prepare transaction"); current_error.message = _("Failed to prepare transaction");
switch (errno) { switch (errnos) {
case 0: case 0:
break; break;
case Alpm.Errno.PKG_INVALID_ARCH: case Alpm.Errno.PKG_INVALID_ARCH:
details += Alpm.strerror (errno) + ":"; details += Alpm.strerror (errnos) + ":";
unowned Alpm.List<string*> list = err_data; unowned Alpm.List<string*> list = err_data;
while (list != null) { while (list != null) {
string* pkgname = list.data; string* pkgname = list.data;
@ -1123,7 +1123,7 @@ namespace Pamac {
} }
break; break;
case Alpm.Errno.UNSATISFIED_DEPS: case Alpm.Errno.UNSATISFIED_DEPS:
details += Alpm.strerror (errno) + ":"; details += Alpm.strerror (errnos) + ":";
unowned Alpm.List<Alpm.DepMissing*> list = err_data; unowned Alpm.List<Alpm.DepMissing*> list = err_data;
while (list != null) { while (list != null) {
Alpm.DepMissing* miss = list.data; Alpm.DepMissing* miss = list.data;
@ -1149,7 +1149,7 @@ namespace Pamac {
} }
break; break;
case Alpm.Errno.CONFLICTING_DEPS: case Alpm.Errno.CONFLICTING_DEPS:
details += Alpm.strerror (errno) + ":"; details += Alpm.strerror (errnos) + ":";
unowned Alpm.List<Alpm.Conflict*> list = err_data; unowned Alpm.List<Alpm.Conflict*> list = err_data;
while (list != null) { while (list != null) {
Alpm.Conflict* conflict = list.data; Alpm.Conflict* conflict = list.data;
@ -1164,7 +1164,7 @@ namespace Pamac {
} }
break; break;
default: default:
details += Alpm.strerror (errno); details += Alpm.strerror (errnos);
break; break;
} }
current_error.details = (owned) details; current_error.details = (owned) details;
@ -1320,11 +1320,11 @@ namespace Pamac {
current_error = ErrorInfos (); current_error = ErrorInfos ();
bool success = true; bool success = true;
if (alpm_handle.trans_init (flags | Alpm.TransFlag.NOLOCK) == -1) { if (alpm_handle.trans_init (flags | Alpm.TransFlag.NOLOCK) == -1) {
Alpm.Errno errno = alpm_handle.errno (); Alpm.Errno errnos = alpm_handle.errno ();
current_error.errno = (uint) errno; current_error.errnos = (uint) errnos;
current_error.message = _("Failed to init transaction"); current_error.message = _("Failed to init transaction");
if (errno != 0) { if (errnos != 0) {
current_error.details = { Alpm.strerror (errno) }; current_error.details = { Alpm.strerror (errnos) };
} }
success = false; success = false;
} }
@ -1572,10 +1572,10 @@ namespace Pamac {
bool success = true; bool success = true;
Alpm.List err_data; Alpm.List err_data;
if (alpm_handle.trans_commit (out err_data) == -1) { if (alpm_handle.trans_commit (out err_data) == -1) {
Alpm.Errno errno = alpm_handle.errno (); Alpm.Errno errnos = alpm_handle.errno ();
current_error.errno = (uint) errno; current_error.errnos = (uint) errnos;
// cancel the download return an EXTERNAL_DOWNLOAD error // 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 { try {
trans_release (lock_id); trans_release (lock_id);
} catch (IOError e) { } catch (IOError e) {
@ -1587,12 +1587,12 @@ namespace Pamac {
return; return;
} }
current_error.message = _("Failed to commit transaction"); current_error.message = _("Failed to commit transaction");
switch (errno) { switch (errnos) {
case 0: case 0:
break; break;
case Alpm.Errno.FILE_CONFLICTS: case Alpm.Errno.FILE_CONFLICTS:
string[] details = {}; string[] details = {};
details += Alpm.strerror (errno) + ":"; details += Alpm.strerror (errnos) + ":";
//TransFlag flags = alpm_handle.trans_get_flags (); //TransFlag flags = alpm_handle.trans_get_flags ();
//if ((flags & TransFlag.FORCE) != 0) { //if ((flags & TransFlag.FORCE) != 0) {
//details += _("unable to %s directory-file conflicts").printf ("--force"); //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_CHECKSUM:
case Alpm.Errno.PKG_INVALID_SIG: case Alpm.Errno.PKG_INVALID_SIG:
string[] details = {}; string[] details = {};
details += Alpm.strerror (errno) + ":"; details += Alpm.strerror (errnos) + ":";
unowned Alpm.List<string*> list = err_data; unowned Alpm.List<string*> list = err_data;
while (list != null) { while (list != null) {
string* filename = list.data; string* filename = list.data;
@ -1631,7 +1631,7 @@ namespace Pamac {
// details are set in cb_fetch // details are set in cb_fetch
break; break;
default: default:
current_error.details = {Alpm.strerror (errno)}; current_error.details = {Alpm.strerror (errnos)};
break; break;
} }
success = false; success = false;

View File

@ -2037,7 +2037,7 @@ namespace Pamac {
// if it is an authentication or a download error, database was not modified // if it is an authentication or a download error, database was not modified
var err = get_current_error (); var err = get_current_error ();
if (err.message == dgettext (null, "Authentication failed") if (err.message == dgettext (null, "Authentication failed")
|| err.errno == 54) { //Alpm.Errno.EXTERNAL_DOWNLOAD || err.errnos == 54) { //Alpm.Errno.EXTERNAL_DOWNLOAD
// recover old pkgnames // recover old pkgnames
foreach (unowned string name in previous_to_install) { foreach (unowned string name in previous_to_install) {
to_install.add (name); to_install.add (name);