ian 0.5.3 → 0.6.0

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: de4bcf5f0a0b4142e5c0bf55307ab8775c07aca2
4
- data.tar.gz: 1db02e646ad6b8a337bad3d4afd111ea9827705c
3
+ metadata.gz: f6532da46f52c70d5a917e8e9692e850301accee
4
+ data.tar.gz: c443a6e802103e07bb71fd94b1836cc78147ad3f
5
5
  SHA512:
6
- metadata.gz: 79051668953ad9be1db7102d1b45c65f9842140ac90998d83698e6deab7081dbbfc156a51a4ca3f1fe1adeafe7066173b9dcbaada253133d87e31355e89f8db0
7
- data.tar.gz: 0b4f52a7c647e86a530e73beaa3f611a8a319419b58c4b1b2533b980764a2a11d5028f52d90dd0dfa38278238a466778e99f318e6de451a28cd35a0b51c1924f
6
+ metadata.gz: f51e2f383da45c71eff99c4bfb3d517a985677f12d850162690e9b6228e8d0e118cdd076c95c2c83e454fbc21fa58c501935b08c78ce7d2f4cac484da02a3e06
7
+ data.tar.gz: 87fa0d84ec6a91aff53c5f6f2562c4cc25c12c7a31c7811058af8de729df6290b1ae37f246328fc3e1ce2e85117e3d03e146779447834dd054db93a783dc26ea
data/README.md CHANGED
@@ -105,6 +105,17 @@ version (prepending it with a `v`) and then builds the package as above.
105
105
  This does the same as before, however first it will take the version number in
106
106
  the argument, write it to the control file and commit the control file.
107
107
 
108
+ **Push a package**
109
+
110
+ Push a package to remote repo by adding a file called `.ianpush` in the repo root
111
+ containing a command to run to push the file up. E.G:
112
+
113
+ package_cloud push my/repo/debian/jessie
114
+
115
+ Then when you run `ian push` it will run that command and tack the package for
116
+ the current version on the end, warning you if you didn't run `ian pkg` yet. You
117
+ can also give the package name as an argument like `ian push pkg/the-pkg_0.0.1_all.deb`.
118
+
108
119
  **Show versions**:
109
120
 
110
121
  Show the versions by using this command:
@@ -129,6 +140,7 @@ Need help with the control files? Try these links:
129
140
  - [ ] allow packaging past versions from git tags
130
141
  - [ ] add option for semver enforcement
131
142
  - [ ] remove rsync dependency
143
+ - [ ] add PUSH command to a server via rsync (lol)
132
144
 
133
145
  ## Development
134
146
 
data/bin/ian CHANGED
@@ -64,6 +64,32 @@ Slop.parse help: true do
64
64
  end
65
65
  end
66
66
 
67
+ command :push do
68
+ description "Push the latest debian package up"
69
+
70
+ run do |opts, args|
71
+ check_initialized!
72
+ if !File.exist? ".ianpush"
73
+ puts "You need to specify a command to run in a file called .ianpush"
74
+ exit 1
75
+ end
76
+
77
+ cmd = File.read(File.join(IAN_DIR, ".ianpush")).chomp
78
+ c = Ian.control(IAN_DIR)
79
+
80
+ if args.first
81
+ cmd += " "+args.first
82
+ else
83
+ fn = c.pkgname+".deb"
84
+ path = File.join(IAN_DIR, "pkg", fn)
85
+ abort "Package not yet built: #{fn}" unless File.exist?(path)
86
+ cmd += " "+ path
87
+ end
88
+
89
+ system cmd
90
+ end
91
+ end
92
+
67
93
  command :set do
68
94
  description "Modify the Debian control file"
69
95
 
@@ -110,7 +136,7 @@ Slop.parse help: true do
110
136
  command :deps do
111
137
  description "Print dependencies for this package"
112
138
 
113
- run do |opts, args|
139
+ run do |opts, args|
114
140
  check_initialized!
115
141
 
116
142
  ctrl = Ian.control(IAN_DIR)
@@ -140,18 +166,19 @@ Slop.parse help: true do
140
166
  check_initialized!
141
167
 
142
168
  ctrl = Ian.control(IAN_DIR)
169
+ ctrlpath = Ian.ctrlpath(IAN_DIR)
143
170
  version = ctrl[:version]
144
171
 
145
172
  if args.any?
146
173
  version = args.first
147
- version.gsub!(/^v/, '')
174
+ version = version.gsub(/^v/, '')
148
175
  log.info "Releasing v#{version}"
149
176
  log.info "Updating control file"
150
177
  ctrl[:version] = version
151
- ctrl.save
178
+ Ian::Control.save(ctrl, ctrlpath)
152
179
 
153
180
  log.info "Committing control file"
154
- system "git add #{ctrl.path}"
181
+ system "git add #{ctrlpath}"
155
182
  system "git commit -m 'releasing v#{version}'"
156
183
 
157
184
  end
data/lib/ian.rb CHANGED
@@ -52,7 +52,7 @@ module Ian
52
52
  #File.write("#{path}/ian.yml", cfg.to_yaml)
53
53
  #log.info "Generated ian.yml"
54
54
 
55
- File.write("#{path}/.ianignore", "pkg\n")
55
+ File.write("#{path}/.ianignore", "pkg\n.ianpush\n")
56
56
  log.info "Generated .ianignore"
57
57
  end
58
58
 
data/lib/ian/control.rb CHANGED
@@ -19,6 +19,16 @@ module Ian
19
19
  @fields[field]
20
20
  end
21
21
 
22
+ def pkgname
23
+ parts = [
24
+ @fields[:package],
25
+ @fields[:version],
26
+ @fields[:arch]
27
+ ]
28
+
29
+ "%s_%s_%s" % parts
30
+ end
31
+
22
32
  # deletes a field from the hash
23
33
  def delete(field)
24
34
  field.to_sym if field.is_a? String
data/lib/ian/packager.rb CHANGED
@@ -77,13 +77,7 @@ module Ian
77
77
  private
78
78
 
79
79
  def pkgname
80
- parts = [
81
- @ctrl[:package],
82
- @ctrl[:version],
83
- @ctrl[:arch]
84
- ]
85
-
86
- "%s_%s_%s" % parts
80
+ @ctrl.pkgname
87
81
  end
88
82
 
89
83
  # generate the rsync command
data/lib/ian/utils.rb CHANGED
@@ -3,7 +3,7 @@ module Ian
3
3
  extend self
4
4
 
5
5
  def determine_installed_size(path)
6
- %x[du #{path} -ks --exclude=".git"].split.first
6
+ %x[du #{path} -ks --exclude=".git" --exclude="pkg"].split.first
7
7
  end
8
8
 
9
9
  # try to guess the maintainer by reading the git config file
data/lib/ian/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module Ian
2
- VERSION = "0.5.3"
2
+ VERSION = "0.6.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ian
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.5.3
4
+ version: 0.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Robert McLeod
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-10 00:00:00.000000000 Z
11
+ date: 2017-03-31 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: slop