Re: [pacman-dev] Unusable pacman-key help by default

2011-03-28 Thread Ivan c00kiemon5ter Kanak
On 28 March 2011 20:27, Dan McGee wrote: > This is not cool at all, patches welcome from anyone. :) > > dmcgee@clifden ~/projects/pacman (master) > $ ./scripts/pacman-key --help > mkdir: cannot create directory `/etc/pacman.d/gnupg': Permission denied > > Hi all, I'm pretty new here, so I'm not s

Re: [pacman-dev] [PATCH 4/4] Allow VerifySig to act as a default verification in [options]

2011-03-28 Thread Dan McGee
On Mon, Mar 28, 2011 at 2:53 PM, Dave Reisner wrote: > On Mon, Mar 28, 2011 at 09:34:57PM +0200, Rémy Oudompheng wrote: >> On Mon 28 March 2011 at 15:15 -0400, Dave Reisner wrote: >> > +/* GPG signature verification option */ >> > +typedef enum _pgp_verify_t { >> > +   PM_PGP_VERIFY_UNKNOWN, >> >

Re: [pacman-dev] [PATCH] alpm/handle.c: ensure handle is not NULL before proceeding

2011-03-28 Thread Dan McGee
On Mon, Mar 28, 2011 at 2:47 PM, Rémy Oudompheng wrote: > Many alpm_option_get/set_*() functions already check this > and set pm_errno to the right value, but not all, so > this improves consistency. > > Signed-off-by: Rémy Oudompheng > --- > +#define RET_ERR_VOID(err) do { pm_errno = (err); \ >

Re: [pacman-dev] [PATCH 4/4] Allow VerifySig to act as a default verification in [options]

2011-03-28 Thread Dave Reisner
On Mon, Mar 28, 2011 at 09:34:57PM +0200, Rémy Oudompheng wrote: > On Mon 28 March 2011 at 15:15 -0400, Dave Reisner wrote: > > +/* GPG signature verification option */ > > +typedef enum _pgp_verify_t { > > + PM_PGP_VERIFY_UNKNOWN, > > + PM_PGP_VERIFY_ALWAYS, > > + PM_PGP_VERIFY_OPTIONAL, > >

Re: [pacman-dev] [PATCH] alpm/handle.c: ensure handle is not NULL before proceeding

2011-03-28 Thread Rémy Oudompheng
On Mon 28 March 2011 at 21:28 +0200, Xavier Chantry wrote: > On Mon, Mar 28, 2011 at 9:26 PM, Rémy Oudompheng > wrote: > > On 2011/3/28 Rémy Oudompheng wrote: > >> Many alpm_option_get/set_*() functions already check this > >> and set pm_errno to the right value, but not all, so > >> this improve

[pacman-dev] [PATCH] alpm/handle.c: ensure handle is not NULL before proceeding

2011-03-28 Thread Rémy Oudompheng
Many alpm_option_get/set_*() functions already check this and set pm_errno to the right value, but not all, so this improves consistency. Signed-off-by: Rémy Oudompheng --- lib/libalpm/handle.c | 23 +++ lib/libalpm/util.h |4 2 files changed, 27 insertions(+), 0

Re: [pacman-dev] [PATCH 4/4] Allow VerifySig to act as a default verification in [options]

2011-03-28 Thread Rémy Oudompheng
On Mon 28 March 2011 at 15:15 -0400, Dave Reisner wrote: > +/* GPG signature verification option */ > +typedef enum _pgp_verify_t { > + PM_PGP_VERIFY_UNKNOWN, > + PM_PGP_VERIFY_ALWAYS, > + PM_PGP_VERIFY_OPTIONAL, > + PM_PGP_VERIFY_NEVER > +} pgp_verify_t; > + > +int alpm_db_set_pgp_

Re: [pacman-dev] [PATCH] alpm/handle.c: ensure handle is not NULL before proceeding

2011-03-28 Thread Xavier Chantry
On Mon, Mar 28, 2011 at 9:26 PM, Rémy Oudompheng wrote: > On 2011/3/28 Rémy Oudompheng wrote: >> Many alpm_option_get/set_*() functions already check this >> and set pm_errno to the right value, but not all, so >> this improves consistency. > > I just noticed the ASSERT..RET_ERR construct, should

Re: [pacman-dev] [PATCH] alpm/handle.c: ensure handle is not NULL before proceeding

2011-03-28 Thread Rémy Oudompheng
On 2011/3/28 Rémy Oudompheng wrote: > Many alpm_option_get/set_*() functions already check this > and set pm_errno to the right value, but not all, so > this improves consistency. I just noticed the ASSERT..RET_ERR construct, should it be the preferred way of implementing such things ? -- Rémy.

Re: [pacman-dev] [PATCH 1/4] lib/handle: add get/set methods for useragent

2011-03-28 Thread Rémy Oudompheng
On 2011/3/28 Dave Reisner wrote: > @@ -597,4 +598,18 @@ void SYMEXPORT alpm_option_set_checkspace(int checkspace) >        handle->checkspace = checkspace; >  } > > +void SYMEXPORT alpm_option_set_useragent(char *useragent) > +{ > +       if(handle == NULL) { > +               pm_errno = PM_ERR_HA

[pacman-dev] [PATCH] alpm/handle.c: ensure handle is not NULL before proceeding

2011-03-28 Thread Rémy Oudompheng
Many alpm_option_get/set_*() functions already check this and set pm_errno to the right value, but not all, so this improves consistency. Signed-off-by: Rémy Oudompheng --- lib/libalpm/handle.c | 80 ++ 1 files changed, 80 insertions(+), 0 deleti

[pacman-dev] [PATCH 4/4] Allow VerifySig to act as a default verification in [options]

2011-03-28 Thread Dave Reisner
* add _alpm_get_sigverify_level * add alpm_option_{get,set}_default_sigverify This requires moving around protos in alpm.h so that pgp_verify_t is known to the get/set methods for default_sigverify. Signed-off-by: Dave Reisner --- lib/libalpm/alpm.h| 36 ---

[pacman-dev] [PATCH 2/4] pacman: use alpm method to set useragent

2011-03-28 Thread Dave Reisner
The call for this needs to be done a little later now since it requires that the handle be initialized. Signed-off-by: Dave Reisner --- src/pacman/pacman.c | 12 ++-- 1 files changed, 6 insertions(+), 6 deletions(-) diff --git a/src/pacman/pacman.c b/src/pacman/pacman.c index eac9c9c.

[pacman-dev] [PATCH 3/4] lib/dload: major refactor of signature downloading

2011-03-28 Thread Dave Reisner
There's a lot of related moving parts here: * iteration through mirrors is moved back to the calling functions. this allows removal of _alpm_download_single_file and _alpm_download_files * rename download => _alpm_download. also modified to accept an extra arg of type pgp_verify_t which is pass

[pacman-dev] [PATCH 0/4] addition of API methods and backend work

2011-03-28 Thread Dave Reisner
I've had the ensuing patches on my tree for a few days. A quick outline of what they accomplish: 1) Replace the old libfetch method of setting useragent (via an environment var) with proper get/set methods. 2) Refactor signature downloading to ensure that the sig file is downloaded from the same m

[pacman-dev] [PATCH 1/4] lib/handle: add get/set methods for useragent

2011-03-28 Thread Dave Reisner
Signed-off-by: Dave Reisner --- lib/libalpm/alpm.h |3 +++ lib/libalpm/dload.c |4 ++-- lib/libalpm/handle.c | 15 +++ lib/libalpm/handle.h |1 + 4 files changed, 21 insertions(+), 2 deletions(-) diff --git a/lib/libalpm/alpm.h b/lib/libalpm/alpm.h index b08191d..43f

[pacman-dev] [PATCH] Only try to create keyring directory when root

2011-03-28 Thread Ray Kohler
If we try and fail to create it, the -e flag to bash will make --help and --version break. Signed-off-by: Ray Kohler --- scripts/pacman-key.sh.in |2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/scripts/pacman-key.sh.in b/scripts/pacman-key.sh.in index 89e52fc..057b3bb 1

[pacman-dev] Unusable pacman-key help by default

2011-03-28 Thread Dan McGee
This is not cool at all, patches welcome from anyone. :) dmcgee@clifden ~/projects/pacman (master) $ ./scripts/pacman-key --help mkdir: cannot create directory `/etc/pacman.d/gnupg': Permission denied