@@ -34,43 +34,43 @@ import (
3434func (release * DownloadResource ) Install (downloadDir , tempPath , destDir * paths.Path ) error {
3535 // Check the integrity of the package
3636 if ok , err := release .TestLocalArchiveIntegrity (downloadDir ); err != nil {
37- return fmt .Errorf (tr ("testing local archive integrity: %s" ) , err )
37+ return fmt .Errorf (tr ("testing local archive integrity: %s" , err ) )
3838 } else if ! ok {
3939 return fmt .Errorf (tr ("checking local archive integrity" ))
4040 }
4141
4242 // Create a temporary dir to extract package
4343 if err := tempPath .MkdirAll (); err != nil {
44- return fmt .Errorf (tr ("creating temp dir for extraction: %s" ) , err )
44+ return fmt .Errorf (tr ("creating temp dir for extraction: %s" , err ) )
4545 }
4646 tempDir , err := tempPath .MkTempDir ("package-" )
4747 if err != nil {
48- return fmt .Errorf (tr ("creating temp dir for extraction: %s" ) , err )
48+ return fmt .Errorf (tr ("creating temp dir for extraction: %s" , err ) )
4949 }
5050 defer tempDir .RemoveAll ()
5151
5252 // Obtain the archive path and open it
5353 archivePath , err := release .ArchivePath (downloadDir )
5454 if err != nil {
55- return fmt .Errorf (tr ("getting archive path: %s" ) , err )
55+ return fmt .Errorf (tr ("getting archive path: %s" , err ) )
5656 }
5757 file , err := os .Open (archivePath .String ())
5858 if err != nil {
59- return fmt .Errorf (tr ("opening archive file: %s" ) , err )
59+ return fmt .Errorf (tr ("opening archive file: %s" , err ) )
6060 }
6161 defer file .Close ()
6262
6363 // Extract into temp directory
6464 ctx , cancel := cleanup .InterruptableContext (context .Background ())
6565 defer cancel ()
6666 if err := extract .Archive (ctx , file , tempDir .String (), nil ); err != nil {
67- return fmt .Errorf (tr ("extracting archive: %s" ) , err )
67+ return fmt .Errorf (tr ("extracting archive: %s" , err ) )
6868 }
6969
7070 // Check package content and find package root dir
7171 root , err := findPackageRoot (tempDir )
7272 if err != nil {
73- return fmt .Errorf (tr ("searching package root dir: %s" ) , err )
73+ return fmt .Errorf (tr ("searching package root dir: %s" , err ) )
7474 }
7575
7676 // Ensure container dir exists
@@ -91,7 +91,7 @@ func (release *DownloadResource) Install(downloadDir, tempPath, destDir *paths.P
9191
9292 // Move/rename the extracted root directory in the destination directory
9393 if err := root .Rename (destDir ); err != nil {
94- return fmt .Errorf (tr ("moving extracted archive to destination dir: %s" ) , err )
94+ return fmt .Errorf (tr ("moving extracted archive to destination dir: %s" , err ) )
9595 }
9696
9797 // TODO
@@ -115,7 +115,7 @@ func IsDirEmpty(path *paths.Path) (bool, error) {
115115func findPackageRoot (parent * paths.Path ) (* paths.Path , error ) {
116116 files , err := parent .ReadDir ()
117117 if err != nil {
118- return nil , fmt .Errorf (tr ("reading package root dir: %s" ) , err )
118+ return nil , fmt .Errorf (tr ("reading package root dir: %s" , err ) )
119119 }
120120 var root * paths.Path
121121 for _ , file := range files {
@@ -125,7 +125,7 @@ func findPackageRoot(parent *paths.Path) (*paths.Path, error) {
125125 if root == nil {
126126 root = file
127127 } else {
128- return nil , fmt .Errorf (tr ("no unique root dir in archive, found '%[1]s' and '%[2]s'" ) , root , file )
128+ return nil , fmt .Errorf (tr ("no unique root dir in archive, found '%[1]s' and '%[2]s'" , root , file ) )
129129 }
130130 }
131131 if root == nil {
0 commit comments