[pacman-dev] [PATCH] libalpm: remove unused error value
--- lib/libalpm/alpm.h | 2 -- lib/libalpm/error.c | 2 -- 2 files changed, 4 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index c4acc062..a5f4a6ae 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -292,8 +292,6 @@ typedef enum _alpm_errno_t { ALPM_ERR_PKG_INVALID_NAME, /** Package has an invalid architecture */ ALPM_ERR_PKG_INVALID_ARCH, - /** Unused */ - ALPM_ERR_PKG_REPO_NOT_FOUND, /* Signatures */ /** Signatures are missing */ ALPM_ERR_SIG_MISSING, diff --git a/lib/libalpm/error.c b/lib/libalpm/error.c index c06d091a..c1a16cee 100644 --- a/lib/libalpm/error.c +++ b/lib/libalpm/error.c @@ -125,8 +125,6 @@ const char SYMEXPORT *alpm_strerror(alpm_errno_t err) return _("package filename is not valid"); case ALPM_ERR_PKG_INVALID_ARCH: return _("package architecture is not valid"); - case ALPM_ERR_PKG_REPO_NOT_FOUND: - return _("could not find repository for target"); /* Signatures */ case ALPM_ERR_SIG_MISSING: return _("missing PGP signature"); -- 2.31.1
On 18/5/21 7:25 am, morganamilo wrote:
--- lib/libalpm/alpm.h | 2 -- lib/libalpm/error.c | 2 -- 2 files changed, 4 deletions(-)
diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index c4acc062..a5f4a6ae 100644 --- a/lib/libalpm/alpm.h +++ b/lib/libalpm/alpm.h @@ -292,8 +292,6 @@ typedef enum _alpm_errno_t { ALPM_ERR_PKG_INVALID_NAME, /** Package has an invalid architecture */ ALPM_ERR_PKG_INVALID_ARCH, - /** Unused */ - ALPM_ERR_PKG_REPO_NOT_FOUND,
My guess is this was (and probably should be) used for "pacman -S bar/foo". That currently gives: error: database not found: bar Allan
On 17 May 2021 11:00 pm, Allan McRae <allan@archlinux.org> wrote: On 18/5/21 7:25 am, morganamilo wrote: > --- > lib/libalpm/alpm.h | 2 -- > lib/libalpm/error.c | 2 -- > 2 files changed, 4 deletions(-) > > diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h > index c4acc062..a5f4a6ae 100644 > --- a/lib/libalpm/alpm.h > +++ b/lib/libalpm/alpm.h > @@ -292,8 +292,6 @@ typedef enum _alpm_errno_t { > ALPM_ERR_PKG_INVALID_NAME, > /** Package has an invalid architecture */ > ALPM_ERR_PKG_INVALID_ARCH, > - /** Unused */ > - ALPM_ERR_PKG_REPO_NOT_FOUND, My guess is this was (and probably should be) used for "pacman -S bar/foo". That currently gives: error: database not found: bar Allan Should it? I find the current error message totally sufficient.
On 18/5/21 11:02 am, Morgan Adamiec wrote:
On 17 May 2021 11:00 pm, Allan McRae <allan@archlinux.org> wrote:
On 18/5/21 7:25 am, morganamilo wrote: > --- > lib/libalpm/alpm.h | 2 -- > lib/libalpm/error.c | 2 -- > 2 files changed, 4 deletions(-) > > diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h > index c4acc062..a5f4a6ae 100644 > --- a/lib/libalpm/alpm.h > +++ b/lib/libalpm/alpm.h > @@ -292,8 +292,6 @@ typedef enum _alpm_errno_t { > ALPM_ERR_PKG_INVALID_NAME, > /** Package has an invalid architecture */ > ALPM_ERR_PKG_INVALID_ARCH, > - /** Unused */ > - ALPM_ERR_PKG_REPO_NOT_FOUND, My guess is this was (and probably should be) used for "pacman -S bar/foo". That currently gives: error: database not found: bar Allan
Should it? I find the current error message totally sufficient.
The error message not used is "could not find repository for target", which is accurate. We don't know the repository. We could know the repo but not have a database downloaded, which would be the "database not found" error.
On 18/05/2021 02:15, Allan McRae wrote:
On 18/5/21 11:02 am, Morgan Adamiec wrote:
On 17 May 2021 11:00 pm, Allan McRae <allan@archlinux.org> wrote:
On 18/5/21 7:25 am, morganamilo wrote: > --- > lib/libalpm/alpm.h | 2 -- > lib/libalpm/error.c | 2 -- > 2 files changed, 4 deletions(-) > > diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h > index c4acc062..a5f4a6ae 100644 > --- a/lib/libalpm/alpm.h > +++ b/lib/libalpm/alpm.h > @@ -292,8 +292,6 @@ typedef enum _alpm_errno_t { > ALPM_ERR_PKG_INVALID_NAME, > /** Package has an invalid architecture */ > ALPM_ERR_PKG_INVALID_ARCH, > - /** Unused */ > - ALPM_ERR_PKG_REPO_NOT_FOUND, My guess is this was (and probably should be) used for "pacman -S bar/foo". That currently gives: error: database not found: bar Allan
Should it? I find the current error message totally sufficient.
The error message not used is "could not find repository for target", which is accurate. We don't know the repository. We could know the repo but not have a database downloaded, which would be the "database not found" error.
I still see it as fine. Though if we do really want to change the error then that's on pacman's side as it does the target processing. So this should be removed either way.
participants (3)
-
Allan McRae
-
Morgan Adamiec
-
morganamilo