@@ -130,7 +130,7 @@ func apiPublishRepoOrSnapshot(c *gin.Context) {
130130 var resources []string
131131 collectionFactory := context .NewCollectionFactory ()
132132
133- if b .SourceKind == "snapshot" {
133+ if b .SourceKind == deb . SourceSnapshot {
134134 var snapshot * deb.Snapshot
135135
136136 snapshotCollection := collectionFactory .SnapshotCollection ()
@@ -182,7 +182,7 @@ func apiPublishRepoOrSnapshot(c *gin.Context) {
182182 return
183183 }
184184
185- published , err := deb .NewPublishedRepo (storage , prefix , b .Distribution , b .Architectures , components , sources , collectionFactory )
185+ published , err := deb .NewPublishedRepo (storage , prefix , b .Distribution , b .Architectures , components , sources , collectionFactory , b . MultiDist )
186186 if err != nil {
187187 AbortWithJSONError (c , 500 , fmt .Errorf ("unable to publish: %s" , err ))
188188 return
@@ -232,7 +232,7 @@ func apiPublishRepoOrSnapshot(c *gin.Context) {
232232 return & task.ProcessReturnValue {Code : http .StatusBadRequest , Value : nil }, fmt .Errorf ("prefix/distribution already used by another published repo: %s" , duplicate )
233233 }
234234
235- err := published .Publish (context .PackagePool (), context , collectionFactory , signer , publishOutput , b .ForceOverwrite , b . MultiDist )
235+ err := published .Publish (context .PackagePool (), context , collectionFactory , signer , publishOutput , b .ForceOverwrite )
236236 if err != nil {
237237 return & task.ProcessReturnValue {Code : http .StatusInternalServerError , Value : nil }, fmt .Errorf ("unable to publish: %s" , err )
238238 }
@@ -263,7 +263,7 @@ func apiPublishUpdateSwitch(c *gin.Context) {
263263 Name string `binding:"required"`
264264 }
265265 AcquireByHash * bool
266- MultiDist bool
266+ MultiDist * bool
267267 }
268268
269269 if c .Bind (& b ) != nil {
@@ -339,10 +339,14 @@ func apiPublishUpdateSwitch(c *gin.Context) {
339339 published .AcquireByHash = * b .AcquireByHash
340340 }
341341
342+ if b .MultiDist != nil {
343+ published .MultiDist = * b .MultiDist
344+ }
345+
342346 resources = append (resources , string (published .Key ()))
343347 taskName := fmt .Sprintf ("Update published %s (%s): %s" , published .SourceKind , strings .Join (updatedComponents , " " ), strings .Join (updatedSnapshots , ", " ))
344348 maybeRunTaskInBackground (c , taskName , resources , func (out aptly.Progress , _ * task.Detail ) (* task.ProcessReturnValue , error ) {
345- err := published .Publish (context .PackagePool (), context , collectionFactory , signer , out , b .ForceOverwrite , b . MultiDist )
349+ err := published .Publish (context .PackagePool (), context , collectionFactory , signer , out , b .ForceOverwrite )
346350 if err != nil {
347351 return & task.ProcessReturnValue {Code : http .StatusInternalServerError , Value : nil }, fmt .Errorf ("unable to update: %s" , err )
348352 }
0 commit comments