@@ -98,7 +98,7 @@ Method urlGet() As %String
98
98
SET host = ..ServerURL ()
99
99
SET name = $ZCONVERT (..name , " O" , " URL" )
100
100
SET version = $ZCONVERT (..version , " O" , " URL" )
101
- RETURN host _ " /" _ name _ " /-/" _ name _ " -" _ version _ " .tgz"
101
+ RETURN host _ " /download/ " _ name _ " /-/" _ name _ " -" _ version _ " .tgz"
102
102
}
103
103
104
104
Method installerUrlGet () As %String
@@ -266,7 +266,6 @@ ClassMethod DownloadPackageFromGitHub(url As %String) As %String
266
266
Do fs .CopyFromAndSave (ht .HttpResponse .Data )
267
267
268
268
Set outputFolder = $$$FileTempDir
269
- Do ##class (%File ).CreateDirectory (outputFolder )
270
269
Set res = $zf (-100 , " " , " tar" , " -zxvf" , archiveFileName , " -C" , outputFolder )
271
270
272
271
Return outputFolder
@@ -286,16 +285,29 @@ ClassMethod GetModuleMeta(url As %String) As %DynamicObject
286
285
Set ht .Port = port
287
286
}
288
287
Set ht .Location = tComponents (" path" )_" master/module.xml"
289
-
290
288
$$$ThrowOnError(ht .Get ())
291
289
If (ht .HttpResponse .StatusCode '=200 ) {
292
290
$$$ThrowStatus($$$ERROR(5001 ," Unable to download XML " _ht .Location ))
293
291
}
294
- $$$ThrowOnError(##class (%XML.XPATH.Document ).CreateFromStream (ht .HttpResponse .Data , .xpathdoc ))
292
+ Set tmpFolder = $$$FileTempDir
293
+
294
+ Set stream =##class (%Stream.FileCharacter ).%New ()
295
+ Do stream .LinkToFile (tmpFolder _" /module.xml" )
296
+ Set stream .TranslateTable = " UTF8"
297
+ Do stream .CopyFrom (ht .HttpResponse .Data )
298
+ Do stream .%Save ()
299
+
300
+ set binaryStream =##class (%Stream.FileBinary ).%New ()
301
+ do binaryStream .LinkToFile (tmpFolder _" /module.xml" )
302
+
303
+ $$$ThrowOnError(##class (%XML.XPATH.Document ).CreateFromStream (binaryStream , .xpathdoc ))
295
304
$$$ThrowOnError(xpathdoc .EvaluateExpression (" /" ," Export/Document/Module/Version/text()" , .tResults ))
296
305
set jo .version = tResults .GetAt (1 ).ValueGet ()
297
306
$$$ThrowOnError(xpathdoc .EvaluateExpression (" /" ," Export/Document/Module/Name/text()" , .tResults ))
298
- set jo .name = tResults .GetAt (1 ).ValueGet ()
307
+ set jo .name = $$$lcase(tResults .GetAt (1 ).ValueGet ())
308
+
309
+ Do ##class (%File ).RemoveDirectoryTree (tmpFolder )
310
+
299
311
return jo
300
312
}
301
313
@@ -307,8 +319,8 @@ ClassMethod UpdatePackage(jo As %DynamicObject) As %Status
307
319
#; set url = $ZCONVERT(url, "L")
308
320
If $Extract (url , *)'=" /" {
309
321
Set url = url _ " /"
310
- }
311
- Set name = ..GetPackageNameFromRepositoryURL (url )
322
+ }
323
+ Set name = ..GetPackageNameFromRepositoryURL (url )
312
324
Set meta = ..GetModuleMeta (url )
313
325
If (meta .version = " " ) { $$$ThrowStatus($$$ERROR(5001 , " Invalid package version" )) }
314
326
If (meta .name = " " ) { $$$ThrowStatus($$$ERROR(5001 , " Package name is empty" )) }
@@ -339,7 +351,6 @@ ClassMethod UpdatePackage(jo As %DynamicObject) As %Status
339
351
340
352
ClassMethod Publish (url As %String , name As %String ) As %Status
341
353
{
342
-
343
354
Set outputFolder = ..DownloadPackageFromGitHub (url )
344
355
Set packageFolder = ##class (%File ).NormalizeDirectory (name _ " -master" , outputFolder )
345
356
Return ..LoadPackage (packageFolder , url , 1 )
@@ -353,7 +364,7 @@ ClassMethod LoadFromGitHub(Url = "")
353
364
If $e (Url , *)'=" /" {
354
365
Set Url = Url _ " /"
355
366
}
356
- Set name = ..GetPackageNameFromRepositoryURL (Url )
367
+ Set name = ..GetPackageNameFromRepositoryURL (Url )
357
368
Set outputFolder = ..DownloadPackageFromGitHub (Url )
358
369
Set packageFolder = ##class (%File ).NormalizeDirectory (name _ " -master" , outputFolder )
359
370
Set tSC = ..LoadPackage (packageFolder , Url )
0 commit comments