tpkg 2.2.1 → 2.2.2
Sign up to get free protection for your applications and to get access to all the features.
- data/Rakefile +2 -2
- data/bin/cpan2tpkg +5 -0
- data/bin/gem2tpkg +5 -0
- data/bin/tpkg +23 -21
- data/bin/tpkg_xml_to_yml +5 -0
- data/lib/tpkg.rb +58 -62
- data/lib/tpkg/deployer.rb +26 -17
- data/lib/tpkg/metadata.rb +23 -8
- data/lib/tpkg/silently.rb +11 -0
- data/lib/tpkg/thread_pool.rb +17 -5
- data/lib/tpkg/versiontype.rb +6 -0
- metadata +8 -7
data/Rakefile
CHANGED
@@ -4,8 +4,8 @@ spec = Gem::Specification.new do |s|
|
|
4
4
|
s.summary = 'tpkg Application Packaging & Deployment'
|
5
5
|
s.add_dependency('facter')
|
6
6
|
s.add_dependency('net-ssh')
|
7
|
-
s.add_dependency('
|
8
|
-
s.version = '2.2.
|
7
|
+
s.add_dependency('kwalify')
|
8
|
+
s.version = '2.2.2'
|
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
@@ -1,4 +1,9 @@
|
|
1
1
|
#!/opt/tpkg/bin/perl
|
2
|
+
##############################################################################
|
3
|
+
# tpkg package management system
|
4
|
+
# Copyright 2009, 2010, 2011 AT&T Interactive
|
5
|
+
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
6
|
+
##############################################################################
|
2
7
|
|
3
8
|
use warnings;
|
4
9
|
use strict;
|
data/bin/gem2tpkg
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
#!/usr/bin/ruby -w
|
2
|
+
##############################################################################
|
3
|
+
# tpkg package management system
|
4
|
+
# Copyright 2009, 2010, 2011 AT&T Interactive
|
5
|
+
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
6
|
+
##############################################################################
|
2
7
|
|
3
8
|
# Ensure we can find tpkg.rb
|
4
9
|
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
data/bin/tpkg
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
#!/usr/bin/ruby -w
|
2
2
|
##############################################################################
|
3
|
-
# tpkg package management
|
3
|
+
# tpkg package management system
|
4
|
+
# Copyright 2009, 2010, 2011 AT&T Interactive
|
5
|
+
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
4
6
|
##############################################################################
|
5
7
|
|
6
8
|
# Ensure we can find tpkg.rb
|
@@ -455,9 +457,9 @@ case @action
|
|
455
457
|
when :make
|
456
458
|
@other_options[:force] = @force
|
457
459
|
@other_options[:compress] = @compress
|
458
|
-
|
459
|
-
if
|
460
|
-
puts "Package is #{
|
460
|
+
madepkg = Tpkg::make_package(@action_value, passphrase_callback, @other_options)
|
461
|
+
if madepkg
|
462
|
+
puts "Package is #{madepkg}"
|
461
463
|
else
|
462
464
|
puts "Package build aborted or failed"
|
463
465
|
end
|
@@ -506,12 +508,12 @@ when :execute_init
|
|
506
508
|
ret_val = tpkg.execute_init(@init_options)
|
507
509
|
when :query_installed
|
508
510
|
tpkg = instantiate_tpkg(@tpkg_options)
|
509
|
-
|
511
|
+
queryreq = nil
|
510
512
|
matches = []
|
511
513
|
if @action_value
|
512
514
|
@action_value.each do | value |
|
513
|
-
|
514
|
-
match = tpkg.installed_packages_that_meet_requirement(
|
515
|
+
queryreq = Tpkg::parse_request(value, tpkg.installed_directory)
|
516
|
+
match = tpkg.installed_packages_that_meet_requirement(queryreq)
|
515
517
|
|
516
518
|
# If the user requested specific packages and we found no matches
|
517
519
|
# then exit with a non-zero value to indicate failure. This allows
|
@@ -521,7 +523,7 @@ when :query_installed
|
|
521
523
|
matches |= match
|
522
524
|
end
|
523
525
|
else
|
524
|
-
matches = tpkg.installed_packages_that_meet_requirement(
|
526
|
+
matches = tpkg.installed_packages_that_meet_requirement(queryreq)
|
525
527
|
end
|
526
528
|
|
527
529
|
if !@quiet
|
@@ -571,23 +573,23 @@ when :query_list_files
|
|
571
573
|
tpkg = instantiate_tpkg(@tpkg_options)
|
572
574
|
pkgfiles = nil
|
573
575
|
if File.exist?(@action_value)
|
574
|
-
|
575
|
-
tpkg.normalize_paths(
|
576
|
+
fipfile = Tpkg::files_in_package(@action_value)
|
577
|
+
tpkg.normalize_paths(fipfile)
|
576
578
|
puts "#{@action_value}:"
|
577
|
-
|
579
|
+
fipfile[:normalized].each { |file| puts file }
|
578
580
|
else
|
579
581
|
pkgfiles = []
|
580
582
|
metadatas = []
|
581
583
|
requirements = []
|
582
584
|
packages = {}
|
583
585
|
|
584
|
-
|
585
|
-
|
586
|
-
if
|
586
|
+
queryreq = Tpkg::parse_request(@action_value)
|
587
|
+
instpkgs = tpkg.installed_packages_that_meet_requirement(queryreq)
|
588
|
+
if instpkgs.nil? or instpkgs.empty?
|
587
589
|
ret_val = 1
|
588
590
|
puts "Could not find any installed packages that meet the request \"#{@action_value}\""
|
589
591
|
end
|
590
|
-
|
592
|
+
instpkgs.each do | pkg |
|
591
593
|
pkgfiles << pkg[:metadata][:filename]
|
592
594
|
end
|
593
595
|
|
@@ -608,11 +610,11 @@ when :query_who_owns_file
|
|
608
610
|
end
|
609
611
|
when :query_available
|
610
612
|
tpkg = instantiate_tpkg(@tpkg_options)
|
611
|
-
|
613
|
+
queryreq = nil
|
612
614
|
if @action_value
|
613
|
-
|
615
|
+
queryreq = Tpkg::parse_request(@action_value)
|
614
616
|
end
|
615
|
-
tpkg.available_packages_that_meet_requirement(
|
617
|
+
tpkg.available_packages_that_meet_requirement(queryreq).each do |pkg|
|
616
618
|
next if pkg[:source] == :native_installed
|
617
619
|
next if pkg[:source] == :native_available
|
618
620
|
puts "#{pkg[:metadata][:filename]} (#{pkg[:source]})"
|
@@ -649,9 +651,9 @@ when :query_requires
|
|
649
651
|
end
|
650
652
|
when :query_local_depends
|
651
653
|
tpkg = instantiate_tpkg(@tpkg_options)
|
652
|
-
|
653
|
-
|
654
|
-
|
654
|
+
queryreq = Tpkg::parse_request(@action_value)
|
655
|
+
instpkgs = tpkg.installed_packages_that_meet_requirement(queryreq)
|
656
|
+
instpkgs.each do | pkg |
|
655
657
|
puts pkg[:metadata][:filename] + ':'
|
656
658
|
if pkg[:metadata][:dependencies]
|
657
659
|
pkg[:metadata][:dependencies].each do |req|
|
data/bin/tpkg_xml_to_yml
CHANGED
@@ -1,4 +1,9 @@
|
|
1
1
|
#!/usr/bin/ruby -w
|
2
|
+
##############################################################################
|
3
|
+
# tpkg package management system
|
4
|
+
# Copyright 2009, 2010, 2011 AT&T Interactive
|
5
|
+
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
6
|
+
##############################################################################
|
2
7
|
|
3
8
|
# Ensure we can find tpkg.rb
|
4
9
|
$:.unshift File.join(File.dirname(__FILE__), "..", "lib")
|
data/lib/tpkg.rb
CHANGED
@@ -1,62 +1,46 @@
|
|
1
1
|
##############################################################################
|
2
|
-
# tpkg package management system
|
3
|
-
# Copyright 2009, 2010 AT&T Interactive
|
2
|
+
# tpkg package management system
|
3
|
+
# Copyright 2009, 2010, 2011 AT&T Interactive
|
4
4
|
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
5
|
##############################################################################
|
6
6
|
|
7
7
|
STDOUT.sync = STDERR.sync = true # All outputs/prompts to the kernel ASAP
|
8
8
|
|
9
|
-
#
|
10
|
-
#
|
11
|
-
#
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
#
|
16
|
-
#
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
#
|
25
|
-
#
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
#
|
34
|
-
require '
|
35
|
-
|
36
|
-
require 'rubygems'
|
37
|
-
require 'facter'
|
9
|
+
# Exclude standard libraries and gems from the warnings induced by
|
10
|
+
# running ruby with the -w flag. Several of these have warnings under
|
11
|
+
# ruby 1.9 and there's nothing we can do to fix that.
|
12
|
+
require 'tpkg/silently'
|
13
|
+
Silently.silently do
|
14
|
+
begin
|
15
|
+
# Try loading facter w/o gems first so that we don't introduce a
|
16
|
+
# dependency on gems if it is not needed.
|
17
|
+
require 'facter' # Facter
|
18
|
+
rescue LoadError
|
19
|
+
require 'rubygems'
|
20
|
+
require 'facter'
|
21
|
+
end
|
22
|
+
require 'digest/sha2' # Digest::SHA256#hexdigest, etc.
|
23
|
+
require 'uri' # URI
|
24
|
+
require 'net/http' # Net::HTTP
|
25
|
+
require 'net/https' # Net::HTTP#use_ssl, etc.
|
26
|
+
require 'time' # Time#httpdate
|
27
|
+
require 'rexml/document' # REXML::Document
|
28
|
+
require 'fileutils' # FileUtils.cp, rm, etc.
|
29
|
+
require 'tempfile' # Tempfile
|
30
|
+
require 'find' # Find
|
31
|
+
require 'etc' # Etc.getpwnam, getgrnam
|
32
|
+
require 'openssl' # OpenSSL
|
33
|
+
require 'open3' # Open3
|
34
|
+
require 'set' # Enumerable#to_set
|
35
|
+
require 'yaml' # YAML
|
38
36
|
end
|
39
|
-
require '
|
40
|
-
require '
|
41
|
-
require '
|
42
|
-
require 'net/https' # Net::HTTP#use_ssl, etc.
|
43
|
-
require 'time' # Time#httpdate
|
44
|
-
require 'rexml/document' # REXML::Document
|
45
|
-
require 'fileutils' # FileUtils.cp, rm, etc.
|
46
|
-
require 'tempfile' # Tempfile
|
47
|
-
require 'find' # Find
|
48
|
-
require 'etc' # Etc.getpwnam, getgrnam
|
49
|
-
require 'openssl' # OpenSSL
|
50
|
-
require 'open3' # Open3
|
51
|
-
require 'versiontype' # Version
|
52
|
-
require 'deployer'
|
53
|
-
require 'set'
|
54
|
-
require 'metadata'
|
55
|
-
require 'kwalify' # for validating yaml
|
37
|
+
require 'tpkg/versiontype' # Version
|
38
|
+
require 'tpkg/deployer'
|
39
|
+
require 'tpkg/metadata'
|
56
40
|
|
57
41
|
class Tpkg
|
58
42
|
|
59
|
-
VERSION = '2.2.
|
43
|
+
VERSION = '2.2.2'
|
60
44
|
|
61
45
|
GENERIC_ERR = 1
|
62
46
|
POSTINSTALL_ERR = 2
|
@@ -66,6 +50,9 @@ class Tpkg
|
|
66
50
|
CONNECTION_TIMEOUT = 10
|
67
51
|
|
68
52
|
DEFAULT_OWNERSHIP_UID = 0
|
53
|
+
DEFAULT_OWNERSHIP_GID = 0
|
54
|
+
DEFAULT_FILE_PERMS = nil
|
55
|
+
DEFAULT_DIR_PERMS = 0755
|
69
56
|
|
70
57
|
attr_reader :installed_directory
|
71
58
|
|
@@ -629,9 +616,9 @@ class Tpkg
|
|
629
616
|
metadata = metadata_from_directory(directory)
|
630
617
|
# And write that out to metadata.yml
|
631
618
|
metadata_tmpfile = Tempfile.new('metadata.yml', dest)
|
632
|
-
metadata.each do |
|
633
|
-
YAML::dump(
|
634
|
-
#YAML::dump(
|
619
|
+
metadata.each do | m |
|
620
|
+
YAML::dump(m.to_hash.recursively{|h| h.stringify_keys }, metadata_tmpfile)
|
621
|
+
#YAML::dump(m.to_hash, metadata_tmpfile)
|
635
622
|
end
|
636
623
|
metadata_tmpfile.close
|
637
624
|
File.chmod(0644, metadata_tmpfile.path)
|
@@ -1106,7 +1093,7 @@ class Tpkg
|
|
1106
1093
|
perms = stat.mode
|
1107
1094
|
# This is what we set the ownership to by default
|
1108
1095
|
uid = DEFAULT_OWNERSHIP_UID
|
1109
|
-
gid =
|
1096
|
+
gid = DEFAULT_OWNERSHIP_GID
|
1110
1097
|
end
|
1111
1098
|
|
1112
1099
|
# get default permission and ownership
|
@@ -2545,8 +2532,8 @@ class Tpkg
|
|
2545
2532
|
|
2546
2533
|
# Handle any default permissions and ownership
|
2547
2534
|
default_uid = DEFAULT_OWNERSHIP_UID
|
2548
|
-
default_gid =
|
2549
|
-
default_perms =
|
2535
|
+
default_gid = DEFAULT_OWNERSHIP_GID
|
2536
|
+
default_perms = DEFAULT_FILE_PERMS
|
2550
2537
|
|
2551
2538
|
if (metadata[:files][:file_defaults][:posix][:owner] rescue nil)
|
2552
2539
|
default_uid = Tpkg::lookup_uid(metadata[:files][:file_defaults][:posix][:owner])
|
@@ -2561,7 +2548,7 @@ class Tpkg
|
|
2561
2548
|
# Set default dir uid/gid to be same as for file.
|
2562
2549
|
default_dir_uid = default_uid
|
2563
2550
|
default_dir_gid = default_gid
|
2564
|
-
default_dir_perms =
|
2551
|
+
default_dir_perms = DEFAULT_DIR_PERMS
|
2565
2552
|
|
2566
2553
|
if (metadata[:files][:dir_defaults][:posix][:owner] rescue nil)
|
2567
2554
|
default_dir_uid = Tpkg::lookup_uid(metadata[:files][:dir_defaults][:posix][:owner])
|
@@ -2572,15 +2559,16 @@ class Tpkg
|
|
2572
2559
|
if (metadata[:files][:dir_defaults][:posix][:perms] rescue nil)
|
2573
2560
|
default_dir_perms = metadata[:files][:dir_defaults][:posix][:perms]
|
2574
2561
|
end
|
2575
|
-
|
2562
|
+
|
2563
|
+
# FIXME: attempt lchown/lchmod on symlinks
|
2576
2564
|
root_dir = File.join(workdir, 'tpkg', 'root')
|
2577
2565
|
reloc_dir = File.join(workdir, 'tpkg', 'reloc')
|
2578
2566
|
Find.find(*Tpkg::get_package_toplevels(File.join(workdir, 'tpkg'))) do |f|
|
2579
2567
|
begin
|
2580
|
-
if File.
|
2581
|
-
File.chown(default_dir_uid, default_dir_gid, f)
|
2582
|
-
else
|
2568
|
+
if File.file?(f) && !File.symlink?(f)
|
2583
2569
|
File.chown(default_uid, default_gid, f)
|
2570
|
+
elsif File.directory?(f) && !File.symlink?(f)
|
2571
|
+
File.chown(default_dir_uid, default_dir_gid, f)
|
2584
2572
|
end
|
2585
2573
|
rescue Errno::EPERM
|
2586
2574
|
raise if Process.euid == 0
|
@@ -2628,14 +2616,22 @@ class Tpkg
|
|
2628
2616
|
gid = Tpkg::lookup_gid(tpkgfile[:posix][:group])
|
2629
2617
|
end
|
2630
2618
|
begin
|
2631
|
-
File.
|
2619
|
+
if !File.symlink?(working_path)
|
2620
|
+
File.chown(uid, gid, working_path)
|
2621
|
+
else
|
2622
|
+
# FIXME: attempt lchown
|
2623
|
+
end
|
2632
2624
|
rescue Errno::EPERM
|
2633
2625
|
raise if Process.euid == 0
|
2634
2626
|
end
|
2635
2627
|
end
|
2636
2628
|
if tpkgfile[:posix][:perms]
|
2637
2629
|
perms = tpkgfile[:posix][:perms]
|
2638
|
-
File.
|
2630
|
+
if !File.symlink?(working_path)
|
2631
|
+
File.chmod(perms, working_path)
|
2632
|
+
else
|
2633
|
+
# FIXME: attempt lchmod
|
2634
|
+
end
|
2639
2635
|
end
|
2640
2636
|
end
|
2641
2637
|
|
data/lib/tpkg/deployer.rb
CHANGED
@@ -1,21 +1,30 @@
|
|
1
|
+
##############################################################################
|
2
|
+
# tpkg package management system
|
3
|
+
# Copyright 2009, 2010, 2011 AT&T Interactive
|
4
|
+
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
|
+
##############################################################################
|
6
|
+
|
1
7
|
# We store these gems in our thirdparty directory. So we need to add it
|
2
8
|
# it to the search path
|
3
|
-
|
4
|
-
$:.unshift(File.join(File.dirname(__FILE__), 'thirdparty/net-ssh-2.0.11/lib'))
|
5
|
-
# And this one for when we're in the svn directory structure
|
6
|
-
$:.unshift(File.join(File.dirname(File.dirname(__FILE__)), 'thirdparty/net-ssh-2.0.11/lib'))
|
9
|
+
$:.unshift(File.join(File.dirname(__FILE__), 'thirdparty/net-ssh-2.1.0/lib'))
|
7
10
|
|
8
11
|
$debug = true
|
9
12
|
|
10
|
-
|
11
|
-
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
13
|
+
# Exclude standard libraries and gems from the warnings induced by
|
14
|
+
# running ruby with the -w flag. If any of these had warnings there's
|
15
|
+
# nothing we could do to fix that.
|
16
|
+
require 'tpkg/silently'
|
17
|
+
Silently.silently do
|
18
|
+
begin
|
19
|
+
# Try loading net-ssh w/o gems first so that we don't introduce a
|
20
|
+
# dependency on gems if it is not needed.
|
21
|
+
require 'net/ssh'
|
22
|
+
rescue LoadError
|
23
|
+
require 'rubygems'
|
24
|
+
require 'net/ssh'
|
25
|
+
end
|
18
26
|
end
|
27
|
+
require 'tpkg/thread_pool'
|
19
28
|
|
20
29
|
class Deployer
|
21
30
|
|
@@ -97,11 +106,11 @@ class Deployer
|
|
97
106
|
# back and forth if needed. it WILL NOT WORK without this, and it has to
|
98
107
|
# be done before any call to exec.
|
99
108
|
|
100
|
-
channel.request_pty do |
|
109
|
+
channel.request_pty do |ch_pty, success|
|
101
110
|
raise "Could not obtain pty (i.e. an interactive ssh session)" if !success
|
102
111
|
end
|
103
112
|
|
104
|
-
channel.exec(cmd) do |
|
113
|
+
channel.exec(cmd) do |ch_exec, success|
|
105
114
|
puts "Executing #{cmd} on #{server}"
|
106
115
|
# 'success' isn't related to bash exit codes or anything, but more
|
107
116
|
# about ssh internals (i think... not bash related anyways).
|
@@ -113,7 +122,7 @@ class Deployer
|
|
113
122
|
# in (see below) returns data. This is what we've been doing all this
|
114
123
|
# for; now we can check to see if it's a password prompt, and
|
115
124
|
# interactively return data if so (see request_pty above).
|
116
|
-
channel.on_data do |
|
125
|
+
channel.on_data do |ch_data, data|
|
117
126
|
if data =~ /Password:/
|
118
127
|
password = get_sudo_pw unless !password.nil? && password != ""
|
119
128
|
channel.send_data "#{password}\n"
|
@@ -126,11 +135,11 @@ class Deployer
|
|
126
135
|
end
|
127
136
|
end
|
128
137
|
|
129
|
-
channel.on_extended_data do |
|
138
|
+
channel.on_extended_data do |ch_onextdata, type, data|
|
130
139
|
print "SSH command returned on stderr: #{data}"
|
131
140
|
end
|
132
141
|
|
133
|
-
channel.on_request "exit-status" do |
|
142
|
+
channel.on_request "exit-status" do |ch_onreq, data|
|
134
143
|
exit_status = data.read_long
|
135
144
|
end
|
136
145
|
end
|
data/lib/tpkg/metadata.rb
CHANGED
@@ -1,13 +1,22 @@
|
|
1
|
-
|
2
|
-
|
1
|
+
##############################################################################
|
2
|
+
# tpkg package management system
|
3
|
+
# Copyright 2009, 2010, 2011 AT&T Interactive
|
4
|
+
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
|
+
##############################################################################
|
3
6
|
|
4
7
|
# We store this gem in our thirdparty directory. So we need to add it
|
5
8
|
# it to the search path
|
6
|
-
|
7
|
-
|
8
|
-
#
|
9
|
-
|
10
|
-
|
9
|
+
$:.unshift(File.join(File.dirname(__FILE__), 'thirdparty/kwalify-0.7.2/lib'))
|
10
|
+
|
11
|
+
# Exclude standard libraries and gems from the warnings induced by
|
12
|
+
# running ruby with the -w flag. Several of these have warnings and
|
13
|
+
# there's nothing we can do to fix that.
|
14
|
+
require 'tpkg/silently'
|
15
|
+
Silently.silently do
|
16
|
+
require 'yaml' # YAML
|
17
|
+
require 'rexml/document' # REXML::Document
|
18
|
+
require 'kwalify' # Kwalify, for validating yaml
|
19
|
+
end
|
11
20
|
|
12
21
|
# This class is taken from the ActiveSupport gem.
|
13
22
|
# With yaml, keys are stored as string. But when we convert xml to hash, we store the key as
|
@@ -229,6 +238,8 @@ class Metadata
|
|
229
238
|
dirtystring.downcase.gsub(/[^\w]/, '')
|
230
239
|
end
|
231
240
|
|
241
|
+
# Parse a file containing multiple package metadata documents (such as is
|
242
|
+
# generated by Tpkg.extract_metadata) into a hash of Metadata objects
|
232
243
|
def self.get_pkgs_metadata_from_yml_doc(yml_doc, metadata=nil, source=nil)
|
233
244
|
metadata ||= {}
|
234
245
|
metadata_lists = yml_doc.split("---")
|
@@ -242,7 +253,7 @@ class Metadata
|
|
242
253
|
return metadata
|
243
254
|
end
|
244
255
|
|
245
|
-
# Given the directory
|
256
|
+
# Given the directory of an unpacked package, returns a Metadata
|
246
257
|
# object. The metadata file can be in yml or xml format
|
247
258
|
def self.instantiate_from_dir(dir)
|
248
259
|
metadata = nil
|
@@ -258,6 +269,10 @@ class Metadata
|
|
258
269
|
|
259
270
|
# metadata_text = text representation of the metadata
|
260
271
|
# format = yml, xml, json, etc.
|
272
|
+
# source = Source, in the tpkg sense, of the package described by this
|
273
|
+
# metadata. I.e. the filename of an individual package or a directory or
|
274
|
+
# URL containing multiple packages and a metadata.yml file. Used by tpkg to
|
275
|
+
# report on how many packages are available from various sources.
|
261
276
|
def initialize(metadata_text, format, source=nil)
|
262
277
|
@hash = nil
|
263
278
|
@metadata_text = metadata_text
|
data/lib/tpkg/thread_pool.rb
CHANGED
@@ -1,8 +1,20 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
|
1
|
+
##############################################################################
|
2
|
+
# tpkg package management system
|
3
|
+
# Copyright 2009, 2010, 2011 AT&T Interactive
|
4
|
+
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
|
+
##############################################################################
|
6
|
+
|
7
|
+
# Exclude standard libraries and gems from the warnings induced by
|
8
|
+
# running ruby with the -w flag. If any of these had warnings there's
|
9
|
+
# nothing we could do to fix that.
|
10
|
+
require 'tpkg/silently'
|
11
|
+
Silently.silently do
|
12
|
+
require 'thread'
|
13
|
+
begin
|
14
|
+
require 'fastthread'
|
15
|
+
rescue LoadError
|
16
|
+
# $stderr.puts "Using the ruby-core thread implementation"
|
17
|
+
end
|
6
18
|
end
|
7
19
|
|
8
20
|
class ThreadPool
|
data/lib/tpkg/versiontype.rb
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
##############################################################################
|
2
|
+
# tpkg package management system
|
3
|
+
# Copyright 2009, 2010, 2011 AT&T Interactive
|
4
|
+
# License: MIT (http://www.opensource.org/licenses/mit-license.php)
|
5
|
+
##############################################################################
|
6
|
+
|
1
7
|
# This class stores numbers with multiple decimal points, a format
|
2
8
|
# commonly used for version numbers. For example '2.5.1'.
|
3
9
|
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: tpkg
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
5
|
-
prerelease:
|
4
|
+
hash: 3
|
5
|
+
prerelease:
|
6
6
|
segments:
|
7
7
|
- 2
|
8
8
|
- 2
|
9
|
-
-
|
10
|
-
version: 2.2.
|
9
|
+
- 2
|
10
|
+
version: 2.2.2
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Darren Dao
|
@@ -16,7 +16,7 @@ autorequire:
|
|
16
16
|
bindir: bin
|
17
17
|
cert_chain: []
|
18
18
|
|
19
|
-
date: 2011-02-
|
19
|
+
date: 2011-02-14 00:00:00 -08:00
|
20
20
|
default_executable:
|
21
21
|
dependencies:
|
22
22
|
- !ruby/object:Gem::Dependency
|
@@ -48,7 +48,7 @@ dependencies:
|
|
48
48
|
type: :runtime
|
49
49
|
version_requirements: *id002
|
50
50
|
- !ruby/object:Gem::Dependency
|
51
|
-
name:
|
51
|
+
name: kwalify
|
52
52
|
prerelease: false
|
53
53
|
requirement: &id003 !ruby/object:Gem::Requirement
|
54
54
|
none: false
|
@@ -79,6 +79,7 @@ files:
|
|
79
79
|
- bin/tpkg_xml_to_yml
|
80
80
|
- lib/tpkg/deployer.rb
|
81
81
|
- lib/tpkg/metadata.rb
|
82
|
+
- lib/tpkg/silently.rb
|
82
83
|
- lib/tpkg/thread_pool.rb
|
83
84
|
- lib/tpkg/versiontype.rb
|
84
85
|
- lib/tpkg.rb
|
@@ -132,7 +133,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
132
133
|
requirements: []
|
133
134
|
|
134
135
|
rubyforge_project: tpkg
|
135
|
-
rubygems_version: 1.
|
136
|
+
rubygems_version: 1.5.0
|
136
137
|
signing_key:
|
137
138
|
specification_version: 3
|
138
139
|
summary: tpkg Application Packaging & Deployment
|