adjust json field names
Avoid using "name" for what git-annex otherwise refers to as a description. (For the remotes in the map, the "remote" field should be the remote name, but there is a bug preventing it from being that.) Sponsored-by: the NIH-funded NICEMAN (ReproNim TR&D3) project
This commit is contained in:
parent
52a8b5b117
commit
a44638ca73
2 changed files with 11 additions and 11 deletions
|
@ -47,7 +47,7 @@ start = startingNoMessage (ActionItemOther Nothing) $ do
|
|||
|
||||
umap <- uuidDescMap
|
||||
trustmap <- trustMapLoad
|
||||
|
||||
|
||||
ifM (outputJSONMap rs trustmap umap)
|
||||
( next $ return True
|
||||
, do
|
||||
|
@ -108,8 +108,8 @@ hostname r
|
|||
basehostname :: Git.Repo -> String
|
||||
basehostname r = fromMaybe "" $ headMaybe $ splitc '.' $ hostname r
|
||||
|
||||
{- A name to display for a repo. Uses the name from uuid.log if available,
|
||||
- or the remote name if not. -}
|
||||
{- A name to display for a repo. Uses the description
|
||||
- from uuid.log if available, or the remote name if not. -}
|
||||
repoName :: UUIDDescMap -> Git.Repo -> String
|
||||
repoName umap r
|
||||
| repouuid == NoUUID = fallback
|
||||
|
@ -307,14 +307,14 @@ outputJSONMap rs trustmap umap =
|
|||
]
|
||||
|
||||
mknode (r, remotes) = JSON.object
|
||||
[ "name" .= packString (repoName umap r)
|
||||
[ "description" .= packString (repoName umap r)
|
||||
, "uuid" .= mkuuid (getUncachedUUID r)
|
||||
, "url" .= packString (Git.repoLocation r)
|
||||
, "remotes" .= map mkremote (filterdead id remotes)
|
||||
]
|
||||
|
||||
mkremote r = JSON.object
|
||||
[ "name" .= packString (repoName umap r)
|
||||
[ "remote" .= packString (repoName umap r)
|
||||
, "uuid" .= mkuuid (getUncachedUUID r)
|
||||
, "url" .= packString (Git.repoLocation r)
|
||||
]
|
||||
|
|
|
@ -10,10 +10,10 @@ Example output, after being passed through `jq` to pretty-print it:
|
|||
{
|
||||
"nodes": [
|
||||
{
|
||||
"name": "joey@darkstar:~/tmp/mapbench/a",
|
||||
"description": "joey@darkstar:~/tmp/mapbench/a",
|
||||
"remotes": [
|
||||
{
|
||||
"name": "joey@darkstar:~/tmp/mapbench/b",
|
||||
"remote": "b",
|
||||
"url": "/home/joey/tmp/mapbench/b",
|
||||
"uuid": "645d92d8-6461-43c1-b23c-6dd04dc3a015"
|
||||
}
|
||||
|
@ -22,10 +22,10 @@ Example output, after being passed through `jq` to pretty-print it:
|
|||
"uuid": "3f34e4c2-dd19-433a-ab04-9fd4be959325"
|
||||
},
|
||||
{
|
||||
"name": "joey@darkstar:~/tmp/mapbench/b",
|
||||
"description": "joey@darkstar:~/tmp/mapbench/b",
|
||||
"remotes": [
|
||||
{
|
||||
"name": "joey@darkstar:~/tmp/mapbench/a",
|
||||
"remote": "a",
|
||||
"url": "/home/joey/tmp/mapbench/a",
|
||||
"uuid": "3f34e4c2-dd19-433a-ab04-9fd4be959325"
|
||||
}
|
||||
|
@ -34,10 +34,10 @@ Example output, after being passed through `jq` to pretty-print it:
|
|||
"uuid": "645d92d8-6461-43c1-b23c-6dd04dc3a015"
|
||||
},
|
||||
{
|
||||
"name": "unknown",
|
||||
"description": "unknown",
|
||||
"remotes": [
|
||||
{
|
||||
"name": "joey@darkstar:~/tmp/mapbench/b",
|
||||
"remote": "b",
|
||||
"url": "/home/joey/tmp/mapbench/b",
|
||||
"uuid": "645d92d8-6461-43c1-b23c-6dd04dc3a015"
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue