-
-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(packages.xqm): iterate over configured repos #17
base: master
Are you sure you want to change the base?
Conversation
Nice! I'm curious: with your PR, what happens if the same package is available from two repos? Are there two entries or just one? |
there are two entries, it would be nice if the package-manager would sport separate tabs for each repo, or somehow visually distinguish which copy comes from which source, but that is code in another repo. First the xquery lib needs to actually support muliple repos, which i guess was the intention since otherwise the wrapper element is kind of superfluous. |
edit readme and expath to match see eXist-db/existdb-packageservice#17
Exciting! Does this resolve dependencies across all the repositories? I.e. if packageA is in repository1 one and it has a dependency on packageB, which happens to be in repository2, will the package manager now grab packageB from repository2 in order to resolve the dependency? |
@brobertson This is untested. I have the same requirement. |
duplicate packages appear as duplicate entries in the list of packages see my package manager issue linked above. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please could you post the contents of |
@dizzzz how could it not be a sequence??? the following <settings>
<repositories>
<repository active="true" default="true">http://exist-db.org/exist/apps/public-repo</repository>
<repository active="true" default="false">http://heml.ddns.net:8080/exist/apps/public-repo/</repository>
</repositories>
<readonly>
<package>http://exist-db.org/apps/existdb-packageservice</package>
<package>http://exist-db.org/apps/packagemanager</package>
</readonly>
</settings> |
@line-o ok cross-repo dependency resolution is not working:
|
Ok, I had no idea that in https://www.w3.org/TR/xpath-30/#id-string-concat-expr checking the [saxon gives the same results] but see ... |
@@ -282,10 +283,12 @@ declare function packages:get-package-meta($app as xs:string, $name as xs:string | |||
(: should be private but there seems to be a bug :) | |||
declare function packages:public-repo-contents($installed as element(repo-app)*) { | |||
try { | |||
let $url := $config:DEFAULT-REPO || "/public/apps.xml?version=" || packages:get-version() || | |||
for $pkgs in $packages:repos |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should rename this to $pkg
as this will be an item() from the tuple stream.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about $pkg-list
I really would like to avoid using identical variable names for different things in the library
"&source=" || util:system-property("product-source") | ||
(: EXPath client module does not work properly. No idea why. :) | ||
let $request := | ||
let $request := for $url in $urls |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This for
doesn't make any sense to me. As a $pkg
(or $pkgs
) can only be an item() not a sequence. Therefore I think this for
is redundant...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is not redundant, without it the sequence of all packages is looked up in both repos, with 1 cannot find package error message for each package from repo a not present in repo b, and vice versa.
The for loop sends the request to the endpoint it should go to, the repo that contains the packages in question.
no tests in this source repo, so screenshot it is for proof it is working: 59 packages includes public repo +1 test from mine.
i m not sure how the
@default
flag on repos is supposed to be interpreted i could not generate any visible changes by switching it tofalse
, my code changes iterate over all repos which have the@active
flag set totrue
irrespective of@default
see brobertson/Lace2#124
see #16