ian 0.5.1 → 0.5.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f1c4418c802dc0e70d42aa29660d7cc5b86f9aa
4
- data.tar.gz: 3d4ad360116e4f78a37256f6e71f6cea3deec032
3
+ metadata.gz: eef0a9d2b8f8eb7b3d6191ef394330eb726e3f47
4
+ data.tar.gz: 5af7d2748dc79cc958d96d2cd326030b198a9759
5
5
  SHA512:
6
- metadata.gz: 50103f0480fcf428bdaadc62d82e834b7d7d591f9b17b1ecaf71ef51fbe4f04c605f3bff7881b8d91b1271b6248d27fc99b7e7a454e781c4a5759ac75953b2c9
7
- data.tar.gz: 1fe06058c8ceebc0b0f1013376227ba8caa989f801a8bd2d72418038ab9d1e5ea94e1a7dfd8eeb2dadc660263eed77cf26399a5aa58a24f5a803573d7d926908
6
+ metadata.gz: 40e6d5176b2ba6e214718ed21e8f600b29d462868b6cee58389a87108822c167d30764a663c9eed54183eaf5b8cbb9a675abe4216490c437081c99dcc3a88b85
7
+ data.tar.gz: 094b451d2f8bb9f5ef2999df088bae4636ef85d03f8ed0127b85dd0a58e6a986a976d2f6d9e37201725a681b30f118c07491db7c41a277a41d96ceac60d9d1f2
data/README.md CHANGED
@@ -9,6 +9,12 @@ bundler.
9
9
  It is intended to be helpful when integrating other build tools/systems and
10
10
  with CI/CD.
11
11
 
12
+ ## Requirements
13
+
14
+ * dpkg
15
+ * fakeroot
16
+ * rsync
17
+
12
18
  ## Installation
13
19
 
14
20
  Add this line to your application's Gemfile:
@@ -122,6 +128,7 @@ Need help with the control files? Try these links:
122
128
  - [ ] add commands to help with releasing new versions/tagging
123
129
  - [ ] allow packaging past versions from git tags
124
130
  - [ ] add option for semver enforcement
131
+ - [ ] remove rsync dependency
125
132
 
126
133
  ## Development
127
134
 
data/lib/ian.rb CHANGED
@@ -68,7 +68,7 @@ module Ian
68
68
  def build_package(path, log)
69
69
  c = control(path)
70
70
  c[:size] = Utils.determine_installed_size(path)
71
- Ian::Control.save(c, path)
71
+ Ian::Control.save(c, ctrlpath(path))
72
72
 
73
73
  pkgr = Ian::Packager.new(path, c, log)
74
74
  pkgr.run
data/lib/ian/control.rb CHANGED
@@ -71,7 +71,7 @@ module Ian
71
71
  # raises Ian::ValidationError
72
72
  def self.save(ctrl, path)
73
73
  ctrl.valid!
74
- File.write(File.join(path, 'control'), ctrl.to_s)
74
+ File.write(path, ctrl.to_s)
75
75
  end
76
76
 
77
77
  # default values for a new control file
data/lib/ian/packager.rb CHANGED
@@ -4,9 +4,10 @@ require 'fileutils'
4
4
  module Ian
5
5
  class Packager
6
6
  def initialize(path, ctrl, log)
7
- @path = path
7
+ @path = path # this is the source path that the files to package are copied from
8
8
  @ctrl = ctrl
9
- @log = log
9
+ @log = log
10
+ @dir = nil # this is the tmp directory that the package is built from
10
11
  end
11
12
 
12
13
  # run the packager
@@ -44,8 +45,8 @@ module Ian
44
45
  # move extraneous stuff like README and CHANGELOG to /usr/share/doc
45
46
  def move_root_files
46
47
  docs = "#{@dir}/usr/share/docs/#{pkgname}"
47
- files = %x[find #{@dir} -type f -maxdepth 1].lines.map {|l| l.chomp}
48
- raise RuntimeError, "Unable to copy root files" unless $?.success?
48
+ files = Dir.entries(@dir).select {|f| !File.directory?(f) }
49
+ return unless files.any?
49
50
 
50
51
  FileUtils.mkdir_p(docs)
51
52
 
@@ -66,7 +67,7 @@ module Ian
66
67
  FileUtils.chmod(0755, Ian.debpath(@dir))
67
68
 
68
69
  pkg = File.join(pkgdir, "#{pkgname}.deb")
69
- output = %x[dpkg-deb -b #{@dir} #{pkg}]
70
+ output = %x[fakeroot dpkg-deb -b #{@dir} #{pkg}]
70
71
 
71
72
  return [$?.success?, pkg, output]
72
73
  end
@@ -96,19 +97,18 @@ module Ian
96
97
  end
97
98
 
98
99
  def excludes
99
- files = %w[.git .gitignore .ianignore]
100
+ files = %w[.git .gitignore .ianignore]
101
+ ignorefile = File.join(@path, ".ianignore")
100
102
 
101
- return files unless File.exist?(".ianignore")
102
- File.read(File.join(@path, ".ianignore")).lines.each do |ign|
103
- next if ign.start_with? "#"
104
-
105
- ign.chomp!
106
- igns = Dir["#{@path}/#{ign}"]
107
- next if igns.empty?
103
+ return files unless File.exist?(ignorefile)
108
104
 
109
- files+= igns
105
+ File.read(ignorefile).lines.each do |ign|
106
+ next if ign.start_with? "#"
107
+ files << ign.chomp
110
108
  end
111
109
 
110
+ files.each {|f| @log.debug "Ignoring file: %s" % f }
111
+
112
112
  files
113
113
  end
114
114
 
data/lib/ian/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ian
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.1
4
+ version: 0.5.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert McLeod