packo 0.0.1.alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/bin/packo +78 -0
- data/bin/packo-base +24 -0
- data/bin/packo-build +24 -0
- data/bin/packo-db +24 -0
- data/bin/packo-env +24 -0
- data/bin/packo-files +24 -0
- data/bin/packo-profile +24 -0
- data/bin/packo-repository +24 -0
- data/bin/packo-select +24 -0
- data/lib/packo.rb +186 -0
- data/lib/packo/cli.rb +79 -0
- data/lib/packo/cli/base.rb +554 -0
- data/lib/packo/cli/build.rb +488 -0
- data/lib/packo/cli/database.rb +55 -0
- data/lib/packo/cli/database/definition.rb +65 -0
- data/lib/packo/cli/database/helpers.rb +20 -0
- data/lib/packo/cli/environment.rb +45 -0
- data/lib/packo/cli/files.rb +153 -0
- data/lib/packo/cli/profile.rb +31 -0
- data/lib/packo/cli/repository.rb +561 -0
- data/lib/packo/cli/repository/binary.rb +74 -0
- data/lib/packo/cli/repository/helpers.rb +20 -0
- data/lib/packo/cli/repository/repository.rb +48 -0
- data/lib/packo/cli/repository/source.rb +91 -0
- data/lib/packo/cli/repository/virtual.rb +53 -0
- data/lib/packo/cli/select.rb +61 -0
- data/lib/packo/do.rb +249 -0
- data/lib/packo/environment.rb +269 -0
- data/lib/packo/extensions.rb +70 -0
- data/lib/packo/flags.rb +64 -0
- data/lib/packo/host.rb +121 -0
- data/lib/packo/models.rb +171 -0
- data/lib/packo/models/installed_package.rb +190 -0
- data/lib/packo/models/installed_package/content.rb +50 -0
- data/lib/packo/models/installed_package/dependency.rb +39 -0
- data/lib/packo/models/repository.rb +209 -0
- data/lib/packo/models/repository/binary.rb +32 -0
- data/lib/packo/models/repository/binary/mirror.rb +35 -0
- data/lib/packo/models/repository/package.rb +73 -0
- data/lib/packo/models/repository/package/binary.rb +34 -0
- data/lib/packo/models/repository/package/binary/build.rb +36 -0
- data/lib/packo/models/repository/package/source.rb +36 -0
- data/lib/packo/models/repository/package/source/feature.rb +36 -0
- data/lib/packo/models/repository/package/source/flavor.rb +36 -0
- data/lib/packo/models/repository/package/virtual.rb +32 -0
- data/lib/packo/models/repository/source.rb +30 -0
- data/lib/packo/models/repository/virtual.rb +30 -0
- data/lib/packo/models/selector.rb +34 -0
- data/lib/packo/models/tag.rb +30 -0
- data/lib/packo/package.rb +239 -0
- data/lib/packo/package/blocker.rb +100 -0
- data/lib/packo/package/blockers.rb +40 -0
- data/lib/packo/package/dependencies.rb +40 -0
- data/lib/packo/package/dependency.rb +100 -0
- data/lib/packo/package/feature.rb +55 -0
- data/lib/packo/package/features.rb +105 -0
- data/lib/packo/package/flavor.rb +101 -0
- data/lib/packo/package/tags.rb +60 -0
- data/lib/packo/package/tags/expression.rb +130 -0
- data/lib/packo/package/tags/expression/group.rb +28 -0
- data/lib/packo/package/tags/expression/logic.rb +48 -0
- data/lib/packo/package/tags/expression/name.rb +28 -0
- data/lib/packo/profile.rb +174 -0
- data/lib/packo/rbuild.rb +22 -0
- data/lib/packo/rbuild/behaviors.rb +20 -0
- data/lib/packo/rbuild/behaviors/default.rb +27 -0
- data/lib/packo/rbuild/feature.rb +64 -0
- data/lib/packo/rbuild/features.rb +65 -0
- data/lib/packo/rbuild/flavor.rb +67 -0
- data/lib/packo/rbuild/module.rb +40 -0
- data/lib/packo/rbuild/modules.rb +27 -0
- data/lib/packo/rbuild/modules/building.rb +24 -0
- data/lib/packo/rbuild/modules/building/autotools.rb +315 -0
- data/lib/packo/rbuild/modules/building/cmake.rb +38 -0
- data/lib/packo/rbuild/modules/building/patch.rb +84 -0
- data/lib/packo/rbuild/modules/building/rake.rb +74 -0
- data/lib/packo/rbuild/modules/building/strip.rb +41 -0
- data/lib/packo/rbuild/modules/misc.rb +26 -0
- data/lib/packo/rbuild/modules/misc/fetcher.rb +177 -0
- data/lib/packo/rbuild/modules/misc/fetching.rb +22 -0
- data/lib/packo/rbuild/modules/misc/fetching/git.rb +57 -0
- data/lib/packo/rbuild/modules/misc/fetching/github.rb +31 -0
- data/lib/packo/rbuild/modules/misc/fetching/gnu.rb +59 -0
- data/lib/packo/rbuild/modules/misc/fetching/mercurial.rb +51 -0
- data/lib/packo/rbuild/modules/misc/fetching/sourceforge.rb +47 -0
- data/lib/packo/rbuild/modules/misc/fetching/subversion.rb +51 -0
- data/lib/packo/rbuild/modules/misc/fetching/wget.rb +57 -0
- data/lib/packo/rbuild/modules/misc/unpacker.rb +70 -0
- data/lib/packo/rbuild/modules/misc/unpacking.rb +23 -0
- data/lib/packo/rbuild/modules/misc/unpacking/lzma.rb +34 -0
- data/lib/packo/rbuild/modules/misc/unpacking/tar.rb +35 -0
- data/lib/packo/rbuild/modules/misc/unpacking/xz.rb +34 -0
- data/lib/packo/rbuild/modules/misc/unpacking/zip.rb +26 -0
- data/lib/packo/rbuild/modules/packaging.rb +20 -0
- data/lib/packo/rbuild/modules/packaging/pko.rb +78 -0
- data/lib/packo/rbuild/package.rb +281 -0
- data/lib/packo/rbuild/package/manifest.rb +169 -0
- data/lib/packo/rbuild/stages.rb +171 -0
- data/lib/packo/rbuild/stages/callbacks.rb +96 -0
- data/lib/packo/rbuild/stages/stage.rb +50 -0
- data/lib/packo/repository.rb +95 -0
- data/lib/packo/repository/binary.rb +116 -0
- data/lib/packo/repository/source.rb +77 -0
- data/lib/packo/repository/virtual.rb +66 -0
- data/lib/packo/system.rb +53 -0
- data/lib/packo/version.rb +26 -0
- metadata +276 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# Copyleft meh. [http://meh.doesntexist.org | meh@paranoici.org]
|
|
3
|
+
#
|
|
4
|
+
# This file is part of packo.
|
|
5
|
+
#
|
|
6
|
+
# packo is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU Affero General Public License as published
|
|
8
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# packo is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU Affero General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
17
|
+
# along with packo. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
#++
|
|
19
|
+
|
|
20
|
+
require 'uri'
|
|
21
|
+
|
|
22
|
+
module Packo
|
|
23
|
+
|
|
24
|
+
class Repository
|
|
25
|
+
Types = [:binary, :source, :virtual]
|
|
26
|
+
|
|
27
|
+
def self.parse (text)
|
|
28
|
+
if text.include?('/')
|
|
29
|
+
type, name = text.split('/')
|
|
30
|
+
|
|
31
|
+
type = type.to_sym
|
|
32
|
+
else
|
|
33
|
+
type, name = nil, name
|
|
34
|
+
end
|
|
35
|
+
|
|
36
|
+
Repository.new(
|
|
37
|
+
type: type,
|
|
38
|
+
name: name
|
|
39
|
+
)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def self.wrap (model)
|
|
43
|
+
Repository.new(
|
|
44
|
+
type: model.type,
|
|
45
|
+
name: model.name,
|
|
46
|
+
|
|
47
|
+
uri: model.uri,
|
|
48
|
+
path: model.path,
|
|
49
|
+
|
|
50
|
+
model: model
|
|
51
|
+
)
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
attr_accessor :type, :name, :uri, :path
|
|
55
|
+
|
|
56
|
+
attr_reader :model
|
|
57
|
+
|
|
58
|
+
def initialize (data)
|
|
59
|
+
self.type = data[:type]
|
|
60
|
+
self.name = data[:name]
|
|
61
|
+
|
|
62
|
+
self.uri = data[:uri]
|
|
63
|
+
self.path = data[:path]
|
|
64
|
+
|
|
65
|
+
@model = data[:model]
|
|
66
|
+
end
|
|
67
|
+
|
|
68
|
+
def type= (value)
|
|
69
|
+
@type = value.to_sym if value
|
|
70
|
+
end
|
|
71
|
+
|
|
72
|
+
def uri= (value)
|
|
73
|
+
@uri = value.is_a?(URI) ? value : URI.parse(value) if value
|
|
74
|
+
end
|
|
75
|
+
|
|
76
|
+
def to_hash
|
|
77
|
+
result = {}
|
|
78
|
+
|
|
79
|
+
[:type, :name, :uri, :path].each {|name|
|
|
80
|
+
result[name] = self.send(name) unless self.send(name).nil?
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
return result
|
|
84
|
+
end
|
|
85
|
+
|
|
86
|
+
def to_s
|
|
87
|
+
"#{self.type}/#{self.name}"
|
|
88
|
+
end
|
|
89
|
+
end
|
|
90
|
+
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
require 'packo/repository/binary'
|
|
94
|
+
require 'packo/repository/source'
|
|
95
|
+
require 'packo/repository/virtual'
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# Copyleft meh. [http://meh.doesntexist.org | meh@paranoici.org]
|
|
3
|
+
#
|
|
4
|
+
# This file is part of packo.
|
|
5
|
+
#
|
|
6
|
+
# packo is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU Affero General Public License as published
|
|
8
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# packo is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU Affero General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
17
|
+
# along with packo. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
#++
|
|
19
|
+
|
|
20
|
+
require 'nokogiri'
|
|
21
|
+
|
|
22
|
+
require 'packo/package'
|
|
23
|
+
|
|
24
|
+
module Packo; class Repository
|
|
25
|
+
|
|
26
|
+
class Binary < Repository
|
|
27
|
+
class Package < Packo::Package
|
|
28
|
+
class Build
|
|
29
|
+
attr_reader :flavor, :features, :digest
|
|
30
|
+
|
|
31
|
+
def initialize (data)
|
|
32
|
+
@flavor = data[:flavor]
|
|
33
|
+
@features = data[:features]
|
|
34
|
+
@digest = data[:digest]
|
|
35
|
+
end
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
attr_reader :builds
|
|
39
|
+
|
|
40
|
+
def initialize (data)
|
|
41
|
+
super(data)
|
|
42
|
+
|
|
43
|
+
@builds = data[:builds] || []
|
|
44
|
+
end
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
def self.parse (data)
|
|
48
|
+
dom = Nokogiri::XML.parse(data)
|
|
49
|
+
|
|
50
|
+
repo = Binary.new(type: dom.root['type'].to_sym, name: dom.root['name'])
|
|
51
|
+
repo.generate(data)
|
|
52
|
+
repo
|
|
53
|
+
end
|
|
54
|
+
|
|
55
|
+
def initialize (data)
|
|
56
|
+
if data[:type] != :binary
|
|
57
|
+
raise ArgumentError.new('It has to be a binary repository')
|
|
58
|
+
end
|
|
59
|
+
|
|
60
|
+
super(data)
|
|
61
|
+
end
|
|
62
|
+
|
|
63
|
+
def mirrors (data=nil)
|
|
64
|
+
Nokogiri::XML.parse(data || File.read(self.path)).xpath('//mirrors/mirror').map {|e|
|
|
65
|
+
e.text
|
|
66
|
+
}
|
|
67
|
+
end
|
|
68
|
+
|
|
69
|
+
def packages (data=nil)
|
|
70
|
+
Enumerator.new(self, :each_package, data)
|
|
71
|
+
end
|
|
72
|
+
|
|
73
|
+
def each_package (data=nil)
|
|
74
|
+
Nokogiri::XML.parse(data || File.read(self.path)).xpath('//packages/package').each {|e|
|
|
75
|
+
CLI.info "Parsing #{Packo::Package.new(tags: e['tags'].split(/\s+/), name: e['name'])}" if System.env[:VERBOSE]
|
|
76
|
+
|
|
77
|
+
packages = []
|
|
78
|
+
|
|
79
|
+
e.xpath('.//build').each {|build|
|
|
80
|
+
package = Package.new(
|
|
81
|
+
tags: e['tags'],
|
|
82
|
+
name: e['name'],
|
|
83
|
+
version: build.parent['name'],
|
|
84
|
+
slot: (build.parent.parent.name == 'slot') ? build.parent.parent['name'] : nil,
|
|
85
|
+
revision: build.parent['revision'],
|
|
86
|
+
|
|
87
|
+
features: build.parent['features'],
|
|
88
|
+
|
|
89
|
+
description: e.xpath('.//description').first.text,
|
|
90
|
+
homepage: e.xpath('.//homepage').first.text,
|
|
91
|
+
license: e.xpath('.//license').first.text,
|
|
92
|
+
|
|
93
|
+
maintainer: e['maintainer']
|
|
94
|
+
)
|
|
95
|
+
|
|
96
|
+
if packages.member?(package)
|
|
97
|
+
package = packages.find {|p| p == package}
|
|
98
|
+
else
|
|
99
|
+
packages << package
|
|
100
|
+
end
|
|
101
|
+
|
|
102
|
+
package.builds << Package::Build.new(
|
|
103
|
+
flavor: (build.xpath('.//flavor').first.text rescue ''),
|
|
104
|
+
features: (build.xpath('.//features').first.text rescue ''),
|
|
105
|
+
digest: build['digest']
|
|
106
|
+
)
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
packages.each {|package|
|
|
110
|
+
yield package
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
end
|
|
114
|
+
end
|
|
115
|
+
|
|
116
|
+
end; end
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# Copyleft meh. [http://meh.doesntexist.org | meh@paranoici.org]
|
|
3
|
+
#
|
|
4
|
+
# This file is part of packo.
|
|
5
|
+
#
|
|
6
|
+
# packo is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU Affero General Public License as published
|
|
8
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# packo is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU Affero General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
17
|
+
# along with packo. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
#++
|
|
19
|
+
|
|
20
|
+
require 'packo/package'
|
|
21
|
+
require 'nokogiri'
|
|
22
|
+
|
|
23
|
+
module Packo; class Repository
|
|
24
|
+
|
|
25
|
+
class Source < Repository
|
|
26
|
+
def initialize (data)
|
|
27
|
+
if data[:type] != :source
|
|
28
|
+
raise ArgumentError.new('It has to be a source repository')
|
|
29
|
+
end
|
|
30
|
+
|
|
31
|
+
super(data)
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
def address
|
|
35
|
+
Nokogiri::XML.parse(File.read("#{self.path}/repository.xml")).xpath('//address').first.text rescue nil
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def packages (what=[self.path], root=self.path)
|
|
39
|
+
Enumerator.new(self, :each_package, what, root)
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def each_package (what=[self.path], root=self.path, &block)
|
|
43
|
+
what.select {|what| File.directory? what}.each {|what|
|
|
44
|
+
if File.file? "#{what}/#{File.basename(what)}.rbuild"
|
|
45
|
+
Dir.glob("#{what}/#{File.basename(what)}-*.rbuild").each {|version|
|
|
46
|
+
CLI.info "Parsing #{version.sub("#{self.path}/", '')}" if System.env[:VERBOSE]
|
|
47
|
+
|
|
48
|
+
pkg = Packo::Package.new(
|
|
49
|
+
name: File.basename(what),
|
|
50
|
+
version: version.match(/-(\d.*?)\.rbuild$/)[1]
|
|
51
|
+
)
|
|
52
|
+
|
|
53
|
+
begin
|
|
54
|
+
package = Packo.loadPackage(what, pkg)
|
|
55
|
+
rescue LoadError => e
|
|
56
|
+
CLI.warn e.to_s if System.env[:VERBOSE]
|
|
57
|
+
end
|
|
58
|
+
|
|
59
|
+
if !package || package.name != pkg.name || package.version != pkg.version
|
|
60
|
+
CLI.warn "Package not found: #{pkg.name}" if System.env[:VERBOSE]
|
|
61
|
+
next
|
|
62
|
+
end
|
|
63
|
+
|
|
64
|
+
package.path = version.sub("#{self.path}/", '')
|
|
65
|
+
|
|
66
|
+
block.call(package)
|
|
67
|
+
}
|
|
68
|
+
else
|
|
69
|
+
each_package(Dir.entries(what).map {|e|
|
|
70
|
+
"#{what}/#{e}" if e != '.' && e != '..'
|
|
71
|
+
}.compact, root, &block)
|
|
72
|
+
end
|
|
73
|
+
}
|
|
74
|
+
end
|
|
75
|
+
end
|
|
76
|
+
|
|
77
|
+
end; end
|
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# Copyleft meh. [http://meh.doesntexist.org | meh@paranoici.org]
|
|
3
|
+
#
|
|
4
|
+
# This file is part of packo.
|
|
5
|
+
#
|
|
6
|
+
# packo is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU Affero General Public License as published
|
|
8
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# packo is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU Affero General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
17
|
+
# along with packo. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
#++
|
|
19
|
+
|
|
20
|
+
require 'fffs'
|
|
21
|
+
|
|
22
|
+
require 'packo/package'
|
|
23
|
+
|
|
24
|
+
module Packo; class Repository
|
|
25
|
+
|
|
26
|
+
class Virtual < Repository
|
|
27
|
+
attr_reader :filesystem
|
|
28
|
+
|
|
29
|
+
def initialize (data, &block)
|
|
30
|
+
if data[:type] != :virtual
|
|
31
|
+
raise ArgumentError.new('It has to be a virtual repository')
|
|
32
|
+
end
|
|
33
|
+
|
|
34
|
+
super(data)
|
|
35
|
+
|
|
36
|
+
@filesystem = FFFS::FileSystem.new
|
|
37
|
+
|
|
38
|
+
self.do(File.read(data[:path])) if data[:path]
|
|
39
|
+
self.do(&block) if block
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
def do (data=nil, &block)
|
|
43
|
+
repository = self
|
|
44
|
+
|
|
45
|
+
if data
|
|
46
|
+
if (tmp = data.split(/^__END__$/)).length > 1
|
|
47
|
+
@filesystem.parse(tmp.last.lstrip)
|
|
48
|
+
data = tmp.first
|
|
49
|
+
end
|
|
50
|
+
|
|
51
|
+
self.instance_eval(data) if data
|
|
52
|
+
end
|
|
53
|
+
|
|
54
|
+
if block
|
|
55
|
+
self.instance_eval(&block)
|
|
56
|
+
end
|
|
57
|
+
|
|
58
|
+
self
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def packages (*args)
|
|
62
|
+
Enumerator.new(self, :each_package, *args)
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
end; end
|
data/lib/packo/system.rb
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# Copyleft meh. [http://meh.doesntexist.org | meh@paranoici.org]
|
|
3
|
+
#
|
|
4
|
+
# This file is part of packo.
|
|
5
|
+
#
|
|
6
|
+
# packo is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU Affero General Public License as published
|
|
8
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# packo is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU Affero General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
17
|
+
# along with packo. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
#++
|
|
19
|
+
|
|
20
|
+
require 'packo/extensions'
|
|
21
|
+
require 'packo/environment'
|
|
22
|
+
require 'packo/host'
|
|
23
|
+
|
|
24
|
+
module Packo
|
|
25
|
+
|
|
26
|
+
System = Class.new {
|
|
27
|
+
attr_reader :environment, :host
|
|
28
|
+
|
|
29
|
+
def environment!; @environmentClean end
|
|
30
|
+
|
|
31
|
+
alias env environment
|
|
32
|
+
alias env! environment!
|
|
33
|
+
|
|
34
|
+
def initialize
|
|
35
|
+
@environment = Environment.new
|
|
36
|
+
@environmentClean = Environment.new(nil, true)
|
|
37
|
+
@host = Host.new(@environmentClean) rescue nil
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def has? (package, exact=true)
|
|
41
|
+
if package.is_a?(Package::Tags) || package.is_a?(Array)
|
|
42
|
+
expression = "[#{package.join(' && ')}]"
|
|
43
|
+
elsif package.is_a?(String)
|
|
44
|
+
expression = package
|
|
45
|
+
else
|
|
46
|
+
expression = Package.parse(package.to_s(:whole)).to_s(:whole)
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
!Models::InstalledPackage.search(expression, exact).empty?
|
|
50
|
+
end
|
|
51
|
+
}.new
|
|
52
|
+
|
|
53
|
+
end
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
#--
|
|
2
|
+
# Copyleft meh. [http://meh.doesntexist.org | meh@paranoici.org]
|
|
3
|
+
#
|
|
4
|
+
# This file is part of packo.
|
|
5
|
+
#
|
|
6
|
+
# packo is free software: you can redistribute it and/or modify
|
|
7
|
+
# it under the terms of the GNU Affero General Public License as published
|
|
8
|
+
# by the Free Software Foundation, either version 3 of the License, or
|
|
9
|
+
# (at your option) any later version.
|
|
10
|
+
#
|
|
11
|
+
# packo is distributed in the hope that it will be useful,
|
|
12
|
+
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
13
|
+
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
14
|
+
# GNU Affero General Public License for more details.
|
|
15
|
+
#
|
|
16
|
+
# You should have received a copy of the GNU Affero General Public License
|
|
17
|
+
# along with packo. If not, see <http://www.gnu.org/licenses/>.
|
|
18
|
+
#++
|
|
19
|
+
|
|
20
|
+
module Packo
|
|
21
|
+
|
|
22
|
+
def self.version
|
|
23
|
+
'0.0.1.alpha.1'
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,276 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: packo
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
prerelease: 6
|
|
5
|
+
version: 0.0.1.alpha.1
|
|
6
|
+
platform: ruby
|
|
7
|
+
authors:
|
|
8
|
+
- meh.
|
|
9
|
+
autorequire:
|
|
10
|
+
bindir: bin
|
|
11
|
+
cert_chain: []
|
|
12
|
+
|
|
13
|
+
date: 2011-04-25 00:00:00 Z
|
|
14
|
+
dependencies:
|
|
15
|
+
- !ruby/object:Gem::Dependency
|
|
16
|
+
name: thor
|
|
17
|
+
prerelease: false
|
|
18
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
|
19
|
+
none: false
|
|
20
|
+
requirements:
|
|
21
|
+
- - ">="
|
|
22
|
+
- !ruby/object:Gem::Version
|
|
23
|
+
version: "0"
|
|
24
|
+
type: :runtime
|
|
25
|
+
version_requirements: *id001
|
|
26
|
+
- !ruby/object:Gem::Dependency
|
|
27
|
+
name: colorb
|
|
28
|
+
prerelease: false
|
|
29
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
|
30
|
+
none: false
|
|
31
|
+
requirements:
|
|
32
|
+
- - ">="
|
|
33
|
+
- !ruby/object:Gem::Version
|
|
34
|
+
version: "0"
|
|
35
|
+
type: :runtime
|
|
36
|
+
version_requirements: *id002
|
|
37
|
+
- !ruby/object:Gem::Dependency
|
|
38
|
+
name: nokogiri
|
|
39
|
+
prerelease: false
|
|
40
|
+
requirement: &id003 !ruby/object:Gem::Requirement
|
|
41
|
+
none: false
|
|
42
|
+
requirements:
|
|
43
|
+
- - ">="
|
|
44
|
+
- !ruby/object:Gem::Version
|
|
45
|
+
version: "0"
|
|
46
|
+
type: :runtime
|
|
47
|
+
version_requirements: *id003
|
|
48
|
+
- !ruby/object:Gem::Dependency
|
|
49
|
+
name: datamapper
|
|
50
|
+
prerelease: false
|
|
51
|
+
requirement: &id004 !ruby/object:Gem::Requirement
|
|
52
|
+
none: false
|
|
53
|
+
requirements:
|
|
54
|
+
- - ">="
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: "0"
|
|
57
|
+
type: :runtime
|
|
58
|
+
version_requirements: *id004
|
|
59
|
+
- !ruby/object:Gem::Dependency
|
|
60
|
+
name: dm-transactions
|
|
61
|
+
prerelease: false
|
|
62
|
+
requirement: &id005 !ruby/object:Gem::Requirement
|
|
63
|
+
none: false
|
|
64
|
+
requirements:
|
|
65
|
+
- - ">="
|
|
66
|
+
- !ruby/object:Gem::Version
|
|
67
|
+
version: "0"
|
|
68
|
+
type: :runtime
|
|
69
|
+
version_requirements: *id005
|
|
70
|
+
- !ruby/object:Gem::Dependency
|
|
71
|
+
name: dm-timestamps
|
|
72
|
+
prerelease: false
|
|
73
|
+
requirement: &id006 !ruby/object:Gem::Requirement
|
|
74
|
+
none: false
|
|
75
|
+
requirements:
|
|
76
|
+
- - ">="
|
|
77
|
+
- !ruby/object:Gem::Version
|
|
78
|
+
version: "0"
|
|
79
|
+
type: :runtime
|
|
80
|
+
version_requirements: *id006
|
|
81
|
+
- !ruby/object:Gem::Dependency
|
|
82
|
+
name: dm-types
|
|
83
|
+
prerelease: false
|
|
84
|
+
requirement: &id007 !ruby/object:Gem::Requirement
|
|
85
|
+
none: false
|
|
86
|
+
requirements:
|
|
87
|
+
- - ">="
|
|
88
|
+
- !ruby/object:Gem::Version
|
|
89
|
+
version: "0"
|
|
90
|
+
type: :runtime
|
|
91
|
+
version_requirements: *id007
|
|
92
|
+
- !ruby/object:Gem::Dependency
|
|
93
|
+
name: dm-constraints
|
|
94
|
+
prerelease: false
|
|
95
|
+
requirement: &id008 !ruby/object:Gem::Requirement
|
|
96
|
+
none: false
|
|
97
|
+
requirements:
|
|
98
|
+
- - ">="
|
|
99
|
+
- !ruby/object:Gem::Version
|
|
100
|
+
version: "0"
|
|
101
|
+
type: :runtime
|
|
102
|
+
version_requirements: *id008
|
|
103
|
+
- !ruby/object:Gem::Dependency
|
|
104
|
+
name: versionomy
|
|
105
|
+
prerelease: false
|
|
106
|
+
requirement: &id009 !ruby/object:Gem::Requirement
|
|
107
|
+
none: false
|
|
108
|
+
requirements:
|
|
109
|
+
- - ">="
|
|
110
|
+
- !ruby/object:Gem::Version
|
|
111
|
+
version: "0"
|
|
112
|
+
type: :runtime
|
|
113
|
+
version_requirements: *id009
|
|
114
|
+
- !ruby/object:Gem::Dependency
|
|
115
|
+
name: fffs
|
|
116
|
+
prerelease: false
|
|
117
|
+
requirement: &id010 !ruby/object:Gem::Requirement
|
|
118
|
+
none: false
|
|
119
|
+
requirements:
|
|
120
|
+
- - ">="
|
|
121
|
+
- !ruby/object:Gem::Version
|
|
122
|
+
version: "0"
|
|
123
|
+
type: :runtime
|
|
124
|
+
version_requirements: *id010
|
|
125
|
+
description: A really flexible package manager, inspired by portage and pacman.
|
|
126
|
+
email: meh@paranoici.org
|
|
127
|
+
executables:
|
|
128
|
+
- packo-profile
|
|
129
|
+
- packo-files
|
|
130
|
+
- packo-env
|
|
131
|
+
- packo-base
|
|
132
|
+
- packo
|
|
133
|
+
- packo-build
|
|
134
|
+
- packo-select
|
|
135
|
+
- packo-db
|
|
136
|
+
- packo-repository
|
|
137
|
+
extensions: []
|
|
138
|
+
|
|
139
|
+
extra_rdoc_files: []
|
|
140
|
+
|
|
141
|
+
files:
|
|
142
|
+
- lib/packo.rb
|
|
143
|
+
- lib/packo/rbuild/stages.rb
|
|
144
|
+
- lib/packo/rbuild/modules/packaging.rb
|
|
145
|
+
- lib/packo/rbuild/modules/misc/unpacking/lzma.rb
|
|
146
|
+
- lib/packo/rbuild/modules/misc/unpacking/zip.rb
|
|
147
|
+
- lib/packo/rbuild/modules/misc/unpacking/xz.rb
|
|
148
|
+
- lib/packo/rbuild/modules/misc/unpacking/tar.rb
|
|
149
|
+
- lib/packo/rbuild/modules/misc/fetcher.rb
|
|
150
|
+
- lib/packo/rbuild/modules/misc/fetching/gnu.rb
|
|
151
|
+
- lib/packo/rbuild/modules/misc/fetching/sourceforge.rb
|
|
152
|
+
- lib/packo/rbuild/modules/misc/fetching/subversion.rb
|
|
153
|
+
- lib/packo/rbuild/modules/misc/fetching/git.rb
|
|
154
|
+
- lib/packo/rbuild/modules/misc/fetching/github.rb
|
|
155
|
+
- lib/packo/rbuild/modules/misc/fetching/mercurial.rb
|
|
156
|
+
- lib/packo/rbuild/modules/misc/fetching/wget.rb
|
|
157
|
+
- lib/packo/rbuild/modules/misc/unpacker.rb
|
|
158
|
+
- lib/packo/rbuild/modules/misc/fetching.rb
|
|
159
|
+
- lib/packo/rbuild/modules/misc/unpacking.rb
|
|
160
|
+
- lib/packo/rbuild/modules/misc.rb
|
|
161
|
+
- lib/packo/rbuild/modules/packaging/pko.rb
|
|
162
|
+
- lib/packo/rbuild/modules/building.rb
|
|
163
|
+
- lib/packo/rbuild/modules/building/rake.rb
|
|
164
|
+
- lib/packo/rbuild/modules/building/patch.rb
|
|
165
|
+
- lib/packo/rbuild/modules/building/strip.rb
|
|
166
|
+
- lib/packo/rbuild/modules/building/cmake.rb
|
|
167
|
+
- lib/packo/rbuild/modules/building/autotools.rb
|
|
168
|
+
- lib/packo/rbuild/package.rb
|
|
169
|
+
- lib/packo/rbuild/package/manifest.rb
|
|
170
|
+
- lib/packo/rbuild/feature.rb
|
|
171
|
+
- lib/packo/rbuild/behaviors.rb
|
|
172
|
+
- lib/packo/rbuild/flavor.rb
|
|
173
|
+
- lib/packo/rbuild/behaviors/default.rb
|
|
174
|
+
- lib/packo/rbuild/features.rb
|
|
175
|
+
- lib/packo/rbuild/modules.rb
|
|
176
|
+
- lib/packo/rbuild/module.rb
|
|
177
|
+
- lib/packo/rbuild/stages/stage.rb
|
|
178
|
+
- lib/packo/rbuild/stages/callbacks.rb
|
|
179
|
+
- lib/packo/environment.rb
|
|
180
|
+
- lib/packo/do.rb
|
|
181
|
+
- lib/packo/system.rb
|
|
182
|
+
- lib/packo/rbuild.rb
|
|
183
|
+
- lib/packo/models/installed_package/dependency.rb
|
|
184
|
+
- lib/packo/models/installed_package/content.rb
|
|
185
|
+
- lib/packo/models/installed_package.rb
|
|
186
|
+
- lib/packo/models/tag.rb
|
|
187
|
+
- lib/packo/models/selector.rb
|
|
188
|
+
- lib/packo/models/repository.rb
|
|
189
|
+
- lib/packo/models/repository/package.rb
|
|
190
|
+
- lib/packo/models/repository/package/binary.rb
|
|
191
|
+
- lib/packo/models/repository/package/source/feature.rb
|
|
192
|
+
- lib/packo/models/repository/package/source/flavor.rb
|
|
193
|
+
- lib/packo/models/repository/package/source.rb
|
|
194
|
+
- lib/packo/models/repository/package/binary/build.rb
|
|
195
|
+
- lib/packo/models/repository/package/virtual.rb
|
|
196
|
+
- lib/packo/models/repository/binary.rb
|
|
197
|
+
- lib/packo/models/repository/source.rb
|
|
198
|
+
- lib/packo/models/repository/binary/mirror.rb
|
|
199
|
+
- lib/packo/models/repository/virtual.rb
|
|
200
|
+
- lib/packo/flags.rb
|
|
201
|
+
- lib/packo/extensions.rb
|
|
202
|
+
- lib/packo/version.rb
|
|
203
|
+
- lib/packo/cli.rb
|
|
204
|
+
- lib/packo/models.rb
|
|
205
|
+
- lib/packo/package.rb
|
|
206
|
+
- lib/packo/package/tags.rb
|
|
207
|
+
- lib/packo/package/dependency.rb
|
|
208
|
+
- lib/packo/package/tags/expression.rb
|
|
209
|
+
- lib/packo/package/tags/expression/logic.rb
|
|
210
|
+
- lib/packo/package/tags/expression/name.rb
|
|
211
|
+
- lib/packo/package/tags/expression/group.rb
|
|
212
|
+
- lib/packo/package/feature.rb
|
|
213
|
+
- lib/packo/package/flavor.rb
|
|
214
|
+
- lib/packo/package/dependencies.rb
|
|
215
|
+
- lib/packo/package/features.rb
|
|
216
|
+
- lib/packo/package/blocker.rb
|
|
217
|
+
- lib/packo/package/blockers.rb
|
|
218
|
+
- lib/packo/repository.rb
|
|
219
|
+
- lib/packo/cli/base.rb
|
|
220
|
+
- lib/packo/cli/environment.rb
|
|
221
|
+
- lib/packo/cli/select.rb
|
|
222
|
+
- lib/packo/cli/database/definition.rb
|
|
223
|
+
- lib/packo/cli/database/helpers.rb
|
|
224
|
+
- lib/packo/cli/database.rb
|
|
225
|
+
- lib/packo/cli/files.rb
|
|
226
|
+
- lib/packo/cli/repository.rb
|
|
227
|
+
- lib/packo/cli/build.rb
|
|
228
|
+
- lib/packo/cli/profile.rb
|
|
229
|
+
- lib/packo/cli/repository/binary.rb
|
|
230
|
+
- lib/packo/cli/repository/source.rb
|
|
231
|
+
- lib/packo/cli/repository/repository.rb
|
|
232
|
+
- lib/packo/cli/repository/helpers.rb
|
|
233
|
+
- lib/packo/cli/repository/virtual.rb
|
|
234
|
+
- lib/packo/profile.rb
|
|
235
|
+
- lib/packo/host.rb
|
|
236
|
+
- lib/packo/repository/binary.rb
|
|
237
|
+
- lib/packo/repository/source.rb
|
|
238
|
+
- lib/packo/repository/virtual.rb
|
|
239
|
+
- bin/packo-profile
|
|
240
|
+
- bin/packo-files
|
|
241
|
+
- bin/packo-env
|
|
242
|
+
- bin/packo-base
|
|
243
|
+
- bin/packo
|
|
244
|
+
- bin/packo-build
|
|
245
|
+
- bin/packo-select
|
|
246
|
+
- bin/packo-db
|
|
247
|
+
- bin/packo-repository
|
|
248
|
+
homepage: http://github.com/distro/packo
|
|
249
|
+
licenses: []
|
|
250
|
+
|
|
251
|
+
post_install_message:
|
|
252
|
+
rdoc_options: []
|
|
253
|
+
|
|
254
|
+
require_paths:
|
|
255
|
+
- lib
|
|
256
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
257
|
+
none: false
|
|
258
|
+
requirements:
|
|
259
|
+
- - ">="
|
|
260
|
+
- !ruby/object:Gem::Version
|
|
261
|
+
version: "0"
|
|
262
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
263
|
+
none: false
|
|
264
|
+
requirements:
|
|
265
|
+
- - ">"
|
|
266
|
+
- !ruby/object:Gem::Version
|
|
267
|
+
version: 1.3.1
|
|
268
|
+
requirements: []
|
|
269
|
+
|
|
270
|
+
rubyforge_project:
|
|
271
|
+
rubygems_version: 1.7.2
|
|
272
|
+
signing_key:
|
|
273
|
+
specification_version: 3
|
|
274
|
+
summary: The "pacco" package manager.
|
|
275
|
+
test_files: []
|
|
276
|
+
|