Skip to content

Commit 5d37479

Browse files
authored
Merge pull request #4460 from mwichmann/maint/sconsign
Maint: remove dead code from sconsign
2 parents 2b73157 + b3a39a3 commit 5d37479

File tree

3 files changed

+51
-66
lines changed

3 files changed

+51
-66
lines changed

CHANGES.txt

+1
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
7272
From Mats Wichmann:
7373
- Add support for Python 3.13 (as of alpha 2). So far only affects
7474
expected bytecodes in ActionTests.py.
75+
- sconsign cleanup - remove some dead code, minor manpage tweaks.
7576
- Be more cautious about encodings fetching command output on Windows.
7677
Problem occurs in piped-spawn scenario, used by Configure tests.
7778
Fixes #3529.

SCons/Utilities/sconsign.py

-22
Original file line numberDiff line numberDiff line change
@@ -51,24 +51,6 @@ def my_whichdb(filename):
5151
return whichdb(filename)
5252

5353

54-
def my_import(mname):
55-
"""Import database module.
56-
57-
This was used if the module was *not* SCons.dblite, to allow
58-
for programmatic importing. It is no longer used, in favor of
59-
importlib.import_module, and will be removed eventually.
60-
"""
61-
import imp
62-
63-
if '.' in mname:
64-
i = mname.rfind('.')
65-
parent = my_import(mname[:i])
66-
fp, pathname, description = imp.find_module(mname[i+1:], parent.__path__)
67-
else:
68-
fp, pathname, description = imp.find_module(mname)
69-
return imp.load_module(mname, fp, pathname, description)
70-
71-
7254
class Flagger:
7355
default_value = 1
7456

@@ -449,8 +431,6 @@ def main() -> None:
449431

450432
dbm = SCons.dblite
451433
# Ensure that we don't ignore corrupt DB files,
452-
# this was handled by calling my_import('SCons.dblite')
453-
# again in earlier versions...
454434
SCons.dblite.IGNORE_CORRUPT_DBFILES = False
455435
except ImportError:
456436
sys.stderr.write("sconsign: illegal file format `%s'\n" % a)
@@ -492,8 +472,6 @@ def main() -> None:
492472

493473
dbm = SCons.dblite
494474
# Ensure that we don't ignore corrupt DB files,
495-
# this was handled by calling my_import('SCons.dblite')
496-
# again in earlier versions...
497475
SCons.dblite.IGNORE_CORRUPT_DBFILES = False
498476
Do_SConsignDB(Map_Module.get(dbm_name, dbm_name), dbm)(a)
499477
else:

doc/man/sconsign.xml

+50-44
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,17 @@
11
<?xml version="1.0" encoding="UTF-8"?>
2-
<!--
3-
4-
__COPYRIGHT__
5-
6-
Permission is hereby granted, free of charge, to any person obtaining
7-
a copy of this software and associated documentation files (the
8-
"Software"), to deal in the Software without restriction, including
9-
without limitation the rights to use, copy, modify, merge, publish,
10-
distribute, sublicense, and/or sell copies of the Software, and to
11-
permit persons to whom the Software is furnished to do so, subject to
12-
the following conditions:
13-
14-
The above copyright notice and this permission notice shall be included
15-
in all copies or substantial portions of the Software.
16-
17-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY
18-
KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE
19-
WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
20-
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
21-
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
22-
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
23-
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
242

3+
<!--
4+
SPDX-FileCopyrightText: Copyright The SCons Foundation (https://scons.org)
5+
SPDX-License-Identifier: MIT
256
-->
267

8+
<!DOCTYPE reference [
9+
<!ENTITY % version SYSTEM "../version.xml">
10+
%version;
11+
<!ENTITY % scons SYSTEM '../scons.mod'>
12+
%scons;
13+
]>
14+
2715
<refentry id='sconsign1'
2816
xmlns="http://www.scons.org/dbxsd/v1.0"
2917
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
@@ -48,12 +36,16 @@
4836
</refsynopsisdiv>
4937

5038

51-
<refsect1 id='description'><title>DESCRIPTION</title>
39+
<refsect1 id='description'>
40+
<title>DESCRIPTION</title>
5241
<para>
5342
Displays the contents of one or more
54-
<firstterm>sconsign files</firstterm>,
55-
the signature database files
56-
used by the <application>SCons</application> build tool.
43+
<firstterm>sconsign</firstterm> files,
44+
the signature/dependency database
45+
used by the &SCons; build tool.
46+
The database contains all Nodes that are known to the build,
47+
either by declaration in the build configuration,
48+
produced as side effects, or detected by inspection.
5749
</para>
5850

5951
<para>By default,
@@ -64,26 +56,40 @@ Without options,
6456
individual dependency entries are printed in the following format:</para>
6557

6658
<screen>
67-
depfile: signature timestamp length
68-
implicit_dependency_1: content_signature timestamp length
69-
implicit_dependency_2: content_signature timestamp length
59+
depfile: content-signature timestamp length
60+
implicit-dependency-1: content-signature timestamp length
61+
implicit-dependency-2: content-signature timestamp length
7062
...
71-
action_signature [action string]
63+
build-signature [action-string]
7264
</screen>
7365

74-
<para><emphasis role="bold">None</emphasis>
66+
<para>
67+
<emphasis role="bold">content-signature</emphasis>
68+
is the hash of the file's contents (<firstterm>csig</firstterm>)
69+
and <emphasis role="bold">build-signature</emphasis>
70+
is the hash of the command line or other build action
71+
used to build a target (<firstterm>bactsig</firstterm>).
72+
If provided,
73+
<emphasis role="bold">action-string</emphasis>
74+
is the unexpanded string action or the function called.
75+
<emphasis role="bold">None</emphasis>
7576
is printed in place of any missing timestamp,
76-
<firstterm>content signature</firstterm>
77-
(<emphasis role="bold">csig</emphasis>)
78-
or
79-
<firstterm>build action signature</firstterm>
80-
values for any entry
81-
or any of its dependencies.
77+
<emphasis role="bold">csig</emphasis>,
78+
or <emphasis role="bold">bactsig</emphasis>
79+
values for any entry or any of its dependencies.
8280
If the entry has no implicit dependencies,
8381
or no build action,
84-
those lines are omitted.</para>
82+
the corresponding lines are omitted.
83+
</para>
8584

86-
<para>By default,
85+
<para>
86+
An indicator line is printed for each directory,
87+
as directories do not have signatures in the database
88+
and so would not otherwise be shown.
89+
</para>
90+
91+
<para>
92+
By default,
8793
<command>sconsign</command>
8894
assumes that any
8995
<replaceable>file</replaceable>
@@ -92,14 +98,13 @@ arguments that end with a
9298
suffix contains
9399
signature entries for
94100
more than one directory
95-
(that is,
96-
was specified by the
101+
(that is, was specified by the
97102
<function>SConsignFile</function>
98-
function).
103+
&SCons; function).
99104
Any
100105
<replaceable>file</replaceable>
101106
argument that has no suffix
102-
is assumed to be an old-style
107+
is assumed to be an old-style (deprecated)
103108
sconsign file containing the signature entries
104109
for a single directory.
105110
If neither of those is true,
@@ -299,7 +304,8 @@ for all entries or the specified entries.</para>
299304
<refsect1 id='see_also'>
300305
<title>SEE ALSO</title>
301306
<para>
302-
<command>scons</command>,
307+
The &SCons; reference (manpage) at
308+
<ulink url="https://scons.org/doc/production/HTML/scons-man.html"/>,
303309
the SCons User Guide at
304310
<ulink url="https://scons.org/doc/production/HTML/scons-user.html"/>,
305311
the SCons source code

0 commit comments

Comments
 (0)