xezat 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.circleci/config.yml +1 -1
- data/.rubocop.yml +1 -0
- data/lib/xezat.rb +3 -3
- data/lib/xezat/command/announce.rb +22 -0
- data/lib/xezat/command/bump.rb +1 -1
- data/lib/xezat/command/bump/changelog.rb +8 -2
- data/lib/xezat/command/bump/compiler.rb +1 -1
- data/lib/xezat/command/bump/cygport_dep.rb +1 -1
- data/lib/xezat/command/bump/development_package.rb +1 -1
- data/lib/xezat/command/bump/file.rb +2 -2
- data/lib/xezat/command/bump/language.rb +1 -1
- data/lib/xezat/command/bump/runtime_package.rb +1 -1
- data/lib/xezat/command/bump/src_uri.rb +1 -1
- data/lib/xezat/command/doctor.rb +0 -2
- data/lib/xezat/command/port.rb +1 -1
- data/lib/xezat/command/validate.rb +68 -6
- data/lib/xezat/cygchangelog.rb +6 -4
- data/lib/xezat/cygversion.rb +6 -1
- data/lib/xezat/detector/asciidoc.rb +20 -0
- data/lib/xezat/detector/autoconf.rb +1 -1
- data/lib/xezat/detector/boost.m4.rb +1 -1
- data/lib/xezat/detector/cmake.rb +1 -1
- data/lib/xezat/detector/libtool.rb +2 -2
- data/lib/xezat/detector/make.rb +1 -1
- data/lib/xezat/detector/nasm.rb +16 -0
- data/lib/xezat/detector/ninja.rb +1 -1
- data/lib/xezat/detector/{python36-docutils.rb → python38-docutils.rb} +7 -2
- data/lib/xezat/detector/python38.rb +13 -0
- data/lib/xezat/detector/waf.rb +1 -1
- data/lib/xezat/detectors.rb +4 -4
- data/lib/xezat/generator/pkgconfig.rb +1 -1
- data/lib/xezat/main.rb +7 -0
- data/lib/xezat/packages.rb +1 -1
- data/lib/xezat/variables.rb +5 -4
- data/lib/xezat/version.rb +1 -1
- data/share/xezat/categories.yaml +51 -0
- data/share/xezat/repository/sourceforge.json +1 -1
- data/share/xezat/template/announce.erb +7 -0
- data/xezat.gemspec +1 -2
- metadata +11 -19
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 11d74a143e7b6c2d39ab8ee1698400adb87044e0ca8b3cfb8ef60df08641c0e6
|
4
|
+
data.tar.gz: 5f1ac17b9895d6c80aa15e27eeabd82e6678144097c92ccd9cb1021773b5c15b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5b14c63cecba36080b1ad95b3669cd2d837c22389e8074c5948d56ef134d1082eca62b0c7f2f16c7fac3b6d64581bc95defe4a2777efe1240a70b6763d8a6cf0
|
7
|
+
data.tar.gz: 71ae49dc2ee4282fc949538ed2176140d81b7950edbf12e965527fb005409fed9fcde547a6255eb0c4851372c3f14e12b7bc276a509755a5d15a5ba1a6ba71bc
|
data/.circleci/config.yml
CHANGED
data/.rubocop.yml
CHANGED
data/lib/xezat.rb
CHANGED
@@ -12,9 +12,9 @@ module Xezat
|
|
12
12
|
class << self
|
13
13
|
attr_accessor :logger
|
14
14
|
end
|
15
|
-
Xezat.logger = Logger.new(
|
16
|
-
Xezat.logger.formatter = proc { |
|
17
|
-
"#{datetime}: #{message}\n"
|
15
|
+
Xezat.logger = Logger.new($stdout)
|
16
|
+
Xezat.logger.formatter = proc { |severity, datetime, _progname, message|
|
17
|
+
"#{datetime}: [#{severity}] #{message}\n"
|
18
18
|
}
|
19
19
|
|
20
20
|
class CygportProcessError < StandardError
|
@@ -0,0 +1,22 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'xezat/variables'
|
4
|
+
|
5
|
+
module Xezat
|
6
|
+
module Command
|
7
|
+
class Announce
|
8
|
+
include Xezat
|
9
|
+
|
10
|
+
def initialize(options, cygport)
|
11
|
+
@options = options
|
12
|
+
@cygport = cygport
|
13
|
+
end
|
14
|
+
|
15
|
+
def execute
|
16
|
+
variables = variables(@cygport)
|
17
|
+
erb = File.expand_path(File.join(TEMPLATE_DIR, 'announce.erb'))
|
18
|
+
print ERB.new(File.readlines(erb).join(nil), trim_mode: '%-').result(binding).chop # remove redundant new line
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
22
|
+
end
|
data/lib/xezat/command/bump.rb
CHANGED
@@ -38,7 +38,7 @@ module Xezat
|
|
38
38
|
changelog: get_changelog(vars, @options, readme_file)
|
39
39
|
}
|
40
40
|
|
41
|
-
Xezat.logger.debug('Write ChangeLog atomically')
|
41
|
+
Xezat.logger.debug(' Write ChangeLog atomically')
|
42
42
|
File.atomic_write(readme_file) do |f|
|
43
43
|
f.write(get_embedded_contents(vars, info))
|
44
44
|
end
|
@@ -9,7 +9,7 @@ module Xezat
|
|
9
9
|
module Command
|
10
10
|
class Bump
|
11
11
|
def get_changelog(variables, options, readme_file)
|
12
|
-
Xezat.logger.debug('
|
12
|
+
Xezat.logger.debug(' Try to append latest log to changelog...')
|
13
13
|
current_version = variables[:PVR].intern
|
14
14
|
if FileTest.exist?(readme_file)
|
15
15
|
raise FilePermissionError, "Cannot read #{readme_file}" unless FileTest.readable?(readme_file)
|
@@ -17,10 +17,16 @@ module Xezat
|
|
17
17
|
|
18
18
|
changelog = Cygchangelog.new(File.read(readme_file))
|
19
19
|
message = options['message'] || 'Version bump.'
|
20
|
-
changelog
|
20
|
+
if changelog.length > 1 || !changelog.key?(current_version)
|
21
|
+
changelog[current_version] = message # overwrite unless initial package
|
22
|
+
Xezat.logger.debug(" '#{message}' appended")
|
23
|
+
else
|
24
|
+
Xezat.logger.warn(' Initial release protected')
|
25
|
+
end
|
21
26
|
else
|
22
27
|
changelog = Cygchangelog.new
|
23
28
|
changelog[current_version] = 'Initial release by fd0 <https://github.com/fd00/>'
|
29
|
+
Xezat.logger.debug(' Initial release by you')
|
24
30
|
end
|
25
31
|
changelog
|
26
32
|
end
|
@@ -6,7 +6,7 @@ module Xezat
|
|
6
6
|
module Command
|
7
7
|
class Bump
|
8
8
|
def get_compilers(languages, _variables)
|
9
|
-
Xezat.logger.debug('Collect compilers')
|
9
|
+
Xezat.logger.debug(' Collect compilers')
|
10
10
|
compiler_file = File.expand_path(File.join(DATA_DIR, 'compilers.json'))
|
11
11
|
compiler_candidates = JSON.parse(File.read(compiler_file))
|
12
12
|
compilers = []
|
@@ -15,7 +15,7 @@ module Xezat
|
|
15
15
|
File.dirname(file)
|
16
16
|
end.sort.uniq.join(':')
|
17
17
|
command = ['bash', File.expand_path(File.join(DATA_DIR, 'invoke_cygport_dep.sh')), cygport]
|
18
|
-
result, error, status = Open3.capture3({ 'PATH' => ENV['PATH']
|
18
|
+
result, error, status = Open3.capture3({ 'PATH' => "#{ENV['PATH']}:#{additional_path}" }, command.join(' '))
|
19
19
|
raise CygportProcessError, error unless status.success?
|
20
20
|
|
21
21
|
result
|
@@ -9,7 +9,7 @@ module Xezat
|
|
9
9
|
module Command
|
10
10
|
class Bump
|
11
11
|
def get_development_packages(variables, packages)
|
12
|
-
Xezat.logger.debug('Collect development packages')
|
12
|
+
Xezat.logger.debug(' Collect development packages')
|
13
13
|
compilers = get_compilers(get_languages(variables[:S]), variables)
|
14
14
|
tools = get_tools(variables)
|
15
15
|
development_packages = (compilers + tools + [:cygport]).uniq.sort
|
@@ -9,10 +9,10 @@ module Xezat
|
|
9
9
|
module Command
|
10
10
|
class Bump
|
11
11
|
def get_files(variables)
|
12
|
-
Xezat.logger.debug('Collect files')
|
12
|
+
Xezat.logger.debug(' Collect files')
|
13
13
|
pkg2files = {}
|
14
14
|
variables[:pkg_name].each do |pkg_name|
|
15
|
-
Xezat.logger.debug("
|
15
|
+
Xezat.logger.debug(" Collect #{pkg_name}")
|
16
16
|
lst_file = File.expand_path(File.join(variables[:T], ".#{pkg_name}.lst"))
|
17
17
|
raise IllegalStateError, "No such file: #{lst_file}" unless FileTest.readable?(lst_file)
|
18
18
|
|
@@ -7,7 +7,7 @@ module Xezat
|
|
7
7
|
module Command
|
8
8
|
class Bump
|
9
9
|
def get_languages(top_src_dir)
|
10
|
-
Xezat.logger.debug('Collect languages')
|
10
|
+
Xezat.logger.debug(' Collect languages')
|
11
11
|
languages_file = File.expand_path(File.join(DATA_DIR, 'languages.json'))
|
12
12
|
languages_candidates = JSON.parse(File.read(languages_file))
|
13
13
|
languages = []
|
@@ -8,7 +8,7 @@ module Xezat
|
|
8
8
|
module Command
|
9
9
|
class Bump
|
10
10
|
def get_runtime_packages(vars, cygport)
|
11
|
-
Xezat.logger.debug('Collect runtime packages from cygport dep')
|
11
|
+
Xezat.logger.debug(' Collect runtime packages from cygport dep')
|
12
12
|
result = invoke_cygport_dep(vars, cygport)
|
13
13
|
result.gsub(/^.*\*\*\*.*$/, '').split($INPUT_RECORD_SEPARATOR).map(&:lstrip)
|
14
14
|
end
|
@@ -7,7 +7,7 @@ module Xezat
|
|
7
7
|
module Command
|
8
8
|
class Bump
|
9
9
|
def get_src_uri(vars, cygclasses = CygclassManager.new)
|
10
|
-
Xezat.logger.debug('Collect SRC_URI')
|
10
|
+
Xezat.logger.debug(' Collect SRC_URI')
|
11
11
|
cygclasses.vcs.each do |vcs|
|
12
12
|
next unless vars.key?("_#{vcs}_CYGCLASS_".intern)
|
13
13
|
|
data/lib/xezat/command/doctor.rb
CHANGED
data/lib/xezat/command/port.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'net/http'
|
3
4
|
require 'pkg-config'
|
5
|
+
require 'uri'
|
4
6
|
require 'xezat/variables'
|
5
7
|
|
6
8
|
module Xezat
|
@@ -16,22 +18,82 @@ module Xezat
|
|
16
18
|
def execute
|
17
19
|
Xezat.logger.debug('Start validating')
|
18
20
|
vars = variables(@cygport)
|
21
|
+
|
22
|
+
Xezat.logger.debug(' Validate .cygport')
|
23
|
+
validate_cygport(@cygport)
|
24
|
+
|
25
|
+
Xezat.logger.debug(' Validate category')
|
26
|
+
validate_category(vars[:CATEGORY])
|
27
|
+
|
28
|
+
Xezat.logger.debug(' Validate homepage')
|
29
|
+
validate_homepage(vars[:HOMEPAGE])
|
30
|
+
|
31
|
+
Xezat.logger.debug(' Validate *.pc')
|
19
32
|
validate_pkgconfig(vars)
|
33
|
+
|
20
34
|
Xezat.logger.debug('End validating')
|
21
35
|
end
|
22
36
|
|
37
|
+
def validate_cygport(cygport)
|
38
|
+
original_string = File.read(cygport)
|
39
|
+
stripped_string = original_string.gsub(/^\xEF\xBB\xBF/, '')
|
40
|
+
Xezat.logger.error(' .cygport contains BOM') unless original_string == stripped_string
|
41
|
+
end
|
42
|
+
|
43
|
+
def validate_category(category)
|
44
|
+
categories_file = File.expand_path(File.join(DATA_DIR, 'categories.yaml'))
|
45
|
+
Xezat.logger.error(" Category is invalid : #{category}") unless YAML.safe_load(File.open(categories_file), [Symbol]).include?(category.downcase)
|
46
|
+
end
|
47
|
+
|
48
|
+
def validate_homepage(homepage)
|
49
|
+
response = Net::HTTP.get_response(URI.parse(homepage))
|
50
|
+
code = response.code
|
51
|
+
if code == '200'
|
52
|
+
Xezat.logger.debug(" code = #{response.code}")
|
53
|
+
else
|
54
|
+
Xezat.logger.error(" code = #{response.code}")
|
55
|
+
end
|
56
|
+
end
|
57
|
+
|
23
58
|
def validate_pkgconfig(variables)
|
24
59
|
pkgconfig_path = File.join(variables[:D], 'usr', 'lib', 'pkgconfig')
|
25
60
|
PKGConfig.add_path(pkgconfig_path)
|
26
61
|
Dir.glob('*.pc', 0, base: pkgconfig_path).each do |pc|
|
27
62
|
basename = File.basename(pc, '.pc')
|
28
|
-
Xezat.logger.debug("
|
63
|
+
Xezat.logger.debug(" #{basename}.pc found")
|
29
64
|
modversion = PKGConfig.modversion(basename)
|
30
|
-
Xezat.logger.debug("
|
31
|
-
pv = variables[:PV][0]
|
32
|
-
Xezat.logger.error("
|
33
|
-
Xezat.logger.debug("
|
34
|
-
|
65
|
+
Xezat.logger.debug(" modversion = #{modversion}")
|
66
|
+
pv = variables[:PV][0].gsub(/\+.+$/, '')
|
67
|
+
Xezat.logger.error(" modversion differs from $PN = #{pv}") unless modversion == pv
|
68
|
+
Xezat.logger.debug(" cflags = #{PKGConfig.cflags(basename)}")
|
69
|
+
libs = PKGConfig.libs(basename)
|
70
|
+
Xezat.logger.debug(" libs = #{libs}")
|
71
|
+
validate_libs(variables, libs)
|
72
|
+
end
|
73
|
+
end
|
74
|
+
|
75
|
+
def validate_libs(variables, libs)
|
76
|
+
lib_dirs = [File.join(variables[:D], '/usr/lib'), '/usr/lib', '/usr/lib/w32api', '/usr/lib/gcc/x86_64-pc-cygwin/10']
|
77
|
+
libs.split do |option|
|
78
|
+
if option.start_with?('-l')
|
79
|
+
lib_name = option[2, 255] # Assume file length limit
|
80
|
+
found = false
|
81
|
+
lib_dirs.each do |dir|
|
82
|
+
archive_path = File.join(dir, "lib#{lib_name}.dll.a")
|
83
|
+
if File.exist?(archive_path)
|
84
|
+
Xezat.logger.debug(" #{lib_name} -> #{archive_path.gsub(variables[:D], '$D')}")
|
85
|
+
found = true
|
86
|
+
break
|
87
|
+
end
|
88
|
+
static_path = File.join(dir, "lib#{lib_name}.a")
|
89
|
+
next unless File.exist?(static_path)
|
90
|
+
|
91
|
+
Xezat.logger.debug(" #{lib_name} -> #{static_path}")
|
92
|
+
found = true
|
93
|
+
break
|
94
|
+
end
|
95
|
+
Xezat.logger.error(" #{lib_name} not found") unless found
|
96
|
+
end
|
35
97
|
end
|
36
98
|
end
|
37
99
|
end
|
data/lib/xezat/cygchangelog.rb
CHANGED
@@ -48,13 +48,15 @@ module Xezat
|
|
48
48
|
@changelogs.key?(key)
|
49
49
|
end
|
50
50
|
|
51
|
-
def each
|
51
|
+
def each(&block)
|
52
52
|
logs = @changelogs.sort do |a, b|
|
53
53
|
-(Cygversion.new(a[0].to_s) <=> Cygversion.new(b[0].to_s))
|
54
54
|
end
|
55
|
-
logs.each
|
56
|
-
|
57
|
-
|
55
|
+
logs.each(&block)
|
56
|
+
end
|
57
|
+
|
58
|
+
def length
|
59
|
+
@changelogs.length
|
58
60
|
end
|
59
61
|
end
|
60
62
|
end
|
data/lib/xezat/cygversion.rb
CHANGED
@@ -15,6 +15,8 @@ module Xezat
|
|
15
15
|
|
16
16
|
def to_v
|
17
17
|
[Gem::Version.new(@version), @revision, @release]
|
18
|
+
rescue ArgumentError
|
19
|
+
to_a
|
18
20
|
end
|
19
21
|
|
20
22
|
def to_a
|
@@ -22,7 +24,10 @@ module Xezat
|
|
22
24
|
end
|
23
25
|
|
24
26
|
def <=>(other)
|
25
|
-
to_v <=> other.to_v
|
27
|
+
result = (to_v <=> other.to_v)
|
28
|
+
return result unless result.nil?
|
29
|
+
|
30
|
+
(to_a <=> other.to_a)
|
26
31
|
end
|
27
32
|
end
|
28
33
|
end
|
@@ -0,0 +1,20 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
require 'find'
|
4
|
+
|
5
|
+
module Xezat
|
6
|
+
module Detector
|
7
|
+
class Asciidoc
|
8
|
+
def detect(variables)
|
9
|
+
Find.find(variables[:S]) do |file|
|
10
|
+
next unless file.end_with?("#{File::SEPARATOR}configure.ac", "#{File::SEPARATOR}configure.in")
|
11
|
+
|
12
|
+
File.foreach(file) do |line|
|
13
|
+
return true if line.include?('asciidoc')
|
14
|
+
end
|
15
|
+
end
|
16
|
+
false
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
@@ -7,7 +7,7 @@ module Xezat
|
|
7
7
|
class Autoconf
|
8
8
|
def detect(variables)
|
9
9
|
Find.find(variables[:S]) do |file|
|
10
|
-
return true if file.end_with?(File::SEPARATOR
|
10
|
+
return true if file.end_with?("#{File::SEPARATOR}configure.ac", "#{File::SEPARATOR}configure.in")
|
11
11
|
end
|
12
12
|
false
|
13
13
|
end
|
@@ -7,7 +7,7 @@ module Xezat
|
|
7
7
|
class BoostM4
|
8
8
|
def detect(variables)
|
9
9
|
Find.find(variables[:S]) do |file|
|
10
|
-
next unless file.end_with?(File::SEPARATOR
|
10
|
+
next unless file.end_with?("#{File::SEPARATOR}configure.ac", "#{File::SEPARATOR}configure.in")
|
11
11
|
|
12
12
|
File.foreach(file) do |line|
|
13
13
|
return true if line.lstrip.start_with?('BOOST_REQUIRE')
|
data/lib/xezat/detector/cmake.rb
CHANGED
@@ -7,10 +7,10 @@ module Xezat
|
|
7
7
|
class Libtool
|
8
8
|
def detect(variables)
|
9
9
|
Find.find(variables[:S]) do |file|
|
10
|
-
return true if file.end_with?(File::SEPARATOR
|
10
|
+
return true if file.end_with?("#{File::SEPARATOR}ltmain.sh")
|
11
11
|
end
|
12
12
|
Find.find(variables[:S]) do |file|
|
13
|
-
next unless file.end_with?(File::SEPARATOR
|
13
|
+
next unless file.end_with?("#{File::SEPARATOR}Makefile", "#{File::SEPARATOR}makefile")
|
14
14
|
next if File.directory?(file)
|
15
15
|
|
16
16
|
File.foreach(file) do |line|
|
data/lib/xezat/detector/make.rb
CHANGED
@@ -7,7 +7,7 @@ module Xezat
|
|
7
7
|
class Make
|
8
8
|
def detect(variables)
|
9
9
|
Find.find(variables[:B]) do |file|
|
10
|
-
return true if file.end_with?(File::SEPARATOR
|
10
|
+
return true if file.end_with?("#{File::SEPARATOR}Makefile", "#{File::SEPARATOR}makefile")
|
11
11
|
end
|
12
12
|
File.foreach(File.join(variables[:top], variables[:cygportfile])) do |line|
|
13
13
|
return true if line.index('cygmake')
|
@@ -0,0 +1,16 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Xezat
|
4
|
+
module Detector
|
5
|
+
class Nasm
|
6
|
+
def detect(variables)
|
7
|
+
if variables.key?(:_meson_CYGCLASS_)
|
8
|
+
File.foreach(File.join(variables[:S], 'meson.build')) do |line|
|
9
|
+
return true if line.include?("find_program('nasm')")
|
10
|
+
end
|
11
|
+
end
|
12
|
+
false
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
data/lib/xezat/detector/ninja.rb
CHANGED
@@ -4,15 +4,20 @@ require 'find'
|
|
4
4
|
|
5
5
|
module Xezat
|
6
6
|
module Detector
|
7
|
-
class
|
7
|
+
class Python38Docutils
|
8
8
|
def detect(variables)
|
9
9
|
Find.find(variables[:S]) do |file|
|
10
|
-
next unless file.end_with?(File::SEPARATOR
|
10
|
+
next unless file.end_with?("#{File::SEPARATOR}configure.ac", "#{File::SEPARATOR}configure.in")
|
11
11
|
|
12
12
|
File.foreach(file) do |line|
|
13
13
|
return true if line.strip.start_with?('AC_CHECK_PROG') && line.index('rst2man').is_a?(Integer)
|
14
14
|
end
|
15
15
|
end
|
16
|
+
if variables.key?(:_meson_CYGCLASS_)
|
17
|
+
File.foreach(File.join(variables[:S], 'meson.build')) do |line|
|
18
|
+
return true if line.strip.index('rst2man').is_a?(Integer)
|
19
|
+
end
|
20
|
+
end
|
16
21
|
false
|
17
22
|
end
|
18
23
|
end
|
data/lib/xezat/detector/waf.rb
CHANGED
data/lib/xezat/detectors.rb
CHANGED
@@ -6,7 +6,7 @@ require 'xezat/ext/string'
|
|
6
6
|
module Xezat
|
7
7
|
class DetectorManager
|
8
8
|
def initialize(detector_dir = File.expand_path(File.join(File.dirname(__FILE__), 'detector')))
|
9
|
-
Xezat.logger.debug('Load detectors')
|
9
|
+
Xezat.logger.debug(' Load detectors')
|
10
10
|
@detectors = {}
|
11
11
|
Dir.glob(File.join(detector_dir, '*.rb')).sort.each do |rb|
|
12
12
|
require rb
|
@@ -15,14 +15,14 @@ module Xezat
|
|
15
15
|
end
|
16
16
|
|
17
17
|
def detect(variables)
|
18
|
-
Xezat.logger.debug('Detect tools')
|
18
|
+
Xezat.logger.debug(' Detect tools')
|
19
19
|
tools = []
|
20
20
|
@detectors.each do |name, detector|
|
21
21
|
if detector.detect(variables)
|
22
22
|
tools << name
|
23
|
-
Xezat.logger.debug("
|
23
|
+
Xezat.logger.debug(" #{name} ... yes")
|
24
24
|
else
|
25
|
-
Xezat.logger.debug("
|
25
|
+
Xezat.logger.debug(" #{name} ... no")
|
26
26
|
end
|
27
27
|
end
|
28
28
|
if tools.include?(:python27) && (tools.include?(:python36) || tools.include?(:python37))
|
@@ -73,7 +73,7 @@ module Xezat
|
|
73
73
|
|
74
74
|
return if /#{pn}.pc/.match?(original_ac)
|
75
75
|
|
76
|
-
original_ac.gsub!(/(AC_CONFIG_FILES\(\[)/,
|
76
|
+
original_ac.gsub!(/(AC_CONFIG_FILES\(\[)/, "\\1#{"#{pn}.pc "}")
|
77
77
|
File.atomic_write(configure_ac) do |fa|
|
78
78
|
fa.write(original_ac)
|
79
79
|
|
data/lib/xezat/main.rb
CHANGED
@@ -67,5 +67,12 @@ module Xezat
|
|
67
67
|
require 'xezat/command/validate'
|
68
68
|
Command::Validate.new(nil, cygport).execute
|
69
69
|
end
|
70
|
+
|
71
|
+
desc 'announce cygport', 'Show announce'
|
72
|
+
|
73
|
+
def announce(cygport)
|
74
|
+
require 'xezat/command/announce'
|
75
|
+
Command::Announce.new(nil, cygport).execute
|
76
|
+
end
|
70
77
|
end
|
71
78
|
end
|
data/lib/xezat/packages.rb
CHANGED
@@ -4,7 +4,7 @@ require 'xezat'
|
|
4
4
|
|
5
5
|
module Xezat
|
6
6
|
def packages(db_path = '/etc/setup/installed.db')
|
7
|
-
Xezat.logger.debug("Collect installed packages from #{db_path}")
|
7
|
+
Xezat.logger.debug(" Collect installed packages from #{db_path}")
|
8
8
|
raise ArgumentError, "#{db_path} not found" unless File.exist?(db_path)
|
9
9
|
|
10
10
|
packages = {}
|
data/lib/xezat/variables.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
# frozen_string_literal: true
|
2
2
|
|
3
|
+
require 'etc'
|
3
4
|
require 'facets/file/atomic_write'
|
4
5
|
require 'facets/string/word_wrap'
|
5
6
|
require 'open3'
|
@@ -10,12 +11,12 @@ require 'xezat'
|
|
10
11
|
module Xezat
|
11
12
|
def variables(cygport)
|
12
13
|
cygport_dir = File.dirname(File.absolute_path(cygport))
|
13
|
-
cache_file = File.expand_path(File.join(cygport_dir, File.basename(cygport, '.cygport')
|
14
|
+
cache_file = File.expand_path(File.join(cygport_dir, "#{File.basename(cygport, '.cygport')}.#{Etc.uname[:machine]}.yml"))
|
14
15
|
|
15
|
-
Xezat.logger.debug('Extract variables')
|
16
|
+
Xezat.logger.debug(' Extract variables')
|
16
17
|
|
17
18
|
if File.exist?(cache_file) && File.ctime(cache_file) > File.ctime(cygport)
|
18
|
-
Xezat.logger.debug('
|
19
|
+
Xezat.logger.debug(' Read cache for variables')
|
19
20
|
return YAML.safe_load(File.open(cache_file), [Symbol]).each do |k, v|
|
20
21
|
v.strip! if v.respond_to?(:strip) && k != :DESCRIPTION
|
21
22
|
end
|
@@ -33,7 +34,7 @@ module Xezat
|
|
33
34
|
variables[:DESCRIPTION].word_wrap!(79)
|
34
35
|
|
35
36
|
File.atomic_write(cache_file) do |f|
|
36
|
-
Xezat.logger.debug('
|
37
|
+
Xezat.logger.debug(' Write cache for variables')
|
37
38
|
f.write(YAML.dump(variables))
|
38
39
|
end
|
39
40
|
|
data/lib/xezat/version.rb
CHANGED
@@ -0,0 +1,51 @@
|
|
1
|
+
---
|
2
|
+
- accessibility
|
3
|
+
- admin
|
4
|
+
- archive
|
5
|
+
- audio
|
6
|
+
- base
|
7
|
+
- benchmark
|
8
|
+
- comm
|
9
|
+
- database
|
10
|
+
- debug
|
11
|
+
- devel
|
12
|
+
- doc
|
13
|
+
- editors
|
14
|
+
- emulators
|
15
|
+
- games
|
16
|
+
- gnome
|
17
|
+
- graphics
|
18
|
+
- interpreters
|
19
|
+
- kde
|
20
|
+
- libs
|
21
|
+
- lua
|
22
|
+
- lxde
|
23
|
+
- mail
|
24
|
+
- mate
|
25
|
+
- math
|
26
|
+
- mingw
|
27
|
+
- net
|
28
|
+
- ocaml
|
29
|
+
- office
|
30
|
+
- perl
|
31
|
+
- php
|
32
|
+
- publishing
|
33
|
+
- python
|
34
|
+
- ruby
|
35
|
+
- scheme
|
36
|
+
- science
|
37
|
+
- security
|
38
|
+
- shells
|
39
|
+
- sound
|
40
|
+
- source
|
41
|
+
- sugar
|
42
|
+
- system
|
43
|
+
- tcl
|
44
|
+
- text
|
45
|
+
- utils
|
46
|
+
- video
|
47
|
+
- web
|
48
|
+
- x11
|
49
|
+
- xfce
|
50
|
+
- _obsolete
|
51
|
+
- _postinstalllast
|
data/xezat.gemspec
CHANGED
@@ -25,8 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
|
26
26
|
spec.add_runtime_dependency 'facets', '>= 3.1.0'
|
27
27
|
spec.add_runtime_dependency 'github-linguist', '>= 7.11.0'
|
28
|
-
spec.add_runtime_dependency '
|
29
|
-
spec.add_runtime_dependency 'pkg-config', '>= 1.4.2'
|
28
|
+
spec.add_runtime_dependency 'pkg-config', '>= 1.4.4'
|
30
29
|
spec.add_runtime_dependency 'thor', '>= 0.20.3'
|
31
30
|
spec.add_runtime_dependency 'thor-zsh_completion', '>= 0.1.7'
|
32
31
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: xezat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daisuke Fujimura (fd0)
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2021-02-23 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: facets
|
@@ -38,34 +38,20 @@ dependencies:
|
|
38
38
|
- - ">="
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 7.11.0
|
41
|
-
- !ruby/object:Gem::Dependency
|
42
|
-
name: io-console
|
43
|
-
requirement: !ruby/object:Gem::Requirement
|
44
|
-
requirements:
|
45
|
-
- - ">="
|
46
|
-
- !ruby/object:Gem::Version
|
47
|
-
version: 0.5.6
|
48
|
-
type: :runtime
|
49
|
-
prerelease: false
|
50
|
-
version_requirements: !ruby/object:Gem::Requirement
|
51
|
-
requirements:
|
52
|
-
- - ">="
|
53
|
-
- !ruby/object:Gem::Version
|
54
|
-
version: 0.5.6
|
55
41
|
- !ruby/object:Gem::Dependency
|
56
42
|
name: pkg-config
|
57
43
|
requirement: !ruby/object:Gem::Requirement
|
58
44
|
requirements:
|
59
45
|
- - ">="
|
60
46
|
- !ruby/object:Gem::Version
|
61
|
-
version: 1.4.
|
47
|
+
version: 1.4.4
|
62
48
|
type: :runtime
|
63
49
|
prerelease: false
|
64
50
|
version_requirements: !ruby/object:Gem::Requirement
|
65
51
|
requirements:
|
66
52
|
- - ">="
|
67
53
|
- !ruby/object:Gem::Version
|
68
|
-
version: 1.4.
|
54
|
+
version: 1.4.4
|
69
55
|
- !ruby/object:Gem::Dependency
|
70
56
|
name: thor
|
71
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -228,6 +214,7 @@ files:
|
|
228
214
|
- bin/setup
|
229
215
|
- exe/xezat
|
230
216
|
- lib/xezat.rb
|
217
|
+
- lib/xezat/command/announce.rb
|
231
218
|
- lib/xezat/command/bump.rb
|
232
219
|
- lib/xezat/command/bump/changelog.rb
|
233
220
|
- lib/xezat/command/bump/compiler.rb
|
@@ -250,6 +237,7 @@ files:
|
|
250
237
|
- lib/xezat/cygversion.rb
|
251
238
|
- lib/xezat/debugger/linguist.rb
|
252
239
|
- lib/xezat/debugger/variable.rb
|
240
|
+
- lib/xezat/detector/asciidoc.rb
|
253
241
|
- lib/xezat/detector/autoconf.rb
|
254
242
|
- lib/xezat/detector/automake.rb
|
255
243
|
- lib/xezat/detector/boost.m4.rb
|
@@ -262,11 +250,13 @@ files:
|
|
262
250
|
- lib/xezat/detector/libtool.rb
|
263
251
|
- lib/xezat/detector/make.rb
|
264
252
|
- lib/xezat/detector/meson.rb
|
253
|
+
- lib/xezat/detector/nasm.rb
|
265
254
|
- lib/xezat/detector/ninja.rb
|
266
255
|
- lib/xezat/detector/python27.rb
|
267
|
-
- lib/xezat/detector/python36-docutils.rb
|
268
256
|
- lib/xezat/detector/python36.rb
|
269
257
|
- lib/xezat/detector/python37.rb
|
258
|
+
- lib/xezat/detector/python38-docutils.rb
|
259
|
+
- lib/xezat/detector/python38.rb
|
270
260
|
- lib/xezat/detector/roundup.rb
|
271
261
|
- lib/xezat/detector/waf.rb
|
272
262
|
- lib/xezat/detectors.rb
|
@@ -277,6 +267,7 @@ files:
|
|
277
267
|
- lib/xezat/packages.rb
|
278
268
|
- lib/xezat/variables.rb
|
279
269
|
- lib/xezat/version.rb
|
270
|
+
- share/xezat/categories.yaml
|
280
271
|
- share/xezat/compilers.json
|
281
272
|
- share/xezat/invoke_cygport_dep.sh
|
282
273
|
- share/xezat/languages.json
|
@@ -287,6 +278,7 @@ files:
|
|
287
278
|
- share/xezat/show_cygport_variable.sh
|
288
279
|
- share/xezat/template/Makefile.am
|
289
280
|
- share/xezat/template/README.erb
|
281
|
+
- share/xezat/template/announce.erb
|
290
282
|
- share/xezat/template/cmake.erb
|
291
283
|
- share/xezat/template/cygport.erb
|
292
284
|
- share/xezat/template/pkgconfig.erb
|