aboutsummaryrefslogtreecommitdiff
path: root/stdlib/source/program/aedifex
diff options
context:
space:
mode:
authorEduardo Julian2020-12-26 04:34:11 -0400
committerEduardo Julian2020-12-26 04:34:11 -0400
commit92dca9f487c625d27f6c291784ef709b0cc13a72 (patch)
tree6330635a19bb582d86f4402a9594dea4a1ab3fa0 /stdlib/source/program/aedifex
parent4ca397765805eda5ddee393901ed3a02001a960a (diff)
Some renamings.
Diffstat (limited to 'stdlib/source/program/aedifex')
-rw-r--r--stdlib/source/program/aedifex/cache.lux6
-rw-r--r--stdlib/source/program/aedifex/dependency/resolution.lux7
-rw-r--r--stdlib/source/program/aedifex/package.lux42
-rw-r--r--stdlib/source/program/aedifex/repository/origin.lux21
4 files changed, 45 insertions, 31 deletions
diff --git a/stdlib/source/program/aedifex/cache.lux b/stdlib/source/program/aedifex/cache.lux
index d36bb8dff..a7f6439df 100644
--- a/stdlib/source/program/aedifex/cache.lux
+++ b/stdlib/source/program/aedifex/cache.lux
@@ -33,7 +33,9 @@
["#/." extension (#+ Extension)]]
["#." dependency (#+ Dependency)
[resolution (#+ Resolution)]
- ["#/." status (#+ Status)]]])
+ ["#/." status (#+ Status)]]
+ ["#." repository #_
+ ["#/." origin]]])
(def: (write! system content file)
(-> (file.System Promise) Binary Path (Promise (Try Any)))
@@ -130,7 +132,7 @@
[pom (..decode xml.codec pom)
library_sha-1 (..decode //hash.sha-1_codec library_sha-1)
library_md5 (..decode //hash.md5_codec library_md5)]
- (wrap {#//package.origin #//package.Local
+ (wrap {#//package.origin (#//repository/origin.Local prefix)
#//package.library [library (#//dependency/status.Verified library_sha-1 library_md5)]
#//package.pom [pom #//dependency/status.Unverified]}))))))
diff --git a/stdlib/source/program/aedifex/dependency/resolution.lux b/stdlib/source/program/aedifex/dependency/resolution.lux
index 11c3cd057..e9d457ac9 100644
--- a/stdlib/source/program/aedifex/dependency/resolution.lux
+++ b/stdlib/source/program/aedifex/dependency/resolution.lux
@@ -34,12 +34,13 @@
["#." status (#+ Status)]
["/#" // #_
["/" profile]
- ["#." repository (#+ Address Repository)]
["#." hash (#+ Hash SHA-1 MD5)]
["#." pom]
["#." package (#+ Package)]
["#." artifact (#+ Artifact)
- ["#/." extension (#+ Extension)]]]])
+ ["#/." extension (#+ Extension)]]
+ ["#." repository (#+ Address Repository)
+ ["#/." origin (#+ Origin)]]]])
(template [<name>]
[(exception: #export (<name> {artifact Artifact} {extension Extension} {hash Text})
@@ -92,7 +93,7 @@
[pom (\ encoding.utf8 decode pom)
pom (\ xml.codec decode pom)
profile (<xml>.run ///pom.parser pom)]
- (wrap {#///package.origin #///package.Remote
+ (wrap {#///package.origin (#///repository/origin.Remote "")
#///package.library library_&_status
#///package.pom [pom pom_status]}))))))
diff --git a/stdlib/source/program/aedifex/package.lux b/stdlib/source/program/aedifex/package.lux
index b3118a7e0..f6ba87078 100644
--- a/stdlib/source/program/aedifex/package.lux
+++ b/stdlib/source/program/aedifex/package.lux
@@ -15,28 +15,13 @@
[collection
[set (#+ Set)]]]]
["." // #_
- [dependency (#+ Dependency)
- ["#." status (#+ Status)]]
["/" profile]
["#." hash (#+ Hash SHA-1 MD5)]
- ["#." pom]])
-
-(type: #export Origin
- #Local
- #Remote)
-
-(structure: any_equivalence
- (Equivalence Any)
-
- (def: (= _ _)
- true))
-
-(def: origin_equivalence
- (Equivalence Origin)
- ($_ sum.equivalence
- ..any_equivalence
- ..any_equivalence
- ))
+ ["#." pom]
+ [dependency (#+ Dependency)
+ ["#." status (#+ Status)]]
+ [repository
+ ["#." origin (#+ Origin)]]])
(type: #export Package
{#origin Origin
@@ -44,17 +29,22 @@
#pom [XML Status]})
(template [<name> <tag>]
- [(def: #export <name>
+ [(def: #export (<name> package)
(-> Package Bit)
- (|>> (get@ #origin) (\ ..origin_equivalence = <tag>)))]
+ (case (get@ #origin package)
+ (<tag> _)
+ true
+
+ _
+ false))]
- [local? #Local]
- [remote? #Remote]
+ [local? #//origin.Local]
+ [remote? #//origin.Remote]
)
(def: #export (local pom library)
(-> XML Binary Package)
- {#origin #Local
+ {#origin (#//origin.Local "")
#library [library #//status.Unverified]
#pom [pom #//status.Unverified]})
@@ -68,7 +58,7 @@
(def: #export equivalence
(Equivalence Package)
($_ product.equivalence
- ..origin_equivalence
+ //origin.equivalence
(product.equivalence binary.equivalence //status.equivalence)
(product.equivalence xml.equivalence //status.equivalence)
))
diff --git a/stdlib/source/program/aedifex/repository/origin.lux b/stdlib/source/program/aedifex/repository/origin.lux
new file mode 100644
index 000000000..ca97a8cff
--- /dev/null
+++ b/stdlib/source/program/aedifex/repository/origin.lux
@@ -0,0 +1,21 @@
+(.module:
+ [lux #*
+ [abstract
+ [equivalence (#+ Equivalence)]]
+ [data
+ ["." sum]
+ ["." text]]
+ [world
+ [file (#+ Path)]
+ [net (#+ URL)]]])
+
+(type: #export Origin
+ (#Local Path)
+ (#Remote URL))
+
+(def: #export equivalence
+ (Equivalence Origin)
+ ($_ sum.equivalence
+ text.equivalence
+ text.equivalence
+ ))