Commit 85b3295f authored by Bernhard Link's avatar Bernhard Link

Implemented switch to delete files after inclusion

parent ac8eb68a
......@@ -6,7 +6,6 @@ TODO:
(allow it needing a passphrase)
add support for removing packages automatically
when removed upstream. (downgrade too?)
switch to delete files after having included them.
implement filters for including only specific packages
add support for removal of files when vanishing from where we update...
......
......@@ -601,7 +601,7 @@ static retvalue changes_check(const char *filename,struct changes *changes,const
return r;
}
static retvalue changes_includefiles(filesdb filesdb,const char *component,const char *filename,struct changes *changes,int force) {
static retvalue changes_includefiles(filesdb filesdb,const char *component,const char *filename,struct changes *changes,int force,int delete) {
struct fileentry *e;
retvalue r;
char *sourcedir;
......@@ -620,7 +620,7 @@ static retvalue changes_includefiles(filesdb filesdb,const char *component,const
free(sourcedir);
return RET_ERROR_OOM;
}
r = files_checkinfile(filesdb,sourcedir,e->basename,e->filekey,e->md5sum);
r = files_includefile(filesdb,sourcedir,e->basename,e->filekey,e->md5sum,NULL,delete);
if( RET_WAS_ERROR(r) )
break;
e = e->next;
......@@ -633,6 +633,7 @@ static retvalue changes_includefiles(filesdb filesdb,const char *component,const
static retvalue changes_includepkgs(const char *dbdir,DB *references,filesdb filesdb,struct distribution *distribution,struct changes *changes,const struct overrideinfo *srcoverride,const struct overrideinfo *binoverride,int force) {
struct fileentry *e;
retvalue r;
int somethingwasmissed = 0;
r = RET_NOTHING;
......@@ -653,7 +654,9 @@ static retvalue changes_includepkgs(const char *dbdir,DB *references,filesdb fil
distribution,fullfilename,
e->filekey,e->md5sum,
binoverride,
force);
force,D_INPLACE);
if( r == RET_NOTHING )
somethingwasmissed = 1;
} else if( e->type == fe_DSC ) {
r = dsc_add(dbdir,references,filesdb,
changes->component,e->section,e->priority,
......@@ -661,7 +664,9 @@ static retvalue changes_includepkgs(const char *dbdir,DB *references,filesdb fil
e->filekey,e->basename,
changes->directory,e->md5sum,
srcoverride,
force);
force,D_INPLACE);
if( r == RET_NOTHING )
somethingwasmissed = 1;
}
free(fullfilename);
......@@ -670,13 +675,16 @@ static retvalue changes_includepkgs(const char *dbdir,DB *references,filesdb fil
e = e->next;
}
if( RET_IS_OK(r) && somethingwasmissed ) {
return RET_NOTHING;
}
return r;
}
/* insert the given .changes into the mirror in the <distribution>
* if forcecomponent, forcesection or forcepriority is NULL
* get it from the files or try to guess it. */
retvalue changes_add(const char *dbdir,DB *references,filesdb filesdb,const char *forcecomponent,const char *forcearchitecture,const char *forcesection,const char *forcepriority,struct distribution *distribution,const struct overrideinfo *srcoverride,const struct overrideinfo *binoverride,const char *changesfilename,int force) {
retvalue changes_add(const char *dbdir,DB *references,filesdb filesdb,const char *forcecomponent,const char *forcearchitecture,const char *forcesection,const char *forcepriority,struct distribution *distribution,const struct overrideinfo *srcoverride,const struct overrideinfo *binoverride,const char *changesfilename,int force,int delete) {
retvalue r;
struct changes *changes;
......@@ -706,13 +714,13 @@ retvalue changes_add(const char *dbdir,DB *references,filesdb filesdb,const char
}
/* add files in the pool */
r = changes_includefiles(filesdb,changes->component,changesfilename,changes,force);
//TODO: D_DELETE would fail here, what to do?
r = changes_includefiles(filesdb,changes->component,changesfilename,changes,force,delete);
if( RET_WAS_ERROR(r) ) {
changes_free(changes);
return r;
}
// TODO: make sure the name is transmitted, as if this differs override is wrong...
/* add the source and binary packages in the given distribution */
r = changes_includepkgs(dbdir,references,filesdb,
distribution,changes,srcoverride,binoverride,force);
......@@ -721,5 +729,21 @@ retvalue changes_add(const char *dbdir,DB *references,filesdb filesdb,const char
return r;
}
if( delete >= D_MOVE ) {
if( r == RET_NOTHING && delete < D_DELETE ) {
if( verbose >= 0 ) {
fprintf(stderr,"Not deleting '%s' as no package was added or some package was missed.\n(Use -d -d to delete anyway in such cases)\n",changesfilename);
}
} else {
assert(RET_IS_OK(r));
if( verbose >= 5 ) {
fprintf(stderr,"Deleting '%s'.",changesfilename);
}
if( unlink(changesfilename) != 0 ) {
fprintf(stderr,"Error deleting '%s': %m",changesfilename);
}
}
}
return RET_OK;
}
......@@ -15,7 +15,7 @@
/* insert the given .changes into the mirror in the <distribution>
* if forcecomponent, forcesection or forcepriority is NULL
* get it from the files or try to guess it. */
retvalue changes_add(const char *dbdir,DB *references,filesdb filesdb,const char *forcecomponent,const char *forcearchitecture,const char *forcesection,const char *forcepriority,struct distribution *distribution,const struct overrideinfo *srcoverride,const struct overrideinfo *binoverride,const char *changesfilename,int force);
retvalue changes_add(const char *dbdir,DB *references,filesdb filesdb,const char *forcecomponent,const char *forcearchitecture,const char *forcesection,const char *forcepriority,struct distribution *distribution,const struct overrideinfo *srcoverride,const struct overrideinfo *binoverride,const char *changesfilename,int force,int delete);
#endif
......@@ -259,10 +259,10 @@ static retvalue deb_calclocations(struct debpackage *pkg,const char *givenfileke
return r;
}
static retvalue deb_copyfiles(filesdb filesdb,struct debpackage *pkg,const char *debfilename) {
static retvalue deb_copyfiles(filesdb filesdb,struct debpackage *pkg,const char *debfilename, int delete) {
retvalue r;
r = files_checkin(filesdb,pkg->filekey,debfilename,&pkg->md5sum);
r = files_include(filesdb,debfilename,pkg->filekey,NULL,&pkg->md5sum,delete);
return r;
}
......@@ -280,12 +280,15 @@ static retvalue deb_checkfiles(filesdb filesdb,struct debpackage *pkg,const char
* causing error, if it is not one of them otherwise)
* if component is NULL, guessing it from the section. */
retvalue deb_add(const char *dbdir,DB *references,filesdb filesdb,const char *forcecomponent,const char *forcearchitecture,const char *forcesection,const char *forcepriority,struct distribution *distribution,const char *debfilename,const char *givenfilekey,const char *givenmd5sum,const struct overrideinfo *binoverride,int force){
retvalue deb_add(const char *dbdir,DB *references,filesdb filesdb,const char *forcecomponent,const char *forcearchitecture,const char *forcesection,const char *forcepriority,struct distribution *distribution,const char *debfilename,const char *givenfilekey,const char *givenmd5sum,const struct overrideinfo *binoverride,int force,int delete){
retvalue r,result;
struct debpackage *pkg;
const struct overrideinfo *oinfo;
int i;
assert( (givenmd5sum && givenfilekey) ||
(givenmd5sum==NULL && givenfilekey==NULL ) );
/* First taking a closer look to the file: */
r = deb_read(&pkg,debfilename);
......@@ -352,6 +355,13 @@ retvalue deb_add(const char *dbdir,DB *references,filesdb filesdb,const char *fo
fprintf(stderr,"Cannot checking in '%s' into architecture '%s', as it is '%s'!",
debfilename,forcearchitecture,pkg->architecture);
deb_free(pkg);
if( delete >= D_DELETE ) {
if( verbose >= 0 )
fprintf(stderr,"Deleting '%s' as requested!\n",debfilename);
if( unlink(debfilename) != 0 ) {
fprintf(stderr,"Error deleting '%s': %m\n",debfilename);
}
}
return RET_ERROR;
} else if( strcmp(pkg->architecture,"all") != 0 &&
!strlist_in( &distribution->architectures, pkg->architecture )) {
......@@ -373,10 +383,11 @@ retvalue deb_add(const char *dbdir,DB *references,filesdb filesdb,const char *fo
/* then looking if we already have this, or copy it in */
if( givenfilekey && givenmd5sum )
if( givenfilekey && givenmd5sum ) {
assert( delete == D_INPLACE );
r = deb_checkfiles(filesdb,pkg,givenmd5sum);
else
r = deb_copyfiles(filesdb,pkg,debfilename);
} else
r = deb_copyfiles(filesdb,pkg,debfilename,delete);
if( RET_WAS_ERROR(r) ) {
deb_free(pkg);
return r;
......
......@@ -21,5 +21,5 @@
* if overwrite is not NULL, it will be search for fields to reset for this
* package. (forcesection and forcepriority have higher priority than the
* information there) */
retvalue deb_add(const char *dbdir,DB *references,filesdb filesdb,const char *forcecomponent,const char *forcearchitecture,const char *forcesection,const char *forcepriority,struct distribution *distribution,const char *debfilename,const char *givenfilekey,const char *givenmd5sum,const struct overrideinfo *override,int force);
retvalue deb_add(const char *dbdir,DB *references,filesdb filesdb,const char *forcecomponent,const char *forcearchitecture,const char *forcesection,const char *forcepriority,struct distribution *distribution,const char *debfilename,const char *givenfilekey,const char *givenmd5sum,const struct overrideinfo *override,int force,int delete);
#endif
......@@ -327,11 +327,11 @@ static retvalue dsc_complete(struct dscpackage *pkg,const struct overrideinfo *o
/* Get the files from the directory dscfilename is residing it, and copy
* them into the pool, also setting pkg->dscmd5sum */
static retvalue dsc_copyfiles(filesdb filesdb,
struct dscpackage *pkg,const char *dscfilename) {
struct dscpackage *pkg,const char *dscfilename,int delete) {
char *sourcedir;
retvalue r;
r = files_checkin(filesdb,pkg->dscfilekey,dscfilename,&pkg->dscmd5sum);
r = files_include(filesdb,dscfilename,pkg->dscfilekey,NULL,&pkg->dscmd5sum,delete);
if( RET_WAS_ERROR(r) )
return r;
......@@ -339,7 +339,7 @@ static retvalue dsc_copyfiles(filesdb filesdb,
if( RET_WAS_ERROR(r) )
return r;
r = files_checkinfiles(filesdb,sourcedir,&pkg->basenames,&pkg->filekeys,&pkg->md5sums);
r = files_includefiles(filesdb,sourcedir,&pkg->basenames,&pkg->filekeys,&pkg->md5sums,delete);
free(sourcedir);
......@@ -368,7 +368,7 @@ static retvalue dsc_checkfiles(filesdb filesdb,
* of beeing newly calculated.
* (And all files are expected to already be in the pool). */
retvalue dsc_add(const char *dbdir,DB *references,filesdb filesdb,const char *forcecomponent,const char *forcesection,const char *forcepriority,struct distribution *distribution,const char *dscfilename,const char *filekey,const char *basename,const char *directory,const char *md5sum,const struct overrideinfo *srcoverride,int force){
retvalue dsc_add(const char *dbdir,DB *references,filesdb filesdb,const char *forcecomponent,const char *forcesection,const char *forcepriority,struct distribution *distribution,const char *dscfilename,const char *filekey,const char *basename,const char *directory,const char *md5sum,const struct overrideinfo *srcoverride,int force,int delete){
retvalue r;
struct dscpackage *pkg;
const struct overrideinfo *oinfo;
......@@ -434,10 +434,11 @@ retvalue dsc_add(const char *dbdir,DB *references,filesdb filesdb,const char *fo
/* then looking if we already have this, or copy it in */
if( !RET_WAS_ERROR(r) ) {
if( filekey && basename && directory && md5sum)
if( filekey && basename && directory && md5sum) {
assert( delete == D_INPLACE );
r = dsc_checkfiles(filesdb,pkg,md5sum);
else
r = dsc_copyfiles(filesdb,pkg,dscfilename);
} else
r = dsc_copyfiles(filesdb,pkg,dscfilename,delete);
}
/* Calculate the chunk to include: */
......
......@@ -20,6 +20,6 @@
* If basename, filekey and directory are != NULL, then they are used instead
* of beeing newly calculated.
* (And all files are expected to already be in the pool). */
retvalue dsc_add(const char *dbdir,DB *references,filesdb filesdb,const char *forcecomponent,const char *forcesection,const char *forcepriority,struct distribution *distribution,const char *dscfilename,const char *filekey,const char *basename,const char *directory,const char *md5sum,const struct overrideinfo *srcoverride,int force);
retvalue dsc_add(const char *dbdir,DB *references,filesdb filesdb,const char *forcecomponent,const char *forcesection,const char *forcepriority,struct distribution *distribution,const char *dscfilename,const char *filekey,const char *basename,const char *directory,const char *md5sum,const struct overrideinfo *srcoverride,int force,int delete);
#endif
/* This file is part of "reprepro"
* Copyright (C) 2003 Bernhard R. Link
* Copyright (C) 2003,2004 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 as published by
* the Free Software Foundation; either version 2 of the License, or
......@@ -33,6 +33,8 @@
#include "md5sum.h"
#include "copyfile.h"
extern int verbose;
/* Copy a file and calculate the md5sum of the result,
* return RET_NOTHING (and no md5sum), if it already exists*/
static retvalue copyfile(const char *origfile,const char *destfullfilename,char **md5sum) {
......@@ -147,3 +149,82 @@ retvalue copyfile_getmd5(const char *mirrordir,const char *filekey,const char *o
free(fullfilename);
return r;
}
void copyfile_delete(const char *fullfilename) {
int err;
err = unlink(fullfilename);
if( err != 0 ) {
fprintf(stderr,"error while unlinking %s: %m\n",fullfilename);
}
}
static retvalue copy(const char *fullfilename,const char *origfile,const char *md5expected,char **calculatedmd5sum) {
char *md5sum;
retvalue r;
r = md5sum_copy(origfile,fullfilename,&md5sum);
if( r == RET_NOTHING ) {
fprintf(stderr,"Could not open '%s'!\n",origfile);
return RET_ERROR_MISSING;
}
if( r == RET_ERROR_EXIST ) {
fprintf(stderr,"File '%s' does already exist!\n",fullfilename);
}
if( RET_WAS_ERROR(r) )
return r;
if( calculatedmd5sum != NULL )
*calculatedmd5sum = md5sum;
if( strcmp(md5sum,md5expected) == 0 ) {
r = RET_OK;
} else {
unlink(fullfilename);
fprintf(stderr,"WARNING: '%s' has md5sum '%s', while '%s' was expected.\n",origfile,md5sum,md5expected);
r = RET_ERROR_WRONG_MD5;
}
if( calculatedmd5sum == NULL )
free(md5sum);
return r;
}
static retvalue move(const char *fullfilename,const char *origfile,const char *md5expected,char **md5sum) {
retvalue r;
// TODO: try a rename first, if md5sum is know and correct??
r = copy(fullfilename,origfile,md5expected,md5sum);
if( RET_IS_OK(r) ) {
if( verbose > 15 ) {
fprintf(stderr,"Deleting '%s'.",origfile);
}
if( unlink(origfile) != 0 ) {
fprintf(stderr,"Error deleting '%s': %m",origfile);
}
}
return r;
}
retvalue copyfile_move(const char *mirrordir,const char *filekey,const char *origfile,const char *md5expected,char **md5sum) {
retvalue r;
char *fullfilename;
fullfilename = calc_dirconcat(mirrordir,filekey);
if( fullfilename == NULL )
return RET_ERROR_OOM;
r = move(fullfilename,origfile,md5expected,md5sum);
free(fullfilename);
return r;
}
retvalue copyfile_copy(const char *mirrordir,const char *filekey,const char *origfile,const char *md5expected,char **md5sum) {
retvalue r;
char *fullfilename;
fullfilename = calc_dirconcat(mirrordir,filekey);
if( fullfilename == NULL )
return RET_ERROR_OOM;
r = copy(fullfilename,origfile,md5expected,md5sum);
free(fullfilename);
return r;
}
#ifndef __MIRRORER_COPYFILE_H
#define __MIRRORER_COPYFILE_H
retvalue copyfile_md5known(const char *mirrordir,const char *filekey,const char *origfile,const char *md5expected);
retvalue copyfile_getmd5(const char *mirrordir,const char *filekey,const char *origfile,char **md5sum);
retvalue copyfile_copy(const char *mirrordir,const char *filekey,const char *origfile,const char *md5expected,char **md5sum);
retvalue copyfile_move(const char *mirrordir,const char *filekey,const char *origfile,const char *md5expected,char **md5sum);
void copyfile_delete(const char *fullfilename);
#endif
This diff is collapsed.
......@@ -24,35 +24,48 @@ retvalue files_add(filesdb filesdb,const char *filekey,const char *md5sum);
/* remove file's md5sum from database */
retvalue files_remove(filesdb filesdb,const char *filekey);
/* look for file in database
* returns: -2 wrong md5sum, -1: error, 0 not existant, 1 exists*/
retvalue files_check(filesdb filesdb,const char *filekey,const char *md5sum);
/* look for file, calculate its md5sum and add it */
retvalue files_detect(filesdb filesdb,const char *filekey);
/* check for file in the database and if not found there, if it can be detected */
/* check for file in the database and if not found there in the pool */
retvalue files_expect(filesdb filesdb,const char *filekey,const char *md5sum);
/* same for multiple files */
retvalue files_expectfiles(filesdb filesdb,const struct strlist *filekeys,const struct strlist *md5sums);
/* print missing files */
retvalue files_printmissing(filesdb filesdb,const struct strlist *filekeys,const struct strlist *md5sums,const struct strlist *origfiles);
/* check for several files in the database and in the pool if missing */
retvalue files_expectfiles(filesdb filesdb,const struct strlist *filekeys,const struct strlist *md5sums);
/* Copy file <origfilename> to <mirrordir>/<filekey> and add it to
* the database <filesdb>. Return RET_ERROR_WRONG_MD5 if already there
* with other md5sum, return other error when the file does not exists
* or the database had an error. return RET_NOTHING, if already there
* with correct md5sum. Return <md5andsize> with the data of this file,
* if no error (that is if RET_OK or RET_NOTHING) */
retvalue files_checkin(filesdb filesdb,const char *filekey,
const char *origfilename, char **md5sum);
/* Make sure filekeys with md5sums are in the pool. If not copy from
* sourcedir/file where file is the entry from files */
retvalue files_checkinfiles(filesdb filesdb,const char *sourcedir,const struct strlist *basefilenames,const struct strlist *filekeys,const struct strlist *md5sums);
/* The same for a single file: */
retvalue files_checkinfile(filesdb filesdb,const char *sourcedir,const char *basename,const char *filekey,const char *md5sum);
/* what to do with files */
/* file should already be there, just make sure it is in the database */
#define D_INPLACE -1
/* copy the file to the given location, return RET_NOTHING, if already in place */
#define D_COPY 0
/* move the file in place: */
#define D_MOVE 1
/* move needed and delete unneeded files: */
#define D_DELETE 2
/* Include a given file into the pool. i.e.:
* 1) if <md5dum> != NULL
* check if <filekey> with <md5sum> is already there,
* return RET_NOTHING if it is.
* return n RET_ERROR_WRONG_MD5 if wrong md5sum.
* 2) Look if there is already a file in the pool with correct md5sum.
* and add it to the database if yes.
* return RET_NOTHING, if done,
* 3) copy or move file (depending on delete) file to destination,
* making sure it has the correct <md5sum> if given,
* or computing it, if <claculatemd5sum> is given.
* return RET_OK, if done,
* return RET_ERROR_MISSING, if there is no file to copy.
* return RET_ERROR_WRONG_MD5 if wrong md5sum.
* (the original file is not deleted in that case, even if delete is positive)
* 4) add it to the database
*/
retvalue files_include(filesdb filesdb,const char *sourcefilename,const char *filekey, const char *md5sum, char **calculatedmd5sum, int delete);
/* same as above, but use sourcedir/basename instead of sourcefilename */
retvalue files_includefile(filesdb filesdb,const char *sourcedir,const char *basename, const char *filekey, const char *md5sum, char **calculatedmd5sum, int delete);
/* the same, but with multiple files */
retvalue files_includefiles(filesdb filesdb,const char *sourcedir,const struct strlist *basenames, const struct strlist *filekeys, const struct strlist *md5sums, int delete);
typedef retvalue per_file_action(void *data,const char *filekey,const char *md5sum);
......
......@@ -67,7 +67,7 @@ char *incommingdir = STD_BASE_DIR "/incomming",
*priority = NULL,
*component = NULL,
*architecture = NULL;
static int local = 0;
static int delete = 0;
static int force = 0;
static int nothingiserror = 0;
int verbose = 0;
......@@ -394,6 +394,7 @@ static int action_list(int argc,const char *argv[]) {
return EXIT_RET(result);
}
/* to be readded later....
static int action_detect(int argc,const char *argv[]) {
filesdb files;
char buffer[5000],*nl;
......@@ -425,6 +426,7 @@ static int action_detect(int argc,const char *argv[]) {
RET_ENDUPDATE(ret,r);
return EXIT_RET(ret);
}
*/
static int action_forget(int argc,const char *argv[]) {
filesdb files;
......@@ -758,7 +760,7 @@ static int action_includedeb(int argc,const char *argv[]) {
struct overrideinfo *override;
if( argc < 3 ) {
fprintf(stderr,"reprepro includedeb <distribution> <package>\n");
fprintf(stderr,"reprepro [--delete] includedeb <distribution> <package>\n");
return 1;
}
......@@ -796,7 +798,7 @@ static int action_includedeb(int argc,const char *argv[]) {
}
result = deb_add(dbdir,references,files,component,architecture,
section,priority,distribution,argv[2],NULL,NULL,override,force);
section,priority,distribution,argv[2],NULL,NULL,override,force,delete);
override_free(override);
......@@ -822,7 +824,7 @@ static int action_includedsc(int argc,const char *argv[]) {
struct overrideinfo *srcoverride;
if( argc < 3 ) {
fprintf(stderr,"reprepro includedsc <distribution> <package>\n");
fprintf(stderr,"reprepro [--delete] includedsc <distribution> <package>\n");
return 1;
}
......@@ -853,7 +855,7 @@ static int action_includedsc(int argc,const char *argv[]) {
if( !files )
return 1;
result = dsc_add(dbdir,references,files,component,section,priority,distribution,argv[2],NULL,NULL,NULL,NULL,srcoverride,force);
result = dsc_add(dbdir,references,files,component,section,priority,distribution,argv[2],NULL,NULL,NULL,NULL,srcoverride,force,delete);
override_free(srcoverride);
r = distribution_export(distribution,dbdir,distdir,force,1);
......@@ -875,7 +877,7 @@ static int action_include(int argc,const char *argv[]) {
struct overrideinfo *override,*srcoverride;
if( argc < 3 ) {
fprintf(stderr,"reprepro include <distribution> <.changes-file>\n");
fprintf(stderr,"reprepro [--delete] include <distribution> <.changes-file>\n");
return 1;
}
......@@ -910,7 +912,7 @@ static int action_include(int argc,const char *argv[]) {
if( !files )
return 1;
result = changes_add(dbdir,references,files,component,architecture,section,priority,distribution,srcoverride,override,argv[2],force);
result = changes_add(dbdir,references,files,component,architecture,section,priority,distribution,srcoverride,override,argv[2],force,delete);
override_free(override);override_free(srcoverride);
......@@ -936,7 +938,7 @@ static struct action {
} actions[] = {
{"__d", action_printargs},
{"__extractcontrol", action_extractcontrol},
{"_detect", action_detect},
// {"_detect", action_detect},
{"_forget", action_forget},
{"_md5sums", action_md5sums},
{"_dumpcontents", action_dumpcontents},
......@@ -962,7 +964,7 @@ static struct action {
int main(int argc,char *argv[]) {
static struct option longopts[] = {
{"local", 0, 0, 'l'},
{"delete", 0, 0, 'r'},
{"basedir", 1, 0, 'b'},
{"incommingdir", 1, 0, 'i'},
{"methoddir", 1, 0, 'M'},
......@@ -990,33 +992,24 @@ int main(int argc,char *argv[]) {
printf(
"reprepro - Produce and Manage and Debian package repository\n\n"
"options:\n"
" -h, --help: Show this help\n"
//" -l, --local: Do only process the given file.\n"
//" (i.e. do not look at .tar.gz when getting .dsc)\n"
" -b, --basedir <dir>: Base-dir (will overwrite prior given\n"
" -d, -D, -L, -c).\n"
" -h, --help: Show this help\n"
" -r, --delete: Delete included files if reasonable.\n"
" -b, --basedir <dir>: Base-dir (will overwrite prior given\n"
" -d, -D, -L, -c).\n"
// TODO: is not yet used...
// " -i, --incomming <dir>: incomming-Directory.\n"
" -d, --distdir <dir>: Directory to place the \"dists\" dir in.\n"
" -D, --dbdir <dir>: Directory to place the database in.\n"
" -L, --listdir <dir>: Directory to place downloaded lists in.\n"
" -c, --confdir <dir>: Directory to search configuration in.\n"
" -o, --overridedir <dir>:Directory to search override files in.\n"
" -M, --methodir <dir>: Use instead of /usr/lib/apt/methods/\n"
" -S, --section <section>: Force include* to set section.\n"
" -P, --priority <priority>: Force include* to set priority.\n"
" -C, --component <component>: Add or delete only in component.\n"
// " -i, --incomming <dir>: incomming-Directory.\n"
" -d, --distdir <dir>: Directory to place the \"dists\" dir in.\n"
" -D, --dbdir <dir>: Directory to place the database in.\n"
" -L, --listdir <dir>: Directory to place downloaded lists in.\n"
" -c, --confdir <dir>: Directory to search configuration in.\n"
" -o, --overridedir <dir>: Directory to search override files in.\n"
" -M, --methodir <dir>: Use instead of /usr/lib/apt/methods/\n"
" -S, --section <section>: Force include* to set section.\n"
" -P, --priority <priority>: Force include* to set priority.\n"
" -C, --component <component>: Add or delete only in component.\n"
" -A, --architecture <architecture>: Add or delete only to architecture.\n"
"\n"
"actions:\n"
" _forget <file>: Forget the given files (read stdin if none)\n"
" (Only usefull to unregister files manually deleted)\n"
" _detect <file>: Add given files to the database (read stdin if none)\n"
" the following lines are currently wrong...\n"
" ('find $pooldir -type f -printf \"%%P\\n\" | reprepro -p $pooldir inventory'\n"
" will iventory an already existing pool-dir\n"
" WARNING: names relative to pool-dir in shortest possible form\n"
" _removereferences <identifier>: Remove all marks \"Needed by <identifier>\"\n"
" dumpreferences: Print all saved references\n"
" dumpunreferenced: Print registered files withour reference\n"
" deleteunreferenced: Delete and forget all unreferenced files\n"
......@@ -1040,8 +1033,8 @@ int main(int argc,char *argv[]) {
"\n"
);
exit(0);
case 'l':
local = 1;
case 'r':
delete++;
break;
case 'v':
verbose++;
......
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