Hello community, here is the log from the commit of package rubygem-winrm-fs for openSUSE:Factory checked in at 2017-10-27 14:01:41 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/rubygem-winrm-fs (Old) and /work/SRC/openSUSE:Factory/.rubygem-winrm-fs.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "rubygem-winrm-fs" Fri Oct 27 14:01:41 2017 rev:3 rq:536955 version:1.1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/rubygem-winrm-fs/rubygem-winrm-fs.changes 2017-09-23 21:34:27.940304651 +0200 +++ /work/SRC/openSUSE:Factory/.rubygem-winrm-fs.new/rubygem-winrm-fs.changes 2017-10-27 14:01:57.674503106 +0200 @@ -1,0 +2,9 @@ +Thu Oct 26 10:15:05 UTC 2017 - [email protected] + +- updated to version 1.1.0 + see installed changelog.md + + # 1.1.0 + - Convert MD5 hashes to SHA1. + +------------------------------------------------------------------- Old: ---- winrm-fs-1.0.2.gem New: ---- winrm-fs-1.1.0.gem ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ rubygem-winrm-fs.spec ++++++ --- /var/tmp/diff_new_pack.IGqPUI/_old 2017-10-27 14:01:59.602412983 +0200 +++ /var/tmp/diff_new_pack.IGqPUI/_new 2017-10-27 14:01:59.606412796 +0200 @@ -24,7 +24,7 @@ # Name: rubygem-winrm-fs -Version: 1.0.2 +Version: 1.1.0 Release: 0 %define mod_name winrm-fs %define mod_full_name %{mod_name}-%{version} ++++++ winrm-fs-1.0.2.gem -> winrm-fs-1.1.0.gem ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/VERSION new/VERSION --- old/VERSION 2017-09-19 18:47:51.000000000 +0200 +++ new/VERSION 2017-10-12 19:22:04.000000000 +0200 @@ -1 +1 @@ -1.0.2 +1.1.0 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/changelog.md new/changelog.md --- old/changelog.md 2017-09-19 18:47:51.000000000 +0200 +++ new/changelog.md 2017-10-12 19:22:04.000000000 +0200 @@ -1,4 +1,7 @@ # WinRM-fs Gem Changelog +# 1.1.0 +- Convert MD5 hashes to SHA1. + # 1.0.2 - Fix `Pathname.glob` expansion of shortnames. Binary files old/checksums.yaml.gz and new/checksums.yaml.gz differ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/winrm-fs/core/file_transporter.rb new/lib/winrm-fs/core/file_transporter.rb --- old/lib/winrm-fs/core/file_transporter.rb 2017-09-19 18:47:51.000000000 +0200 +++ new/lib/winrm-fs/core/file_transporter.rb 2017-10-12 19:22:04.000000000 +0200 @@ -70,7 +70,7 @@ # @param locals [Array<String>,String] one or more local file or # directory paths # @param remote [String] the base destination path on the remote host - # @return [Hash] report hash, keyed by the local MD5 digest + # @return [Hash] report hash, keyed by the local SHA1 digest def upload(locals, remote) files = nil report = nil @@ -147,8 +147,8 @@ # will have the base name of the source file appended. This only # applies to file uploads and not to folder uploads. # - # @param files [Hash] files hash, keyed by the local MD5 digest - # @return [Hash] a report hash, keyed by the local MD5 digest + # @param files [Hash] files hash, keyed by the local SHA1 digest + # @return [Hash] a report hash, keyed by the local SHA1 digest # @api private def reconcile_destinations!(files) files.each do |_, data| @@ -158,10 +158,10 @@ end end - # Adds an entry to a files Hash (keyed by local MD5 digest) for a + # Adds an entry to a files Hash (keyed by local SHA1 digest) for a # directory. When a directory is added, a temporary Zip file is created # containing the contents of the directory and any file-related data - # such as MD5 digest, size, etc. will be referring to the Zip file. + # such as SHA1 digest, size, etc. will be referring to the Zip file. # # @param hash [Hash] hash to be mutated # @param dir [String] directory path to be Zipped and added @@ -170,19 +170,19 @@ def add_directory_hash!(hash, dir, remote) logger.debug "creating hash for directory #{remote}" zip_io = TmpZip.new(dir, logger) - zip_md5 = md5sum(zip_io.path) + zip_sha1 = sha1sum(zip_io.path) - hash[zip_md5] = { + hash[zip_sha1] = { 'src' => dir, 'src_zip' => zip_io.path.to_s, 'zip_io' => zip_io, - 'tmpzip' => "#{TEMP_UPLOAD_DIRECTORY}\\tmpzip-#{zip_md5}.zip", + 'tmpzip' => "#{TEMP_UPLOAD_DIRECTORY}\\tmpzip-#{zip_sha1}.zip", 'dst' => "#{remote}\\#{File.basename(dir)}", 'size' => File.size(zip_io.path) } end - # Adds an entry to a files Hash (keyed by local MD5 digest) for a file. + # Adds an entry to a files Hash (keyed by local SHA1 digest) for a file. # # @param hash [Hash] hash to be mutated # @param local [String] file path @@ -191,7 +191,7 @@ def add_file_hash!(hash, local, remote) logger.debug "creating hash for file #{remote}" - hash[md5sum(local)] = { + hash[sha1sum(local)] = { 'src' => local, 'dst' => remote, 'size' => File.size(local) @@ -199,12 +199,12 @@ end # Runs the check_files PowerShell script against a collection of - # destination path/MD5 checksum pairs. The PowerShell script returns + # destination path/SHA1 checksum pairs. The PowerShell script returns # its results as a CSV-formatted report which is converted into a Ruby # Hash. # - # @param files [Hash] files hash, keyed by the local MD5 digest - # @return [Hash] a report hash, keyed by the local MD5 digest + # @param files [Hash] files hash, keyed by the local SHA1 digest + # @return [Hash] a report hash, keyed by the local SHA1 digest # @api private def check_files(files) logger.debug 'Running check_files.ps1' @@ -213,16 +213,16 @@ parse_response(shell.run(script)) end - # Constructs a collection of destination path/MD5 checksum pairs as a + # Constructs a collection of destination path/SHA1 checksum pairs as a # String representation of the contents of a PowerShell Hash Table. # - # @param files [Hash] files hash, keyed by the local MD5 digest + # @param files [Hash] files hash, keyed by the local SHA1 digest # @return [String] the inner contents of a PowerShell Hash Table # @api private def check_files_ps_hash(files) - hash = files.map do |md5, data| + hash = files.map do |sha1, data| [ - md5, + sha1, { 'target' => data.fetch('tmpzip', data['dst']), 'src_basename' => File.basename(data['src']), @@ -239,9 +239,9 @@ # @param files [Hash] a files hash # @api private def cleanup(files) - files.select { |_, data| data.key?('zip_io') }.each do |md5, data| + files.select { |_, data| data.key?('zip_io') }.each do |sha1, data| data.fetch('zip_io').unlink - files.fetch(md5).delete('zip_io') + files.fetch(sha1).delete('zip_io') logger.debug "Cleaned up src_zip #{data['src_zip']}" end end @@ -252,8 +252,8 @@ # Hash. The script will not be invoked if there are no zip files # present in the incoming files Hash. # - # @param files [Hash] files hash, keyed by the local MD5 digest - # @return [Hash] a report hash, keyed by the local MD5 digest + # @param files [Hash] files hash, keyed by the local SHA1 digest + # @return [Hash] a report hash, keyed by the local SHA1 digest # @api private def extract_files(files) extracted_files = extract_files_ps_hash(files) @@ -273,17 +273,17 @@ # all zipped folders as a String representation of the contents of a # PowerShell Hash Table. # - # @param files [Hash] files hash, keyed by the local MD5 digest + # @param files [Hash] files hash, keyed by the local SHA1 digest # @return [String] the inner contents of a PowerShell Hash Table # @api private def extract_files_ps_hash(files) file_data = files.select { |_, data| data.key?('tmpzip') } - result = file_data.map do |md5, data| + result = file_data.map do |sha1, data| val = { 'dst' => data['dst'] } val['tmpzip'] = data['tmpzip'] if data['tmpzip'] - [md5, val] + [sha1, val] end ps_hash(Hash[result]) @@ -300,14 +300,14 @@ format('(%dm%.2fs)', minutes, seconds) end - # Contructs a Hash of files or directories, keyed by the local MD5 + # Contructs a Hash of files or directories, keyed by the local SHA1 # digest. Each file entry has a source and destination set, at a # minimum. # # @param locals [Array<String>] a collection of local files or # directories # @param remote [String] the base destination path on the remote host - # @return [Hash] files hash, keyed by the local MD5 digest + # @return [Hash] files hash, keyed by the local SHA1 digest # @api private def make_files_hash(locals, remote) hash = {} @@ -327,17 +327,17 @@ hash end - # @return [String] the MD5 digest of a local file + # @return [String] the SHA1 digest of a local file # @api private - def md5sum(local) - Digest::MD5.file(local).hexdigest + def sha1sum(local) + Digest::SHA1.file(local).hexdigest end # Destructively merges a report Hash into an existing files Hash. # **Note:** this method mutates the files Hash. # - # @param files [Hash] files hash, keyed by the local MD5 digest - # @param report [Hash] report hash, keyed by the local MD5 digest + # @param files [Hash] files hash, keyed by the local SHA1 digest + # @param report [Hash] report hash, keyed by the local SHA1 digest # @api private def merge_with_report!(files, report) files.merge!(report) { |_, oldval, newval| oldval.merge(newval) } @@ -355,7 +355,7 @@ # # @param output [WinRM::Output] output object with stdout, stderr, and # exit code - # @return [Hash] report hash, keyed by the local MD5 digest + # @return [Hash] report hash, keyed by the local SHA1 digest # @api private def parse_response(output) exitcode = output.exitcode @@ -374,7 +374,7 @@ array = CSV.parse(output.stdout, headers: true).map(&:to_hash) array.each { |h| h.each { |key, value| h[key] = nil if value == '' } } - Hash[array.map { |entry| [entry.fetch('src_md5'), entry] }] + Hash[array.map { |entry| [entry.fetch('src_sha1'), entry] }] end # Converts a Ruby hash into a PowerShell hash table, represented in a @@ -487,20 +487,20 @@ # Base64-encoded temporary files. A "dirty" file is one which has the # `"chk_dirty"` option set to `"True"` in the incoming files Hash. # - # @param files [Hash] files hash, keyed by the local MD5 digest - # @return [Hash] a report hash, keyed by the local MD5 digest + # @param files [Hash] files hash, keyed by the local SHA1 digest + # @return [Hash] a report hash, keyed by the local SHA1 digest # @api private def stream_upload_files(files) response = {} - files.each do |md5, data| + files.each do |sha1, data| src = data.fetch('src_zip', data['src']) if data['chk_dirty'] == 'True' - response[md5] = { 'dest' => data['tmpzip'] || data['dst'] } + response[sha1] = { 'dest' => data['tmpzip'] || data['dst'] } chunks, bytes = stream_upload_file(src, data['tmpzip'] || data['dst']) do |xfered| yield data['src'], xfered end - response[md5]['chunks'] = chunks - response[md5]['xfered'] = bytes + response[sha1]['chunks'] = chunks + response[sha1]['xfered'] = bytes else logger.debug "File #{data['dst']} is up to date, skipping" end @@ -512,7 +512,7 @@ # Calculates count based on the sum of base64 encoded content size # of all files base 64 that are dirty. # - # @param files [Hash] files hash, keyed by the local MD5 digest + # @param files [Hash] files hash, keyed by the local SHA1 digest # @return [Fixnum] total byte size # @api private def total_base64_transfer_size(files) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/winrm-fs/file_manager.rb new/lib/winrm-fs/file_manager.rb --- old/lib/winrm-fs/file_manager.rb 2017-09-19 18:47:51.000000000 +0200 +++ new/lib/winrm-fs/file_manager.rb 2017-10-12 19:22:04.000000000 +0200 @@ -29,11 +29,11 @@ @logger = connection.logger end - # Gets the MD5 checksum of the specified file if it exists, + # Gets the SHA1 checksum of the specified file if it exists, # otherwise '' # @param [String] The remote file path # @parms [String] The digest method - def checksum(path, digest = 'MD5') + def checksum(path, digest = 'SHA1') @logger.debug("checksum with #{digest}: #{path}") script = WinRM::FS::Scripts.render('checksum', path: path, digest: digest) @connection.shell(:powershell) { |e| e.run(script).stdout.chomp } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/winrm-fs/scripts/check_files.ps1.erb new/lib/winrm-fs/scripts/check_files.ps1.erb --- old/lib/winrm-fs/scripts/check_files.ps1.erb 2017-09-19 18:47:51.000000000 +0200 +++ new/lib/winrm-fs/scripts/check_files.ps1.erb 2017-10-12 19:22:04.000000000 +0200 @@ -16,18 +16,18 @@ } New-Object psobject -Property @{ chk_exists = ($exists = Test-Path $dst -PathType Leaf) - src_md5 = ($sMd5 = $_.Key) - dst_md5 = ($dMd5 = if ($exists) { Get-MD5Sum $dst } else { $null }) + src_sha1 = ($sMd5 = $_.Key) + dst_sha1 = ($dMd5 = if ($exists) { Get-SHA1Sum $dst } else { $null }) chk_dirty = ($dirty = if ($sMd5 -ne $dMd5) { $true } else { $false }) verifies = if ($dirty -eq $false) { $true } else { $false } target_is_folder = $dst_changed } - } | Select-Object -Property chk_exists,src_md5,dst_md5,chk_dirty,verifies,target_is_folder + } | Select-Object -Property chk_exists,src_sha1,dst_sha1,chk_dirty,verifies,target_is_folder } -Function Get-MD5Sum($src) { +Function Get-SHA1Sum($src) { Try { - $c = [System.Security.Cryptography.MD5]::Create() + $c = [System.Security.Cryptography.SHA1]::Create() $bytes = $c.ComputeHash(($in = (Get-Item $src).OpenRead())) return ([System.BitConverter]::ToString($bytes)).Replace("-", "").ToLower() } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/lib/winrm-fs/scripts/extract_files.ps1.erb new/lib/winrm-fs/scripts/extract_files.ps1.erb --- old/lib/winrm-fs/scripts/extract_files.ps1.erb 2017-09-19 18:47:51.000000000 +0200 +++ new/lib/winrm-fs/scripts/extract_files.ps1.erb 2017-10-12 19:22:04.000000000 +0200 @@ -17,7 +17,7 @@ $value = $hash[$key] $tzip, $dst = $Value["tmpzip"], $Value["dst"] if ($tzip) {Unzip-File $tzip $dst} - New-Object psobject -Property @{dst=$dst;src_md5=$key;tmpzip=$tzip} + New-Object psobject -Property @{dst=$dst;src_sha1=$key;tmpzip=$tzip} } } diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/metadata new/metadata --- old/metadata 2017-09-19 18:47:51.000000000 +0200 +++ new/metadata 2017-10-12 19:22:04.000000000 +0200 @@ -1,7 +1,7 @@ --- !ruby/object:Gem::Specification name: winrm-fs version: !ruby/object:Gem::Version - version: 1.0.2 + version: 1.1.0 platform: ruby authors: - Shawn Neal @@ -9,7 +9,7 @@ autorequire: bindir: bin cert_chain: [] -date: 2017-09-19 00:00:00.000000000 Z +date: 2017-10-12 00:00:00.000000000 Z dependencies: - !ruby/object:Gem::Dependency name: erubis
