litbuild 1.0.16 → 1.0.21

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: c8e6cf1338409a6f92412c572ddca22dfea69dec035c023ec029aa73b56f833f
4
- data.tar.gz: 9fe0eb1366a7404cfe258081c3ef4f3f96e5214cba7f6d428dceac520d35da0f
3
+ metadata.gz: 22c6c387b304ec0c1abb563a8cb3f5a8812a52433c82a2cc9c4322e202b6ea65
4
+ data.tar.gz: e590d33d71e4c70a7a4411f67b11d17fb46f8c4846b6c1ac4fdae91dfc9205e5
5
5
  SHA512:
6
- metadata.gz: 6f79a4716874345084ec1ac7fe7c41049cd09db46d46e7349125767a9598b7a079314dac3630fcc221c0365a0a6bdb033bede9a1c41ce772b5740e01c15b3a53
7
- data.tar.gz: e4db23446ce1334ec23ad2e1b566195ca0eb3515cbf7876089498f144af5e9e92302b87ec8ad9c6495c61935d4dfc90b5803acb979b603cddbbefcc8890e4054
6
+ metadata.gz: 3fd317ab3c29b1b37ddac395ba27ab95d304c4b052c80bebab9250acb60b11946e51f432fdc39c761a392a0d96714a21981c5adfbd726c0654d30b520ad33eb5
7
+ data.tar.gz: 37e5f89cce214d9a2fcd4ce4ce44b00aa44d5da9cfc6ce564f7a142c9b2c8bdde1eeeb822b2e125e3a3b450bb78db61017f9eaa94b400baa0668699be29dba8a
@@ -103,21 +103,63 @@ module Litbuild
103
103
 
104
104
  script_name = File.join(script_dir, "#{target}.sh")
105
105
  File.open(script_name, 'w') do |f|
106
- f.puts("#!#{find_bash}/bash")
107
- skip_line(f)
108
- f.puts("trap 'echo UTTER FAILURE on line $LINENO' ERR")
109
- f.puts('set -e -v')
110
- f.puts('cd $(dirname $0)')
111
- skip_line(f)
106
+ write_toplevel_intro(f)
112
107
  write_components(location: script_dir, script: f)
113
- f.puts('set +v')
114
- f.puts('echo TOTAL SUCCESS')
108
+ write_toplevel_outro(f, target)
115
109
  end
116
110
  FileUtils.chmod('ugo+x', script_name)
117
111
  end
118
112
 
119
113
  private
120
114
 
115
+ def write_toplevel_intro(file)
116
+ file.puts("#!#{find_bash}/bash")
117
+ skip_line(file)
118
+ file.puts("trap 'echo UTTER FAILURE on line $LINENO' ERR")
119
+ file.puts('set -e -v')
120
+ file.puts('cd $(dirname $0)')
121
+ skip_line(file)
122
+ file.puts('if [ -n "$LITBUILDDBDIR" ]')
123
+ file.puts('then')
124
+ file.puts(' if [ -d "${LITBUILDDBDIR}" -a -w "${LITBUILDDBDIR}" ]')
125
+ file.puts(' then')
126
+ file.puts(' mkdir -p "${LITBUILDDBDIR}/BUILD-LOG"')
127
+ file.puts(' fi')
128
+ file.puts('fi')
129
+ skip_line(file)
130
+ file.puts("begin_time=$(date '+%a %b %e %H:%M:%S %Z %Y (%s)')")
131
+ file.puts('begin_seconds=$(date +%s)')
132
+ skip_line(file)
133
+ end
134
+
135
+ def write_toplevel_outro(file, target)
136
+ skip_line(file)
137
+ file.puts("complete_time=$(date '+%a %b %e %H:%M:%S %Z %Y (%s)')")
138
+ file.puts('complete_seconds=$(date +%s)')
139
+ file.puts('elapsed_time=$((complete_seconds - begin_seconds))')
140
+ skip_line(file)
141
+ bldir = '"${LITBUILDDBDIR}/BUILD-LOG"'
142
+ file.puts("if [ -d #{bldir} -a -w #{bldir} ]")
143
+ file.puts('then')
144
+ file.puts(' lbfile="${LITBUILDDBDIR}/BUILD-LOG/$(date +%s)"')
145
+ file.puts(" echo 'Blueprint: #{target}' > $lbfile")
146
+ file.puts(' echo "Started: $begin_time" >> $lbfile')
147
+ file.puts(' echo "Completed: $complete_time" >> $lbfile')
148
+ file.puts(' echo "Elapsed: $elapsed_time" >> $lbfile')
149
+ write_toplevel_parameters(file)
150
+ file.puts('fi')
151
+ skip_line(file)
152
+ file.puts('set +v')
153
+ file.puts('echo TOTAL SUCCESS')
154
+ end
155
+
156
+ def write_toplevel_parameters(file)
157
+ file.puts(' echo "Parameters:" >> $lbfile')
158
+ @parameters.keys.sort.each do |k|
159
+ file.puts(" echo ' #{k}: #{ENV[k]}' >> $lbfile") if ENV.key?(k)
160
+ end
161
+ end
162
+
121
163
  def write(blueprint:, location:, &block)
122
164
  return if @all_written_targets.include?(blueprint.target_name)
123
165
 
@@ -176,6 +218,7 @@ module Litbuild
176
218
  @written[location].map do |target|
177
219
  script.puts("echo \"At $(#{DATECMD}): Beginning #{target}:\"")
178
220
  script.puts("./#{target}")
221
+ script.puts("echo \"At $(#{DATECMD}): Completed #{target}:\"")
179
222
  end
180
223
  end
181
224
 
@@ -390,6 +433,8 @@ module Litbuild
390
433
  options.puts("cat > ~#{package.pkgusr_name}/options <<'LBEOF'")
391
434
  options.puts("export version=#{package.version}")
392
435
  options.puts("export LB_SOURCE_DIR=#{quote(srcdir)}")
436
+ phase = package.active_phase || 'default'
437
+ options.puts("export LB_PHASE=#{quote(phase)}")
393
438
  environment_commands(package).each { |cmd| options.puts(cmd) }
394
439
  package.build_dir && options.puts("export build_dir=#{package.build_dir}")
395
440
  render_intree_commands(package, options)
@@ -580,7 +625,7 @@ module Litbuild
580
625
  end
581
626
  render_command(script, 'cfggit stageall', log)
582
627
  bp = "#{blueprint.class.name.split('::').last} #{blueprint.name}"
583
- cmd = "cfggit as-default -m 'Configuration files for #{bp}'"
628
+ cmd = "cfggit as-lb -m 'Configuration files for #{bp}'"
584
629
  render_command(script, cmd, log)
585
630
  end
586
631
 
@@ -51,7 +51,7 @@ module Litbuild
51
51
 
52
52
  package.patch_files.map do |patch_file|
53
53
  full_fn = find_file(patch_file)
54
- "#{decompress_command(full_fn)} < #{full_fn} | patch -p1"
54
+ "#{decompress_command(full_fn)} < #{full_fn} | git apply"
55
55
  end
56
56
  end
57
57
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Litbuild
4
- VERSION = '1.0.16'
4
+ VERSION = '1.0.21'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: litbuild
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.16
4
+ version: 1.0.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Neumeier
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-11-18 00:00:00.000000000 Z
11
+ date: 2024-08-16 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A build system based on Knuth's idea of literate programming.
14
14
  email:
@@ -45,10 +45,10 @@ files:
45
45
  - lib/litbuild/visitor.rb
46
46
  homepage: http://git.freesa.org/freesa/litbuild
47
47
  licenses:
48
- - GPL-3.0
48
+ - GPL-3.0-only
49
49
  metadata:
50
50
  rubygems_mfa_required: 'true'
51
- post_install_message:
51
+ post_install_message:
52
52
  rdoc_options: []
53
53
  require_paths:
54
54
  - lib
@@ -63,8 +63,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  requirements: []
66
- rubygems_version: 3.4.22
67
- signing_key:
66
+ rubygems_version: 3.5.17
67
+ signing_key:
68
68
  specification_version: 4
69
69
  summary: A literate build system
70
70
  test_files: []