aboutsummaryrefslogtreecommitdiff
path: root/src/triplet.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/triplet.c')
-rw-r--r--src/triplet.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/src/triplet.c b/src/triplet.c
index 6641211..717fd2a 100644
--- a/src/triplet.c
+++ b/src/triplet.c
@@ -179,13 +179,13 @@ remove_triplet (struct file_triplet *trp)
/* Process a single triplet from the table */
static bool
triplet_processor (void *data, void *proc_data)
{
struct file_triplet *trp = data;
- struct spool *spool = proc_data;
+ const struct spool *spool = proc_data;
trp->spool = spool;
if (debug_level)
logmsg (LOG_DEBUG, "FILE %s, DIST=%s, SIG=%s, DIRECTIVE=%s",
trp->name,
@@ -227,20 +227,20 @@ triplet_processor (void *data, void *proc_data)
return true;
}
/* Process all triplets from the table according to the SPOOL */
void
-enumerate_triplets (struct spool *spool)
+enumerate_triplets (const struct spool *spool)
{
if (debug_level)
- logmsg (LOG_DEBUG, _("processing files for %s (%s)"),
- spool->url, mu_url_to_string (spool->dest_url));
+ logmsg (LOG_DEBUG, _("processing spool %s (%s)"),
+ spool->tag, mu_url_to_string (spool->dest_url));
if (triplet_table)
{
- hash_do_for_each (triplet_table, triplet_processor, spool);
+ hash_do_for_each (triplet_table, triplet_processor, (void*) spool);
hash_clear (triplet_table);
}
}
size_t
count_collected_triplets ()
@@ -254,12 +254,19 @@ expand_project_base (struct metadef *def, void *data)
{
struct file_triplet *trp = data;
return trp->project;
}
static const char *
+expand_tag (struct metadef *def, void *data)
+{
+ struct file_triplet *trp = data;
+ return trp->spool->tag;
+}
+
+static const char *
expand_url (struct metadef *def, void *data)
{
struct file_triplet *trp = data;
return trp->spool->url;
}
@@ -573,12 +580,13 @@ DECL_EXPAND_TIMER(system)
DECL_TIMER(name, user), \
DECL_TIMER(name, system)
struct metadef triplet_meta[] = {
{ "project", NULL, expand_project_base, NULL },
{ "url", NULL, expand_url, NULL },
+ { "spool", NULL, expand_tag, NULL },
{ "dir", NULL, expand_relative_dir, NULL },
{ "dest-dir", NULL, expand_dest_dir, NULL },
{ "source-dir", NULL, expand_source_dir, NULL },
{ "triplet:full", NULL, expand_triplet_full, NULL },
{ "triplet:upload", NULL, expand_triplet_upload, NULL },
{ "triplet:dist", NULL, expand_triplet_dist, NULL },

Return to:

Send suggestions and report system problems to the System administrator.