tetra 0.42.0 → 0.43.0

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.
@@ -46,13 +46,13 @@ Requires: mvn(<%= dependency_id[0] %>:<%= dependency_id[1] %>) <% if depen
46
46
  %>
47
47
 
48
48
  %prep
49
- %setup -q -c -n src/<%= name %>
49
+ %setup -q -c -n src
50
50
  cp -f %{SOURCE1} .
51
- cp -Rf %{_datadir}/tetra ../../kit
51
+ cp -Rf %{_datadir}/tetra ../kit
52
52
 
53
53
  %build
54
- cd ../../
55
- sh src/<%= name %>/build.sh
54
+ cd ..
55
+ sh src/build.sh
56
56
 
57
57
  %install
58
58
  export NO_BRP_CHECK_BYTECODE_VERSION=true
data/lib/tetra/project.rb CHANGED
@@ -117,25 +117,24 @@ module Tetra
117
117
  def merge_new_content(new_content, path, snapshot_message, tag_prefix)
118
118
  from_directory do
119
119
  log.debug "merging new content to #{path} with prefix #{tag_prefix}"
120
- already_existing = File.exist? path
121
- previous_tag = latest_tag(tag_prefix)
120
+ already_existing = File.exist?(path)
122
121
 
123
122
  if already_existing
123
+ if latest_tag_count(tag_prefix) == 0
124
+ log.debug "saving untagged version"
125
+ @git.commit_file(path, snapshot_message, next_tag(tag_prefix))
126
+ end
124
127
  log.debug "moving #{path} to #{path}.tetra_user_edited"
125
128
  File.rename path, "#{path}.tetra_user_edited"
126
129
  end
127
130
 
131
+ previous_tag = latest_tag(tag_prefix)
132
+
128
133
  File.open(path, "w") { |io| io.write(new_content) }
129
134
  log.debug "taking snapshot with new content: #{snapshot_message}"
130
135
  @git.commit_file(path, snapshot_message, next_tag(tag_prefix))
131
136
 
132
137
  if already_existing
133
- if previous_tag == ""
134
- previous_tag = latest_tag(tag_prefix)
135
- log.debug "there was no tag with prefix #{tag_prefix} before snapshot"
136
- log.debug "defaulting to #{previous_tag} after snapshot"
137
- end
138
-
139
138
  # 3-way merge
140
139
  conflict_count = @git.merge_with_tag("#{path}", "#{path}.tetra_user_edited", previous_tag)
141
140
  File.delete "#{path}.tetra_user_edited"
@@ -25,6 +25,7 @@ module Tetra
25
25
 
26
26
  script_lines = [
27
27
  "#!/bin/bash",
28
+ "set -xe",
28
29
  "PROJECT_PREFIX=`readlink -e .`",
29
30
  "cd #{@project.latest_dry_run_directory}"
30
31
  ] +
@@ -44,10 +45,13 @@ module Tetra
44
45
  conflict_count = @project.merge_new_content(new_content, result_path, "Build script generated",
45
46
  "generate_build_script")
46
47
 
47
- destination_script_path = File.join("output", @project.name, "build.sh")
48
+ output_dir = File.join("output", @project.name)
49
+ FileUtils.mkdir_p(output_dir)
50
+
51
+ destination_script_path = File.join(output_dir, "build.sh")
48
52
  FileUtils.symlink(File.expand_path(result_path), destination_script_path, force: true)
49
53
 
50
- [result_path, conflict_count]
54
+ [destination_script_path, conflict_count]
51
55
  end
52
56
  end
53
57
  end
@@ -18,8 +18,9 @@ module Tetra
18
18
  spec_path = File.join(spec_dir, spec_name)
19
19
 
20
20
  new_content = generate(template_spec_name, binding)
21
+ label = "Spec for #{package_name} generated"
21
22
  conflict_count = project.merge_new_content(new_content, spec_path,
22
- "Spec generated", "generate_#{package_name}_spec")
23
+ label, "generate_#{package_name}_spec")
23
24
 
24
25
  output_dir = File.join("output", package_name)
25
26
  FileUtils.mkdir_p(output_dir)
@@ -27,7 +28,7 @@ module Tetra
27
28
  spec_link_path = File.join(output_dir, spec_name)
28
29
  FileUtils.symlink(File.expand_path(spec_path), spec_link_path, force: true)
29
30
 
30
- [spec_path, conflict_count]
31
+ [spec_link_path, conflict_count]
31
32
  end
32
33
  end
33
34
 
data/lib/tetra/version.rb CHANGED
@@ -2,5 +2,5 @@
2
2
 
3
3
  # base module for tetra
4
4
  module Tetra
5
- VERSION = "0.42.0"
5
+ VERSION = "0.43.0"
6
6
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tetra
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.42.0
4
+ version: 0.43.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: