Hi,

I think the patch as applies will not work for cowbuilder; but I
believe cowbuilder may be already broken in behavior. Would you want
to take a look ?


At Mon, 25 Apr 2011 02:04:32 +0200,
Mike Gabriel wrote:
> 
> diff --git a/parameter.c b/parameter.c
> index 1ae8eab..be522b2 100644
> --- a/parameter.c
> +++ b/parameter.c
> @@ -141,6 +141,10 @@ int load_config_file(const char* config, pbuilderconfig* 
> pc)
>             {
>               pc->debbuildopts=strdup(delim);
>             }
> +         else if (!strcmp(buf, "BINARY_ARCH"))
> +           {
> +             pc->binary_arch=1;
> +           }
>           else if (!strcmp(buf, "NO_COWDANCER_UPDATE"))
>             {
>               pc->no_cowdancer_update=1;
> @@ -196,6 +200,7 @@ int cpbuilder_dumpconfig(pbuilderconfig* pc)
>    DUMPSTR(distribution);
>    DUMPSTR(components);
>    DUMPSTR(debbuildopts);
> +  DUMPINT(binary_arch);
>    DUMPSTRARRAY(inputfile);
>    DUMPSTRARRAY(outputfile);
>    
> @@ -244,6 +249,7 @@ int parse_parameter(int ac, char** av,
>      {"distribution", required_argument, 0, 0},
>      {"components", required_argument, 0, 0},
>      {"debbuildopts", required_argument, 0, 0},
> +    {"binary-arch", no_argument, 0, 0},
>      {"inputfile", required_argument, 0, 0},
>      {"outputfile", required_argument, 0, 0},
>      {"architecture", required_argument, 0, 0},
> @@ -273,7 +279,6 @@ int parse_parameter(int ac, char** av,
>      {"removepackages", no_argument, 0, 'm'},
>      {"override-config", no_argument, 0, 'm'},
>      {"pkgname-logfile", no_argument, 0, 'm'},
> -    {"binary-arch", no_argument, 0, 'm'},
>      {"preserve-buildplace", no_argument, 0, 'm'},
>      {"autocleanaptcache", no_argument, 0, 'm'},
>  
> @@ -447,6 +452,11 @@ int parse_parameter(int ac, char** av,
>               /* pass it for cowbuilder */
>               PASS_TO_PBUILDER_WITH_PARAM
>             }
> +         else if (!strcmp(long_options[index_point].name,"binary-arch"))
> +           {
> +             pc.binary_arch=1;
> +             PBUILDER_ADD_PARAM(cmdstr);
> +           }
>           break;
>         case 'h':               /* -h */
>         case 'v':               /* -v --version */
> diff --git a/parameter.h b/parameter.h
> index 5bd253d..46adf4d 100644
> --- a/parameter.h
> +++ b/parameter.h
> @@ -38,6 +38,7 @@ typedef struct pbuilderconfig
>    char* distribution;
>    char* components;
>    char* debbuildopts;
> +  int binary_arch;
>  
>    /* files to be copied into the chroot, 
>       and copied out of the chroot */
> diff --git a/qemubuilder.c b/qemubuilder.c
> index ee58139..a5a02d0 100755
> --- a/qemubuilder.c
> +++ b/qemubuilder.c
> @@ -786,11 +786,21 @@ int cpbuilder_build(const struct pbuilderconfig* pc, 
> const char* dscfile)
>    char* hoststr=NULL;
>    char* hoststr2=NULL;
>    char* commandline=NULL;
> -
> -  const char* buildopt="--binary-all"; /* TODO: add --binary-arch option */
> -
> +  char* buildopt=NULL;
> +  char* debbuildopts=NULL;
> + 
> +  debbuildopts=pc->debbuildopts;
> +  if (pc->binary_arch) {
> +    buildopt="--binary-arch"; 
> +    asprintf(&debbuildopts,
> +            "%s -B", 
> +            debbuildopts);
> +  } else {
> +    buildopt="--binary-all";
> +  }
> + 
>    hoststr=copy_dscfile(dscfile, pc->buildplace);
> -
> + 
>    asprintf(&commandline,
>            /* TODO: executehooks D: */
>            "/usr/lib/pbuilder/pbuilder-satisfydepends --control 
> $PBUILDER_MOUNTPOINT/*.dsc --internal-chrootexec 'chroot . ' %s \n"
> @@ -800,7 +810,7 @@ int cpbuilder_build(const struct pbuilderconfig* pc, 
> const char* dscfile)
>            "cd $PBUILDER_MOUNTPOINT/*-*/; dpkg-buildpackage -us -uc %s\n",
>            buildopt,
>            dscfile,
> -          pc->debbuildopts);
> +          debbuildopts);
>  
>    /* Obscure assumption!: assume _ is significant for package name and
>       no other file will have _. */
> 
> 
> --=_misv7d7acht--



-- 
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]

Reply via email to