diff options
Diffstat (limited to 'src/triplet.c')
-rw-r--r-- | src/triplet.c | 18 |
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 | |||
@@ -182,7 +182,7 @@ static bool | |||
182 | triplet_processor (void *data, void *proc_data) | 182 | triplet_processor (void *data, void *proc_data) |
183 | { | 183 | { |
184 | struct file_triplet *trp = data; | 184 | struct file_triplet *trp = data; |
185 | struct spool *spool = proc_data; | 185 | const struct spool *spool = proc_data; |
186 | 186 | ||
187 | trp->spool = spool; | 187 | trp->spool = spool; |
188 | 188 | ||
@@ -230,14 +230,14 @@ triplet_processor (void *data, void *proc_data) | |||
230 | 230 | ||
231 | /* Process all triplets from the table according to the SPOOL */ | 231 | /* Process all triplets from the table according to the SPOOL */ |
232 | void | 232 | void |
233 | enumerate_triplets (struct spool *spool) | 233 | enumerate_triplets (const struct spool *spool) |
234 | { | 234 | { |
235 | if (debug_level) | 235 | if (debug_level) |
236 | logmsg (LOG_DEBUG, _("processing files for %s (%s)"), | 236 | logmsg (LOG_DEBUG, _("processing spool %s (%s)"), |
237 | spool->url, mu_url_to_string (spool->dest_url)); | 237 | spool->tag, mu_url_to_string (spool->dest_url)); |
238 | if (triplet_table) | 238 | if (triplet_table) |
239 | { | 239 | { |
240 | hash_do_for_each (triplet_table, triplet_processor, spool); | 240 | hash_do_for_each (triplet_table, triplet_processor, (void*) spool); |
241 | hash_clear (triplet_table); | 241 | hash_clear (triplet_table); |
242 | } | 242 | } |
243 | } | 243 | } |
@@ -257,6 +257,13 @@ expand_project_base (struct metadef *def, void *data) | |||
257 | } | 257 | } |
258 | 258 | ||
259 | static const char * | 259 | static const char * |
260 | expand_tag (struct metadef *def, void *data) | ||
261 | { | ||
262 | struct file_triplet *trp = data; | ||
263 | return trp->spool->tag; | ||
264 | } | ||
265 | |||
266 | static const char * | ||
260 | expand_url (struct metadef *def, void *data) | 267 | expand_url (struct metadef *def, void *data) |
261 | { | 268 | { |
262 | struct file_triplet *trp = data; | 269 | struct file_triplet *trp = data; |
@@ -576,6 +583,7 @@ DECL_EXPAND_TIMER(system) | |||
576 | struct metadef triplet_meta[] = { | 583 | struct metadef triplet_meta[] = { |
577 | { "project", NULL, expand_project_base, NULL }, | 584 | { "project", NULL, expand_project_base, NULL }, |
578 | { "url", NULL, expand_url, NULL }, | 585 | { "url", NULL, expand_url, NULL }, |
586 | { "spool", NULL, expand_tag, NULL }, | ||
579 | { "dir", NULL, expand_relative_dir, NULL }, | 587 | { "dir", NULL, expand_relative_dir, NULL }, |
580 | { "dest-dir", NULL, expand_dest_dir, NULL }, | 588 | { "dest-dir", NULL, expand_dest_dir, NULL }, |
581 | { "source-dir", NULL, expand_source_dir, NULL }, | 589 | { "source-dir", NULL, expand_source_dir, NULL }, |