[pacman-dev] [PATCH] A variety of small changes

Allan McRae mcrae_allan at hotmail.com
Mon May 19 09:20:23 EDT 2008


Xavier wrote:
> On Mon, May 19, 2008 at 1:57 PM, Allan McRae <mcrae_allan at hotmail.com> wrote:
>   
>> 1. makepkg - Reduces the missing arch error to a warning when only
>> generating intergity checks (-g or --geninteg flag)
>>
>> 2. libalpm - remove unused handle->uid from pmhandle_t.  The need to
>> check permissions should be determined by the frontend (and is in pacman).
>>
>> 3. libalpm - fix comment on noextract in pmhandle_t.
>>
>> Signed-off-by: Allan McRae <mcrae_allan at hotmail.com>
>> ---
>>  lib/libalpm/handle.c  |    2 --
>>  lib/libalpm/handle.h  |    3 +--
>>  scripts/makepkg.sh.in |    2 +-
>>  3 files changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/lib/libalpm/handle.c b/lib/libalpm/handle.c
>> index 5f209d4..94317bf 100644
>> --- a/lib/libalpm/handle.c
>> +++ b/lib/libalpm/handle.c
>> @@ -23,7 +23,6 @@
>>
>>  #include <stdlib.h>
>>  #include <string.h>
>> -#include <unistd.h>
>>  #include <limits.h>
>>  #include <sys/types.h>
>>  #include <syslog.h>
>> @@ -54,7 +53,6 @@ pmhandle_t *_alpm_handle_new()
>>        handle->logstream = NULL;
>>
>>        /* see if we're root or not */
>> -       handle->uid = geteuid();
>>        handle->root = NULL;
>>        handle->dbpath = NULL;
>>        handle->cachedirs = NULL;
>>     
>
>
> Maybe the comment should go as well?
>
>   

O_o maybe it should!

>   
>> diff --git a/lib/libalpm/handle.h b/lib/libalpm/handle.h
>> index 5051917..9c537b1 100644
>> --- a/lib/libalpm/handle.h
>> +++ b/lib/libalpm/handle.h
>> @@ -30,7 +30,6 @@
>>
>>  typedef struct _pmhandle_t {
>>        /* internal usage */
>> -       uid_t uid;              /* current UID */ /* TODO is this used? */
>>        pmdb_t *db_local;       /* local db pointer */
>>        alpm_list_t *dbs_sync;  /* List of (pmdb_t *) */
>>        FILE *logstream;        /* log file stream pointer */
>> @@ -50,7 +49,7 @@ typedef struct _pmhandle_t {
>>
>>        /* package lists */
>>        alpm_list_t *noupgrade;   /* List of packages NOT to be upgraded */
>> -       alpm_list_t *noextract;   /* List of packages NOT to extract */ /*TODO is this used?*/
>> +       alpm_list_t *noextract;   /* List of files NOT to extract */
>>        alpm_list_t *ignorepkg;   /* List of packages to ignore */
>>        alpm_list_t *holdpkg;     /* List of packages which 'hold' pacman */
>>        alpm_list_t *ignoregrp;   /* List of groups to ignore */
>>     
>
>
> I wonder if NoUpgrade and NoExtract could not be somehow combined.
> But this requires a discussion to know in which situation these are
> used (I use none of them ...).
>
>
>   

I don't either but when looking into making the pactests, they do serve 
slightly different purposes....   Maybe similar enough to combine 
though.  In fact, at first I thought NoExtract should do things 
NoUpgrade does. I have added this to my TODO list so I will remember to 
look into it later.

>> diff --git a/scripts/makepkg.sh.in b/scripts/makepkg.sh.in
>> index cc44c68..8009ef0 100644
>> --- a/scripts/makepkg.sh.in
>> +++ b/scripts/makepkg.sh.in
>> @@ -1315,7 +1315,7 @@ if [ "$arch" = 'any' ]; then
>>  fi
>>
>>  if ! in_array $CARCH ${arch[@]}; then
>> -       if [ "$IGNOREARCH" = "0" ]; then
>> +       if [ "$IGNOREARCH" = "0"  -o "$GENINTEG" = "1" ]; then
>>                error "$(gettext "%s is not available for the '%s' architecture.")" "$pkgname" "$CARCH"
>>                plain "$(gettext "Note that many packages may need a line added to their %s")" "$BUILDSCRIPT"
>>                plain "$(gettext "such as arch=('%s').")" "$CARCH"
>>     
>
>
> I really don't understand the logic here :)
>   

I will add a comment there.  Essentially, if we are only generating 
integrity checks, then we don't care if the arch line is missing.  Well, 
at least not error level care.  Maybe in that case a warning should 
still be printed. Opinions?

Allan






More information about the pacman-dev mailing list