This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project iwhd.git.
The branch, master has been updated
via 7fb8264a528a19fd999dc4626121c2d6427d437d (commit)
from 8f3bc25341e2a212e3497028d59ff6a5f3527445 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
http://repo.or.cz/w/iwhd.git/commit/7fb8264a528a19fd999dc4626121c2d6427d437d
commit 7fb8264a528a19fd999dc4626121c2d6427d437d
Author: Jeff Darcy <jdarcy(a)redhat.com>
Date: Wed Oct 13 16:08:39 2010 -0400
Add link-following implementation (not just syntax).
Also fixed parser main() so that mainline can pass tests modified to suit
an unposted version.
diff --git a/query.leg b/query.leg
index 2b9cf59..403f0d0 100644
--- a/query.leg
+++ b/query.leg
@@ -230,12 +230,14 @@ string_value (value_t *v, getter_t *oget, getter_t *sget)
case T_SFIELD:
return sget ? CALL_GETTER(sget,v->as_str) : NULL;
case T_LINK:
- left = string_value(v->as_tree.left,oget,sget);
- if (left) {
- return follow_link((char *)left,
- (char *)v->as_tree.right);
+ if (!v->resolved) {
+ left = string_value(v->as_tree.left,oget,sget);
+ if (left) {
+ v->resolved = follow_link((char *)left,
+ (char *)v->as_tree.right);
+ }
}
- /* Fall through. */
+ return v->resolved;
default:
return NULL;
}
@@ -591,11 +593,13 @@ main (int argc, char **argv)
value_t *expr;
int res;
const char *str;
+ unsigned int failed = 0;
for (i = 1; i < argc; ++i) {
expr = parse(argv[i]);
if (!expr) {
printf("could not parse '%s'n",argv[i]);
+ ++failed;
continue;
}
print_value(expr);
@@ -608,6 +612,6 @@ main (int argc, char **argv)
printf("d= %dn",res);
}
- return 0;
+ return failed;
}
#endif
diff --git a/replica.c b/replica.c
index 07589bd..8bdcb53 100644
--- a/replica.c
+++ b/replica.c
@@ -757,7 +757,6 @@ replicate (const char *url, size_t size, const char *policy)
static void
replicate_namespace_action (const char *name, repl_t action)
{
- unsigned int i;
repl_item *item;
GHashTableIter iter;
gpointer key;
@@ -768,7 +767,8 @@ replicate_namespace_action (const char *name, repl_t action)
if (!strcmp(key,me)) {
continue;
}
- DPRINTF("replicating delete(%s) on %un",name,i);
+ DPRINTF("replicating delete(%s) on %sn",name,
+ ((provider_t *)value)->name);
item = malloc(sizeof(*item));
if (!item) {
error(0,errno,"could not create repl_item for %s",
@@ -812,12 +812,22 @@ replicate_bcreate (const char *name)
/* Part of our API to the query module. */
char *
-follow_link (char *object, char *key)
+follow_link (char *object, const char *key)
{
- (void)object;
- (void)key;
+ char *slash;
+ char *value = NULL;
- return "no_such_object";
+ slash = strchr(object,'/');
+ if (!slash) {
+ return NULL;
+ }
+
+ *(slash++) = '0';
+ (void)meta_get_value(object,slash,key,&value);
+ *(--slash) = '/';
+
+ DPRINTF("%s: %s:%s => %sn",__func__,object,key,value);
+ return value;
}
int
-----------------------------------------------------------------------
Summary of changes:
query.leg | 16 ++++++++++------
replica.c | 22 ++++++++++++++++------
2 files changed, 26 insertions(+), 12 deletions(-)
repo.or.cz automatic notification. Contact project admin jim(a)meyering.net
if you want to unsubscribe, or site admin admin(a)repo.or.cz if you receive
no reply.
--
iwhd.git ("image warehouse daemon")