From d26df1878bd703a40204ad68c8df2472e869b631 Mon Sep 17 00:00:00 2001 From: markuszilch Date: Wed, 20 Mar 2024 13:08:37 +0100 Subject: [PATCH 1/2] add puppet-* modules to output if they had no successfull modulesync yet --- bin/outdated_modules_and_their_version | 24 +++++++++++++++++------- 1 file changed, 17 insertions(+), 7 deletions(-) diff --git a/bin/outdated_modules_and_their_version b/bin/outdated_modules_and_their_version index 55b6ecd1..7bd7406c 100755 --- a/bin/outdated_modules_and_their_version +++ b/bin/outdated_modules_and_their_version @@ -11,13 +11,23 @@ mod_ary = [] width_modules = 6 # min width is width of String "modulesync_config version" width_version = 25 -Dir.glob('modules/voxpupuli/puppet-*/.msync.yml').each do|f| - version_module = YAML.load_file(f)['modulesync_config_version'] - mod = f.split('/')[2] - if version != version_module - mod_ary.push([mod, version_module]) - width_modules = [width_modules, mod.length].max - width_version = [width_version, version_module.length].max +Dir.glob('modules/voxpupuli/puppet-*').each do |f| + if File.directory?(f) + if File.exists?(f + '/.msync.yml') + version_module = YAML.load_file(f + '/.msync.yml')['modulesync_config_version'] + mod = (f + '/.msync.yml').split('/')[2] + if version != version_module + mod_ary.push([mod, version_module]) + width_modules = [width_modules, mod.length].max + width_version = [width_version, version_module.length].max + end + else + version_module = 'None' + mod = (f + '/.msync.yml').split('/')[2] + mod_ary.push([mod, version_module]) + width_modules = [width_modules, mod.length].max + width_version = [width_version, version_module.length].max + end end end From bf7fcfcbd192b0d86312f0a00517f419462d1aa5 Mon Sep 17 00:00:00 2001 From: markuszilch Date: Wed, 20 Mar 2024 13:24:42 +0100 Subject: [PATCH 2/2] remove unneeded filecheck; cleanup module name split; sort modules --- bin/outdated_modules_and_their_version | 24 +++++++++++------------- 1 file changed, 11 insertions(+), 13 deletions(-) diff --git a/bin/outdated_modules_and_their_version b/bin/outdated_modules_and_their_version index 7bd7406c..672d9051 100755 --- a/bin/outdated_modules_and_their_version +++ b/bin/outdated_modules_and_their_version @@ -11,23 +11,21 @@ mod_ary = [] width_modules = 6 # min width is width of String "modulesync_config version" width_version = 25 -Dir.glob('modules/voxpupuli/puppet-*').each do |f| - if File.directory?(f) - if File.exists?(f + '/.msync.yml') - version_module = YAML.load_file(f + '/.msync.yml')['modulesync_config_version'] - mod = (f + '/.msync.yml').split('/')[2] - if version != version_module - mod_ary.push([mod, version_module]) - width_modules = [width_modules, mod.length].max - width_version = [width_version, version_module.length].max - end - else - version_module = 'None' - mod = (f + '/.msync.yml').split('/')[2] +Dir.glob('modules/voxpupuli/puppet-*').sort.each do |f| + if File.exists?(f + '/.msync.yml') + version_module = YAML.load_file(f + '/.msync.yml')['modulesync_config_version'] + mod = (f).split('/')[2] + if version != version_module mod_ary.push([mod, version_module]) width_modules = [width_modules, mod.length].max width_version = [width_version, version_module.length].max end + else + version_module = 'None' + mod = (f).split('/')[2] + mod_ary.push([mod, version_module]) + width_modules = [width_modules, mod.length].max + width_version = [width_version, version_module.length].max end end