tpkg 1.27.1 → 1.27.3
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +1 -1
- data/bin/cpan2tpkg +1 -0
- data/bin/gem2tpkg +1 -0
- data/lib/tpkg.rb +5 -4
- data/lib/tpkg/metadata.rb +26 -21
- metadata +2 -2
data/Rakefile
CHANGED
@@ -5,7 +5,7 @@ spec = Gem::Specification.new do |s|
|
|
5
5
|
s.add_dependency('facter')
|
6
6
|
s.add_dependency('net-ssh')
|
7
7
|
s.add_dependency('ddao-kwalify')
|
8
|
-
s.version = '1.27.
|
8
|
+
s.version = '1.27.3'
|
9
9
|
s.authors = ['Darren Dao', 'Jason Heiss']
|
10
10
|
s.email = 'tpkg-users@lists.sourceforge.net'
|
11
11
|
s.homepage = 'http://tpkg.sourceforge.net'
|
data/bin/cpan2tpkg
CHANGED
@@ -325,6 +325,7 @@ MODULE: foreach my $name ($extinst->modules)
|
|
325
325
|
print $xmlfh " <name>cpan-perl$majorminor-$pkgname</name>", "\n";
|
326
326
|
print $xmlfh " <version>$ver</version>", "\n";
|
327
327
|
print $xmlfh " <package_version>$pkgver</package_version>", "\n";
|
328
|
+
print $xmlfh " <description>cpan package for $pkgname</description>", "\n";
|
328
329
|
print $xmlfh ' <maintainer>cpan2tpkg</maintainer>', "\n";
|
329
330
|
# If the package has native code then it needs to be flagged as
|
330
331
|
# specific to the OS and architecture
|
data/bin/gem2tpkg
CHANGED
@@ -397,6 +397,7 @@ def package(gem)
|
|
397
397
|
file.puts " <name>gem-#{gem}#{pkgnamesuffix}</name>"
|
398
398
|
file.puts " <version>#{gemspec.version.to_s}</version>"
|
399
399
|
file.puts " <package_version>#{@pkgver}</package_version>"
|
400
|
+
file.puts " <description>Ruby gem for #{gem}</description>"
|
400
401
|
file.puts ' <maintainer>gem2tpkg</maintainer>'
|
401
402
|
# If the gemspec lists any extensions then the package has native
|
402
403
|
# code and needs to be flagged as specific to the OS and architecture
|
data/lib/tpkg.rb
CHANGED
@@ -56,7 +56,7 @@ require 'kwalify' # for validating yaml
|
|
56
56
|
|
57
57
|
class Tpkg
|
58
58
|
|
59
|
-
VERSION = '1.27.
|
59
|
+
VERSION = '1.27.3'
|
60
60
|
CONFIGDIR = '/etc'
|
61
61
|
|
62
62
|
GENERIC_ERR = 1
|
@@ -316,7 +316,8 @@ class Tpkg
|
|
316
316
|
File.open(File.join(tpkgdir, "file_metadata.bin"), "w") do |file|
|
317
317
|
filemetadata = get_filemetadata_from_directory(tpkgdir)
|
318
318
|
filemetadata[:files].each do |file1|
|
319
|
-
if metadata[:files]
|
319
|
+
if metadata[:files] && metadata[:files][:files] &&
|
320
|
+
metadata[:files][:files].any?{|file2|file2[:path] == file1[:path] && file2[:config]}
|
320
321
|
file1[:config] = true
|
321
322
|
end
|
322
323
|
end
|
@@ -1269,12 +1270,11 @@ class Tpkg
|
|
1269
1270
|
@installed_directory = File.join(@var_directory, 'installed')
|
1270
1271
|
@metadata_directory = File.join(@installed_directory, 'metadata')
|
1271
1272
|
@sources_directory = File.join(@var_directory, 'sources')
|
1272
|
-
@external_directory = File.join(@var_directory, 'externals')
|
1273
1273
|
@tmp_directory = File.join(@var_directory, 'tmp')
|
1274
1274
|
@log_directory = File.join(@var_directory, 'logs')
|
1275
1275
|
# It is important to create these dirs in correct order
|
1276
1276
|
dirs_to_create = [@installed_directory, @metadata_directory, @sources_directory,
|
1277
|
-
@
|
1277
|
+
@tmp_directory, @log_directory]
|
1278
1278
|
dirs_to_create.each do |dir|
|
1279
1279
|
if !File.exist?(dir)
|
1280
1280
|
begin
|
@@ -1285,6 +1285,7 @@ class Tpkg
|
|
1285
1285
|
end
|
1286
1286
|
end
|
1287
1287
|
@tar = Tpkg::find_tar
|
1288
|
+
@external_directory = File.join(@file_system_root, 'usr', 'lib', 'tpkg', 'externals')
|
1288
1289
|
@lock_directory = File.join(@var_directory, 'lock')
|
1289
1290
|
@lock_pid_file = File.join(@lock_directory, 'pid')
|
1290
1291
|
@locks = 0
|
data/lib/tpkg/metadata.rb
CHANGED
@@ -334,29 +334,34 @@ class Metadata
|
|
334
334
|
|
335
335
|
# Add tpkg_version to the existing tpkg.xml or tpkg.yml file
|
336
336
|
def add_tpkg_version(version)
|
337
|
-
|
338
|
-
|
339
|
-
|
340
|
-
|
341
|
-
|
342
|
-
|
343
|
-
|
344
|
-
|
345
|
-
|
346
|
-
|
337
|
+
begin
|
338
|
+
if @format == 'xml'
|
339
|
+
metadata_xml = REXML::Document.new(@metadata_text)
|
340
|
+
if metadata_xml.root.elements["tpkg_version"] && (tpkg_version = metadata_xml.root.elements["tpkg_version"].text) != Tpkg::VERSION
|
341
|
+
warn "Warning: tpkg_version is specified as #{tpkg_version}, which doesn't match with the actual tpkg version being used (#{Tpkg::VERSION})."
|
342
|
+
elsif !metadata_xml.root.elements["tpkg_version"]
|
343
|
+
tpkg_version_ele = REXML::Element.new("tpkg_version")
|
344
|
+
tpkg_version_ele.text = Tpkg::VERSION
|
345
|
+
metadata_xml.root.add_element(tpkg_version_ele)
|
346
|
+
File.open(@file_path, 'w') do |file|
|
347
|
+
metadata_xml.write(file)
|
348
|
+
end
|
347
349
|
end
|
350
|
+
elsif @format == 'yml'
|
351
|
+
if (tpkg_version = to_hash[:tpkg_version]) && tpkg_version != Tpkg::VERSION
|
352
|
+
warn "Warning: tpkg_version is specified as #{tpkg_version}, which doesn't match with the actual tpkg version being used (#{Tpkg::VERSION})."
|
353
|
+
elsif !tpkg_version
|
354
|
+
File.open(@file_path, 'a') do |file|
|
355
|
+
file.puts "tpkg_version: #{Tpkg::VERSION}"
|
356
|
+
end
|
357
|
+
end
|
358
|
+
else
|
359
|
+
raise "Unknown metadata format"
|
348
360
|
end
|
349
|
-
|
350
|
-
|
351
|
-
|
352
|
-
|
353
|
-
File.open(@file_path, 'a') do |file|
|
354
|
-
file.puts "tpkg_version: #{Tpkg::VERSION}"
|
355
|
-
end
|
356
|
-
end
|
357
|
-
else
|
358
|
-
raise "Unknown metadata format"
|
359
|
-
end
|
361
|
+
rescue Errno::EACCES => e
|
362
|
+
warn "Warning: Failed to insert tpkg_version into tpkg.(xml|yml)."
|
363
|
+
puts e
|
364
|
+
end
|
360
365
|
end
|
361
366
|
|
362
367
|
def generate_package_filename
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tpkg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.27.
|
4
|
+
version: 1.27.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Darren Dao
|
@@ -10,7 +10,7 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
12
|
|
13
|
-
date: 2010-
|
13
|
+
date: 2010-08-03 00:00:00 +00:00
|
14
14
|
default_executable:
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|