@@ -614,7 +614,7 @@ subroutine get_from_registry(self, target_dir, global_settings, error, downloade
614
614
! > Downloader instance.
615
615
class(downloader_t), optional , intent (in ) :: downloader_
616
616
617
- character (:), allocatable :: cache_path, target_url, tmp_file, tmp_path
617
+ character (:), allocatable :: cache_path, target_url, tmp_pkg_data_path, tmp_pkg_data_file
618
618
type (version_t) :: version
619
619
integer :: stat, unit
620
620
type (json_object) :: json
@@ -644,17 +644,17 @@ subroutine get_from_registry(self, target_dir, global_settings, error, downloade
644
644
end if
645
645
646
646
! Define location of the temporary folder and file.
647
- tmp_path = join_path(global_settings% path_to_config_folder, ' tmp' )
648
- tmp_file = join_path(tmp_path , ' package_data.tmp' )
649
- if (.not. exists(tmp_path )) call mkdir(tmp_path )
650
- open (newunit= unit, file= tmp_file , action= ' readwrite' , iostat= stat)
647
+ tmp_pkg_data_path = join_path(global_settings% path_to_config_folder, ' tmp' )
648
+ tmp_pkg_data_file = join_path(tmp_pkg_data_path , ' package_data.tmp' )
649
+ if (.not. exists(tmp_pkg_data_path )) call mkdir(tmp_pkg_data_path )
650
+ open (newunit= unit, file= tmp_pkg_data_file , action= ' readwrite' , iostat= stat)
651
651
if (stat /= 0 ) then
652
652
call fatal_error(error, " Error creating temporary file for downloading package '" // self% name// " '." ); return
653
653
end if
654
654
655
655
! Include namespace and package name in the target url and download package data.
656
656
target_url = global_settings% registry_settings% url// ' /packages/' // self% namespace// ' /' // self% name
657
- call downloader% get_pkg_data(target_url, self% requested_version, tmp_file , json, error)
657
+ call downloader% get_pkg_data(target_url, self% requested_version, tmp_pkg_data_file , json, error)
658
658
close (unit, status= ' delete' )
659
659
if (allocated (error)) return
660
660
@@ -663,7 +663,7 @@ subroutine get_from_registry(self, target_dir, global_settings, error, downloade
663
663
if (allocated (error)) return
664
664
665
665
! Open new tmp file for downloading the actual package.
666
- open (newunit= unit, file= tmp_file , action= ' readwrite' , iostat= stat)
666
+ open (newunit= unit, file= tmp_pkg_data_file , action= ' readwrite' , iostat= stat)
667
667
if (stat /= 0 ) then
668
668
call fatal_error(error, " Error creating temporary file for downloading package '" // self% name// " '." ); return
669
669
end if
@@ -675,13 +675,13 @@ subroutine get_from_registry(self, target_dir, global_settings, error, downloade
675
675
call mkdir(cache_path)
676
676
677
677
print * , " Downloading '" // join_path(self% namespace, self% name, version% s())// " ' ..."
678
- call downloader% get_file(target_url, tmp_file , error)
678
+ call downloader% get_file(target_url, tmp_pkg_data_file , error)
679
679
if (allocated (error)) then
680
680
close (unit, status= ' delete' ); return
681
681
end if
682
682
683
683
! Unpack the downloaded package to the final location.
684
- call downloader% unpack (tmp_file , cache_path, error)
684
+ call downloader% unpack (tmp_pkg_data_file , cache_path, error)
685
685
close (unit, status= ' delete' )
686
686
if (allocated (error)) return
687
687
end if
0 commit comments