lib/omnibus/fetchers/net_fetcher.rb in omnibus-8.3.2 vs lib/omnibus/fetchers/net_fetcher.rb in omnibus-9.0.8

- old
+ new

@@ -210,28 +210,19 @@ # can be set in source[:extract] as: # :tar - use tar.exe and fail on errors (default strategy). # :seven_zip - use 7zip for all tar/compressed tar files on windows. # :lax_tar - use tar.exe on windows but ignore errors. # - # Both 7z and bsdtar have issues on windows. + # 7z has issues on windows. # # 7z cannot extract and untar at the same time. You need to extract to a # temporary location and then extract again into project_dir. # # 7z also doesn't handle symlinks well. A symlink to a non-existent # location simply results in a text file with the target path written in # it. It does this without throwing any errors. # - # bsdtar will exit(1) if it is encounters symlinks on windows. So we can't - # use shellout! directly. - # - # bsdtar will also exit(1) and fail to overwrite files at the destination - # during extraction if a file already exists at the destination and is - # marked read-only. This used to be a problem when we weren't properly - # cleaning an existing project_dir. It should be less of a problem now... - # but who knows. - # def extract # Only used by tar compression_switch = "" compression_switch = "z" if downloaded_file.end_with?("gz") compression_switch = "--lzma -" if downloaded_file.end_with?("lzma") @@ -241,10 +232,10 @@ if Ohai["platform"] == "windows" if downloaded_file.end_with?(*TAR_EXTENSIONS) && source[:extract] != :seven_zip returns = [0] returns << 1 if source[:extract] == :lax_tar - shellout!("tar #{compression_switch}xf #{safe_downloaded_file} -C#{safe_project_dir}", returns: returns) + shellout!("tar #{compression_switch}xf #{downloaded_file} --force-local -C#{project_dir}", returns: returns) elsif downloaded_file.end_with?(*COMPRESSED_TAR_EXTENSIONS) Dir.mktmpdir do |temp_dir| log.debug(log_key) { "Temporarily extracting `#{safe_downloaded_file}' to `#{temp_dir}'" } shellout!("7z.exe x #{safe_downloaded_file} -o#{windows_safe_path(temp_dir)} -r -y")