Index: order_pcbway.conf =================================================================== --- order_pcbway.conf (revision 36829) +++ order_pcbway.conf (revision 36830) @@ -4,6 +4,7 @@ ha:order_pcbway { api_key={} verbose=1 + debug=0 cache_update_sec = 604800 } } Index: order_pcbway_conf.h =================================================================== --- order_pcbway_conf.h (revision 36829) +++ order_pcbway_conf.h (revision 36830) @@ -8,6 +8,7 @@ const struct { RND_CFT_STRING api_key; RND_CFT_BOOLEAN verbose; /* print log messages about the web traffic the plugin does */ + RND_CFT_BOOLEAN debug; /* use predictable temp file names and keep temp files for debugging */ RND_CFT_INTEGER cache_update_sec; /* re-download cached vendor files if they are older than the value specified here, in sec */ } order_pcbway; } plugins; Index: pcbway.c =================================================================== --- pcbway.c (revision 36829) +++ pcbway.c (revision 36830) @@ -360,11 +360,22 @@ FILE *f, *ft, *fr; char sep[32], *s, *sephdr; static const char rch[] = "0123456789abcdefghijklmnopqrstuvxyzABCDEFGHIJKLMNOPQRSTUVXYZ"; - char *postfile = "POST.txt", *tarname = "gerb.tar"; + char *postfile, *tarname; char *hdr[5]; rnd_wget_opts_t wopts = {0}; int n, found; + if (CFG.debug) { + postfile = "POST.txt"; + tarname = "gerb.tar"; + } + else { + postfile = rnd_tempfile_name_new("post.txt"); + tarname = "gerb.tar"; + } + rnd_trace("order_pcbway files: post=%s gerber=%s\n", postfile, tarname); + + TODO("read back the dialog values to config fields"); TODO("Do not hardwire posftile and tarname"); TODO("Use CAM export to generate the tarball"); @@ -476,6 +487,10 @@ rnd_message(RND_MSG_ERROR, "pcbway_order: failed upload the order\n(may be temporary network error)\n"); free(sephdr); + if (!CFG.debug) { + rnd_tempfile_unlink(postfile); +TODO("clean up after the gerbers"); + } }