Commit a6366e9e authored by Bernhard Link's avatar Bernhard Link

add special 'any' keyword to be used for architecture in build-needing

parent 63befe3e
2010-01-19
* build-needing takes 'any' instead of a architecture, too.
2010-12-18
* rredtool: produce .diff/Index files that reprepro can understand.
* warn if uploader files contains key ids too long to handle
......
.TH REPREPRO 1 "2011-12-18" "reprepro" REPREPRO
.TH REPREPRO 1 "2012-01-19" "reprepro" REPREPRO
.SH NAME
reprepro \- produce, manage and sync a local repository of Debian packages
.mso www.tmac
......@@ -890,6 +890,10 @@ of the given architecture built from that version of the source,
without a \fB.changes\fP or \fB.log\fP file for the given architecture,
with an Architecture field including \fBany\fP or the architecture and
at least one package in the Binary field not yet available.
If instead of \fIarchitecture\fP the term \fBany\fP is used,
all architectures are iterated and the architecture is printed as
fourth field in every line.
.TP
.B translatefilelists
Translate the file list cache within
......@@ -2474,7 +2478,7 @@ Report bugs or wishlist requests to the Debian BTS
or directly to
.MTO brlink@debian.org
.SH COPYRIGHT
Copyright \(co 2004,2005,2006,2007,2008,2009,2010,2011
Copyright \(co 2004,2005,2006,2007,2008,2009,2010,2011,2012
.URL http://www.brlink.eu "Bernhard R. Link"
.br
This is free software; see the source for copying conditions. There is NO
......
/* This file is part of "reprepro"
* Copyright (C) 2003,2004,2005,2006,2007,2008,2009,2011 Bernhard R. Link
* Copyright (C) 2003,2004,2005,2006,2007,2008,2009,2011,2012 Bernhard R. Link
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
......@@ -1048,6 +1048,7 @@ ACTION_B(y, n, y, buildneeded) {
struct distribution *distribution;
const char *glob;
architecture_t arch;
bool anyarchitecture;
if (architectures != NULL) {
fprintf(stderr,
......@@ -1065,16 +1066,21 @@ ACTION_B(y, n, y, buildneeded) {
else
glob = NULL;
arch = architecture_find(argv[2]);
if (!atom_defined(arch)) {
fprintf(stderr,
if (strcmp(argv[2], "any") == 0) {
anyarchitecture = true;
} else {
anyarchitecture = false;
arch = architecture_find(argv[2]);
if (!atom_defined(arch)) {
fprintf(stderr,
"Error: Architecture '%s' is not known!\n", argv[2]);
return RET_ERROR;
}
if (arch == architecture_source || arch == architecture_all) {
fprintf(stderr,
return RET_ERROR;
}
if (arch == architecture_source || arch == architecture_all) {
fprintf(stderr,
"Error: Architecture '%s' makes no sense for build-needing!\n", argv[2]);
return RET_ERROR;
return RET_ERROR;
}
}
r = distribution_get(alldistributions, argv[1], false, &distribution);
assert (r != RET_NOTHING);
......@@ -1087,15 +1093,28 @@ ACTION_B(y, n, y, buildneeded) {
distribution->codename);
return RET_ERROR;
}
if (!atomlist_in(&distribution->architectures, arch)) {
fprintf(stderr,
"Error: Architecture '%s' not found in distribution '%s'!\n", argv[2],
distribution->codename);
return RET_ERROR;
}
if (anyarchitecture) {
retvalue result = RET_NOTHING;
int i;
for (i = 0 ; i < distribution->architectures.count ; i++) {
r = find_needs_build(distribution,
distribution->architectures.atoms[i],
components, glob, true);
RET_UPDATE(result, r);
}
return result;
} else {
if (!atomlist_in(&distribution->architectures, arch)) {
fprintf(stderr,
"Error: Architecture '%s' not found in distribution '%s'!\n", argv[2],
distribution->codename);
return RET_ERROR;
}
return find_needs_build(distribution, arch, components, glob);
return find_needs_build(distribution, arch, components,
glob, false);
}
}
static retvalue list_in_target(struct target *target, const char *packagename) {
......
/* This file is part of "reprepro"
* Copyright (C) 2009 Bernhard R. Link
* Copyright (C) 2009,2012 Bernhard R. Link
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation.
......@@ -44,7 +44,7 @@
(i.e. architecture all) -> SKIP
*/
static retvalue tracked_source_needs_build(architecture_t architecture, const char *sourcename, const char *sourceversion, const char *dscfilename, const struct strlist *binary, const struct trackedpackage *tp) {
static retvalue tracked_source_needs_build(architecture_t architecture, const char *sourcename, const char *sourceversion, const char *dscfilename, const struct strlist *binary, const struct trackedpackage *tp, bool printarch) {
bool found_binary[binary->count];
const char *archstring = atoms_architectures[architecture];
size_t archstringlen= strlen(archstring);
......@@ -123,7 +123,12 @@ static retvalue tracked_source_needs_build(architecture_t architecture, const ch
packages that are lacking: */
for (i = 0 ; i < binary->count ; i++) {
if (!found_binary[i]) {
printf("%s %s %s\n",
if (printarch)
printf("%s %s %s %s\n",
sourcename, sourceversion,
dscfilename, archstring);
else
printf("%s %s %s\n",
sourcename, sourceversion,
dscfilename);
return RET_OK;
......@@ -136,6 +141,7 @@ static retvalue tracked_source_needs_build(architecture_t architecture, const ch
struct needbuild_data { architecture_t architecture;
trackingdb tracks;
/*@null@*/ const char *glob;
bool printarch;
};
static retvalue check_source_needs_build(struct distribution *distribution, struct target *target, const char *sourcename, const char *control, void *data) {
......@@ -215,7 +221,7 @@ static retvalue check_source_needs_build(struct distribution *distribution, stru
r = tracked_source_needs_build(
d->architecture, sourcename,
sourceversion, dscfilename,
&binary, tp);
&binary, tp, d->printarch);
trackedpackage_free(tp);
free(sourceversion);
strlist_done(&binary);
......@@ -235,12 +241,13 @@ static retvalue check_source_needs_build(struct distribution *distribution, stru
}
retvalue find_needs_build(struct distribution *distribution, architecture_t architecture, const struct atomlist *onlycomponents, const char *glob) {
retvalue find_needs_build(struct distribution *distribution, architecture_t architecture, const struct atomlist *onlycomponents, const char *glob, bool printarch) {
retvalue result, r;
struct needbuild_data d;
d.architecture = architecture;
d.glob = glob;
d.printarch = printarch;
if (distribution->tracking == dt_NONE) {
fprintf(stderr,
......
......@@ -11,6 +11,6 @@
#include "distribution.h"
#endif
retvalue find_needs_build(struct distribution *, architecture_t, const struct atomlist *, /*@null@*/const char *glob);
retvalue find_needs_build(struct distribution *, architecture_t, const struct atomlist *, /*@null@*/const char *glob, bool printarch);
#endif
......@@ -226,6 +226,11 @@ stdout
*=onlyonearch 1.0-1 pool/main/o/onlyonearch/onlyonearch_1.0-1.dsc
EOF
testrun - build-needing test any 3<<EOF
stdout
*=onlyonearch 1.0-1 pool/main/o/onlyonearch/onlyonearch_1.0-1.dsc abacus
EOF
testrun - --delete -C main includedeb test onearch_1.0-1_abacus.deb 3<<EOF
stderr
stdout
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment