-
-
Notifications
You must be signed in to change notification settings - Fork 5
fix(packages.xqm): iterate over configured repos #17
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
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -18,7 +18,7 @@ declare option output:method "html5"; | |
| declare option output:media-type "text/html"; | ||
|
|
||
| declare variable $packages:configuration := doc($config:app-root || "/configuration.xml"); | ||
|
|
||
| declare variable $packages:repos := $packages:configuration//repository[@active='true']; | ||
| declare variable $packages:DEFAULTS := doc($config:app-root || "/defaults.xml")/apps; | ||
| declare variable $packages:ADMINAPPS := ["dashboard","backup"]; | ||
| declare variable $packages:HIDE := ("dashboard"); | ||
|
|
@@ -101,8 +101,9 @@ declare function packages:get-remote-packages(){ | |
| }; | ||
| :) | ||
|
|
||
| (:~ only return repos that are set to active :) | ||
| declare function packages:get-repo-locations(){ | ||
| data($packages:configuration//repository) | ||
| data($packages:configuration//repository[@active = 'true']) | ||
| }; | ||
|
|
||
|
|
||
|
|
@@ -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 | ||
| let $urls := $pkgs || "/public/apps.xml?version=" || packages:get-version() || | ||
| "&source=" || util:system-property("product-source") | ||
| (: EXPath client module does not work properly. No idea why. :) | ||
| let $request := | ||
| let $request := for $url in $urls | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe 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. |
||
| return | ||
| <http:request method="get" href="{$url}" timeout="10"> | ||
| <http:header name="Cache-Control" value="no-cache"/> | ||
| </http:request> | ||
|
|
||
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
$pkgas 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-listI really would like to avoid using identical variable names for different things in the library