litbuild 1.0.11 → 1.0.14

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: 450a93fb7a60735ed6618b58aff828dd2c6a8846b7664e7916df70ca319f1f4c
4
- data.tar.gz: 0f7523cd36707b6748f868b6229d69413874503282511929891e1d4ea344d8df
3
+ metadata.gz: 3f420862b3a3dd758ef05aed2b717defe89a48a34944b25b3af4042a0d47a749
4
+ data.tar.gz: bfb4c6364c57b9b9220d0bd43113f4a8b2ff0639b106b675a9e8af3c85982eab
5
5
  SHA512:
6
- metadata.gz: '08ee5269104135777fb2dd06c225b03854b8b38c61723c0652b98aebc1fef19cad4ded3267249312e8821de764fab8360189216bf50e6b039f442a48cc9ed169'
7
- data.tar.gz: 4626ce942e4afd88bca32d3613488bd2ac509107c90f467ae0deb3f14c0086ff6fd401647a9173ab5906284a042422802c0dc0fb067e80645217cf70e98e4686
6
+ metadata.gz: 22838c4497fdb70a5140507dcc0a10f511f9751bd36197ec3dc88a8c5e7bc6fda27b8678bd34f46ea7d21b9f06c944e52b3bcd7ffee00713d9aa34a56d168387
7
+ data.tar.gz: 01f7b1eab7fe96e96fbd04dd446743259786bb54a8556f379627c13153c0e917ea6af368fdc4bb3c4f201666f32d78380a9c416ee238e3e39a4c07305b200edd
@@ -167,9 +167,14 @@ module Litbuild
167
167
  script.string
168
168
  end
169
169
 
170
+ # Timestamps are written with default format plus
171
+ # seconds-since-epoch (in parentheses), to make it as easy as
172
+ # possible to calculate how long things take.
173
+ DATECMD = "date '+%a %b %e %H:%M:%S %Z %Y (%s)'"
174
+
170
175
  def write_components(location:, script:)
171
176
  @written[location].map do |target|
172
- script.puts("echo \"At $(date): Beginning #{target}:\"")
177
+ script.puts("echo \"At $(#{DATECMD}): Beginning #{target}:\"")
173
178
  script.puts("./#{target}")
174
179
  end
175
180
  end
@@ -339,7 +344,7 @@ module Litbuild
339
344
  render_restart_header(script, restart_file, package.version, pkgusr_dir)
340
345
  pkgusr_srcdir = File.join(pkgusr_dir, package.name_and_version)
341
346
  render_add_package_user(package, script, log)
342
- @scm.copy_source_files_commands(package).each do |cp_command|
347
+ @scm.copy_files_commands(package).each do |cp_command|
343
348
  render_command(script, cp_command, log)
344
349
  end
345
350
  script.puts("export LB_SOURCE_DIR=#{quote(pkgusr_srcdir)}")
@@ -505,6 +510,7 @@ module Litbuild
505
510
  def render_service_pipeline(script, spipe)
506
511
  pname = spipe['name'].first
507
512
  spipe['bundle']&.each do |bundle|
513
+ script.puts("mkdir -p #{bundle}")
508
514
  script.puts("grep -q '^#{pname}$' #{bundle}/contents || " \
509
515
  "echo #{pname} >> #{bundle}/contents")
510
516
  end
@@ -131,11 +131,16 @@ module Litbuild
131
131
  end
132
132
 
133
133
  # otherwise, the default version goes right *before* the *first
134
- # directive of the next stage* (which will always be present).
134
+ # directive of the next stage* (which *should* always be present)...
135
135
  next_stage = STAGE_DIRECTIVES[STAGE_DIRECTIVES.index(stg) + 1]
136
136
  first_idx = grafs.index do |graf|
137
137
  graf.respond_to?(:key) && graf.key?(next_stage)
138
138
  end
139
+
140
+ # ...but if, for whatever reason, we haven't found a place to
141
+ # put the default directives, just put them at the beginning.
142
+ first_idx ||= 0
143
+
139
144
  grafs.insert(first_idx, stg => to_add[stg])
140
145
  end
141
146
  end
@@ -13,7 +13,8 @@ module Litbuild
13
13
  #
14
14
  # Note, SourceCodeManager does not recurse into additional levels of
15
15
  # subdirectories -- it turns out that makes the test suite really
16
- # slow.
16
+ # slow, and recursive search is not useful to me, so I'm just
17
+ # skipping it.
17
18
  class SourceCodeManager
18
19
  def initialize(*dirs)
19
20
  all_pkgfiles = dirs.map do |d|
@@ -55,13 +56,39 @@ module Litbuild
55
56
  end
56
57
 
57
58
  ##
58
- # Package Users expect to have tarfiles for the top-level package
59
- # and any in-tree packages in their `src` directory, and patches in
60
- # their `patches` directory. This produces commands that copy needed
61
- # files from the TARFILE_DIR and PATCH_DIR to those directories, if
62
- # not already present there.
63
- def copy_source_files_commands(package)
59
+ # Typically, Package Users expect to have tarfiles for the top-level
60
+ # package and any in-tree packages in their `src` directory, and
61
+ # patches in their `patches` directory. This method arranges things
62
+ # that way: it produces commands that copy all the necessary files
63
+ # from TARFILE_DIR and/or PATCH_DIR to the destination directory,
64
+ # skipping any that are already present where the Package Users
65
+ # build script expects to find them.
66
+ #
67
+ # Binary package files are an exception to the typical case. A
68
+ # binary package file has name `binary-#{packagename}.tar.lz` (no
69
+ # version number, and always lzip-compressed), and contains the
70
+ # files produced by the compilation and installation process. If
71
+ # such a file is present in the Package User home directory, the
72
+ # build script simply unpacks it and does nothing else.
73
+ #
74
+ # So: if a binary package file is present in the tarfile directory,
75
+ # this method simply emits a command to copy it to the Package User
76
+ # home directory; and if there is already a binary package file
77
+ # present in the Package User home directory, this method does
78
+ # nothing.
79
+ def copy_files_commands(package)
64
80
  pkgusr = pkgusr_name(package)
81
+
82
+ # copy binary file if available, then return
83
+ binfile = "binary-#{package.name}.tar.lz"
84
+ return ["cp #{find_file(binfile)} ~#{pkgusr}"] \
85
+ if @available_files.detect { |f| /#{binfile}/ =~ f }
86
+
87
+ # do nothing if binary file is present in home dir already
88
+ return [] if homedir(package) && File.exist?(
89
+ File.join(homedir(package), binfile)
90
+ )
91
+
65
92
  mkdir_commands = %w[src patches].map do |dir|
66
93
  "mkdir -p ~#{pkgusr}/#{dir}"
67
94
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Litbuild
4
- VERSION = '1.0.11'
4
+ VERSION = '1.0.14'
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.11
4
+ version: 1.0.14
5
5
  platform: ruby
6
6
  authors:
7
7
  - Brett Neumeier
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-19 00:00:00.000000000 Z
11
+ date: 2023-02-19 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:
@@ -63,7 +63,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
63
63
  - !ruby/object:Gem::Version
64
64
  version: '0'
65
65
  requirements: []
66
- rubygems_version: 3.2.3
66
+ rubygems_version: 3.4.7
67
67
  signing_key:
68
68
  specification_version: 4
69
69
  summary: A literate build system