Commit 88c94137 authored by Bernhard Link's avatar Bernhard Link

encapsulates some more mprintfs

parent 8370ffd8
......@@ -7,4 +7,5 @@ TODO:
write README
search for nicer call of gpg within signature.c
implement extractcontrol.c properly
find a name for this project
......@@ -25,7 +25,7 @@
#include <db.h>
#include "error.h"
#include "strlist.h"
#include "mprintf.h"
#include "names.h"
#include "md5sum.h"
#include "dirs.h"
#include "packages.h"
......@@ -46,7 +46,7 @@ DB *files_initialize(const char *dbpath) {
retvalue r;
filename = mprintf("%s/files.db",dbpath);
filename = calc_dirconcat(dbpath,"files.db");
if( !filename )
return NULL;
r = dirs_make_parent(filename);
......
......@@ -1208,13 +1208,13 @@ static int check(int argc,char *argv[]) {
/***********************adddeb******************************************/
static int adddeb(int argc,char *argv[]) {
static int includedeb(int argc,char *argv[]) {
retvalue result,r;
DB *files,*references;
struct distribution *distribution;
if( argc < 3 ) {
fprintf(stderr,"mirrorer _adddeb <distribution> <package>\n");
fprintf(stderr,"mirrorer includedeb <distribution> <package>\n");
return 1;
}
......@@ -1274,7 +1274,7 @@ static struct action {
{"_addmd5sums",addmd5sums},
{"update",update},
{"__extractcontrol",extract_control},
{"_adddeb",adddeb},
{"includedeb",includedeb},
{NULL,NULL}
};
......@@ -1355,11 +1355,11 @@ int main(int argc,char *argv[]) {
break;
case 'b':
mirrordir=strdup(optarg);
incommingdir=mprintf("%s/incomming",optarg);
distdir=mprintf("%s/dists",optarg);
dbdir=mprintf("%s/db",optarg);
listdir=mprintf("%s/lists",optarg);
confdir=mprintf("%s/conf",optarg);
incommingdir=calc_dirconcat(optarg,"incomming");
distdir=calc_dirconcat(optarg,"dists");
dbdir=calc_dirconcat(optarg,"db");
listdir=calc_dirconcat(optarg,"lists");
confdir=calc_dirconcat(optarg,"conf");
break;
case 'i':
incommingdir = strdup(optarg);
......
......@@ -25,8 +25,8 @@
#include <db.h>
#include <zlib.h>
#include "error.h"
#include "mprintf.h"
#include "strlist.h"
#include "names.h"
#include "md5sum.h"
#include "dirs.h"
#include "reference.h"
......@@ -57,7 +57,7 @@ DB *packages_initialize(const char *dbpath,const char *dbname) {
retvalue r;
filename=mprintf("%s/packages.db",dbpath);
filename=calc_dirconcat(dbpath,"packages.db");
if( !filename )
return NULL;
r = dirs_make_parent(filename);
......
......@@ -24,8 +24,8 @@
#include <string.h>
#include <db.h>
#include "error.h"
#include "mprintf.h"
#include "strlist.h"
#include "names.h"
#include "md5sum.h"
#include "dirs.h"
#include "reference.h"
......@@ -50,7 +50,7 @@ DB *references_initialize(const char *dbpath) {
char *filename;
retvalue r;
filename = mprintf("%s/references.db",dbpath);
filename = calc_dirconcat(dbpath,"references.db");
if( !filename )
return NULL;
r = dirs_make_parent(filename);
......
......@@ -30,7 +30,6 @@
#include "chunks.h"
#include "sources.h"
#include "names.h"
#include "mprintf.h"
#include "dpkgversions.h"
extern int verbose;
......@@ -397,9 +396,6 @@ static inline retvalue callaction(new_package_action *action, void *data,
struct sources_add {DB *pkgs; void *data; const char *component; new_package_action *action; };
static retvalue addsource(void *data,const char *chunk) {
retvalue r;
struct sources_add *d = data;
......
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