Commit 24821922 authored by Bernhard Link's avatar Bernhard Link

add new 'flood' command to distribute architecture all packages within one...

add new 'flood' command to distribute architecture all packages within one architecture (still missing tracking support)
parent 4164f417
2009-08-17
* add new 'flood' command to distribute architecture all packages
within one architecture (still missing tracking support).
2009-08-15
* -A, -T and -C can now have multiple arguments separated by '|'.
......
......@@ -18,14 +18,14 @@ AM_CPPFLAGS = -std=gnu99 -Wall $(ARCHIVECPP) $(DBCPPFLAGS)
reprepro_LDADD = $(ARCHIVELIBS) $(DBLIBS)
changestool_LDADD = $(ARCHIVELIBS)
reprepro_SOURCES = needbuild.c globmatch.c printlistformat.c diffindex.c rredpatch.c pool.c atoms.c uncompression.c remoterepository.c indexfile.c copypackages.c sourceextraction.c checksums.c readtextfile.c filecntl.c sha1.c sha256.c configparser.c database.c freespace.c log.c changes.c incoming.c uploaderslist.c guesscomponent.c files.c md5.c dirs.c chunks.c reference.c binaries.c sources.c checks.c names.c dpkgversions.c release.c mprintf.c updates.c strlist.c signature_check.c signature.c distribution.c checkindeb.c checkindsc.c checkin.c upgradelist.c target.c aptmethod.c downloadcache.c main.c override.c terms.c termdecide.c ignore.c filterlist.c exports.c tracking.c optionsfile.c readrelease.c donefile.c pull.c contents.c filelist.c $(ARCHIVE_USED) $(ARCHIVE_CONTENTS)
reprepro_SOURCES = archallflood.c needbuild.c globmatch.c printlistformat.c diffindex.c rredpatch.c pool.c atoms.c uncompression.c remoterepository.c indexfile.c copypackages.c sourceextraction.c checksums.c readtextfile.c filecntl.c sha1.c sha256.c configparser.c database.c freespace.c log.c changes.c incoming.c uploaderslist.c guesscomponent.c files.c md5.c dirs.c chunks.c reference.c binaries.c sources.c checks.c names.c dpkgversions.c release.c mprintf.c updates.c strlist.c signature_check.c signature.c distribution.c checkindeb.c checkindsc.c checkin.c upgradelist.c target.c aptmethod.c downloadcache.c main.c override.c terms.c termdecide.c ignore.c filterlist.c exports.c tracking.c optionsfile.c readrelease.c donefile.c pull.c contents.c filelist.c $(ARCHIVE_USED) $(ARCHIVE_CONTENTS)
EXTRA_reprepro_SOURCE = $(ARCHIVE_UNUSED)
changestool_SOURCES = uncompression.c sourceextraction.c readtextfile.c filecntl.c tool.c chunkedit.c strlist.c checksums.c sha1.c sha256.c md5.c mprintf.c chunks.c signature.c dirs.c names.c $(ARCHIVE_USED)
rredtool_SOURCES = rredtool.c rredpatch.c
noinst_HEADERS = needbuild.h globmatch.h printlistformat.h pool.h atoms.h uncompression.h remoterepository.h copypackages.h sourceextraction.h checksums.h readtextfile.h filecntl.h sha1.h sha256.h configparser.h database_p.h database.h freespace.h log.h changes.h incoming.h guesscomponent.h md5.h dirs.h files.h chunks.h reference.h binaries.h sources.h checks.h names.h release.h error.h mprintf.h updates.h strlist.h signature.h signature_p.h distribution.h debfile.h checkindeb.h checkindsc.h upgradelist.h target.h aptmethod.h downloadcache.h override.h terms.h termdecide.h ignore.h filterlist.h dpkgversions.h checkin.h exports.h globals.h tracking.h trackingt.h optionsfile.h readrelease.h donefile.h pull.h ar.h filelist.h contents.h chunkedit.h uploaderslist.h indexfile.h rredpatch.h diffindex.h
noinst_HEADERS = archallflood.h needbuild.h globmatch.h printlistformat.h pool.h atoms.h uncompression.h remoterepository.h copypackages.h sourceextraction.h checksums.h readtextfile.h filecntl.h sha1.h sha256.h configparser.h database_p.h database.h freespace.h log.h changes.h incoming.h guesscomponent.h md5.h dirs.h files.h chunks.h reference.h binaries.h sources.h checks.h names.h release.h error.h mprintf.h updates.h strlist.h signature.h signature_p.h distribution.h debfile.h checkindeb.h checkindsc.h upgradelist.h target.h aptmethod.h downloadcache.h override.h terms.h termdecide.h ignore.h filterlist.h dpkgversions.h checkin.h exports.h globals.h tracking.h trackingt.h optionsfile.h readrelease.h donefile.h pull.h ar.h filelist.h contents.h chunkedit.h uploaderslist.h indexfile.h rredpatch.h diffindex.h
MAINTAINERCLEANFILES = $(srcdir)/Makefile.in $(srcdir)/configure $(srcdir)/stamp-h.in $(srcdir)/aclocal.m4 $(srcdir)/config.h.in
......
This diff is collapsed.
#ifndef REPREPRO_ARCHALLFLOOD_H
#define REPREPRO_ARCHALLFLOOD_H
retvalue flood(struct distribution *d, /*@null@*/const struct atomlist */*components*/, /*@NULL@*/const struct atomlist */*architectures*/, /*@NULL@*/const struct atomlist */*packagetypes*/, architecture_t, struct database *, trackingdb);
#endif
......@@ -418,10 +418,43 @@ static retvalue warnidentifers(struct database *db, const struct strlist *identi
(void)fputs("To ignore use --ignore=undefinedtarget.\n", stderr);
return RET_ERROR;
}
if( readonly )
return RET_OK;
for( d = distributions ; d != NULL ; d = d->next ) {
// TODO: check for new architectures here and warn then...
if( readonly )
continue;
bool architecture_existed[d->architectures.count];
/* check for new architectures */
memset(architecture_existed, 0, sizeof(architecture_existed));
for( t = d->targets; t != NULL ; t = t->next ) {
int i;
if( !t->existed )
continue;
i = atomlist_ofs(&d->architectures,
t->architecture_atom);
assert( i >= 0 );
if( i >= 0 )
architecture_existed[i] = true;
}
for( i = 0 ; i < d->architectures.count ; i++ ) {
architecture_t a;
if( architecture_existed[i] )
continue;
a = d->architectures.atoms[i];
fprintf(stderr,
"New architecture '%s' in '%s'. Perhaps you want to call\n"
"reprepro flood '%s' '%s'\n"
"to populate it with architecture 'all' packages from other architectures.\n",
atoms_architectures[a], d->codename,
d->codename, atoms_architectures[a]);
}
/* create databases, so we know next time what is new */
for( t = d->targets; t != NULL ; t = t->next ) {
if( t->existed )
continue;
......
.TH REPREPRO 1 "2009-07-09" "reprepro" REPREPRO
.TH REPREPRO 1 "2009-08-17" "reprepro" REPREPRO
.SH NAME
reprepro \- produce, manage and sync a local repository of Debian packages
.SH SYNOPSIS
......@@ -820,6 +820,21 @@ into the new format used since reprepro 3.0.0.
Make sure you have at least half of the space of the current
.IB db /contents.cache.db
file size available in that partition.
.TP
.B flood \fIdistribution\fP \fR[\fParchitecture\fR]\fP
For each architecture of \fIdistribution\fP or for the one specified
add architecture \fBall\fP packages from another architectures
(but the same component or packagetype) under the following conditions:
Packages are only upgraded, never downgraded.
If there is a package not being architecture \fPall\fP,
then architecture \fBall\fP packages of the same source from the same
source version are prefered over those that have no such binary sibling.
Otherwise the package with the highest version wins.
You can restrict with architectures are looked for architecture \fPall\fP
packages using \fB\-A\fP and which components/packagetypes are flooded by
\fB\-C\fP/\fB\-T\fP as usual.
.SS internal commands
These are hopefully never needed, but allow manual intervention.
.B WARNING:
......
......@@ -69,6 +69,7 @@
#include "printlistformat.h"
#include "globmatch.h"
#include "needbuild.h"
#include "archallflood.h"
#ifndef STD_BASE_DIR
#define STD_BASE_DIR "."
......@@ -3076,6 +3077,74 @@ ACTION_B(y, n, y, rerunnotifiers) {
return result;
}
/*********************** flood ****************************/
ACTION_D(y, n, y, flood) {
retvalue result,r;
struct distribution *distribution;
trackingdb tracks;
component_t architecture = atom_unknown;
result = distribution_get(alldistributions, argv[1], true, &distribution);
assert( result != RET_NOTHING );
if( RET_WAS_ERROR(result) )
return result;
if( distribution->readonly ) {
fprintf(stderr, "Cannot add packages to read-only distribution '%s'.\n",
distribution->codename);
return RET_ERROR;
}
if( argc == 3 ) {
architecture = architecture_find(argv[2]);
if( !atom_defined(architecture) ) {
fprintf(stderr, "Error: Unknown architecture '%s'!\n",
argv[2]);
return RET_ERROR;
}
if( architecture == architecture_source ) {
fprintf(stderr,
"Error: Architecture 'source' does not make sense with 'flood'!\n");
return RET_ERROR;
}
if( !atomlist_in(&distribution->architectures, architecture) ) {
fprintf(stderr,
"Error: Architecture '%s' not part of '%s'!\n",
argv[2], distribution->codename);
return RET_ERROR;
}
}
result = distribution_prepareforwriting(distribution);
if( RET_WAS_ERROR(result) ) {
return result;
}
if( distribution->tracking != dt_NONE ) {
result = tracking_initialize(&tracks, database, distribution, false);
if( RET_WAS_ERROR(result) ) {
return result;
}
} else
tracks = NULL;
result = flood(distribution, components, architectures, packagetypes,
architecture, database, tracks);
logger_wait();
if( RET_WAS_ERROR(result) )
RET_UPDATE(distribution->status, result);
if( tracks != NULL ) {
r = tracking_done(tracks);
RET_ENDUPDATE(result, r);
}
r = distribution_export(export, distribution, database);
RET_ENDUPDATE(result, r);
return result;
}
/*********************/
/* argument handling */
/*********************/
......@@ -3268,6 +3337,8 @@ static const struct action {
0, 0, "cleanlists"},
{"build-needing", A_ROBact(buildneeded),
2, 3, "[-C <component>] build-needing <codename> <architecture> [<glob>]"},
{"flood", A_Dact(flood)|MAY_UNUSED,
1, 2, "[-C <component> ] [-A <architecture>] [-T <packagetype>] flood <codename> [<architecture>]"},
{NULL,NULL,0,0,0,NULL}
};
#undef A_N
......
......@@ -12,6 +12,7 @@ testchecksums.sh \
testcopy.sh \
testexporthooks.sh \
testflat.sh \
testflood.sh \
testincludeextra.sh \
testlayeredupdate.sh \
testlayeredupdate2.sh \
......
......@@ -4,6 +4,7 @@ set -e
source $(dirname $0)/test.inc
runtest flood
runtest exporthooks
runtest updatecorners
runtest packagediff
......
This diff is collapsed.
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