Lady [Sat, 25 Jan 2025 19:39:04 +0000 (14:39 -0500)]
Add FINDFILTER⸺ variables
There are two possible approaches to how these variables could work :—
- By filtering _during_ the `find` (i·e using `-exec`), or
- By filtering _after_ the `find`.
The latter generally seems more efficient and the former doesn’t seem
to offer any benefits, so that is the approach taken here. Filters are
separated by semicolons, which are otherwise forbidden in file·names,
so it shouldn’t be a problem that the regular expressions won’t be able
to contain literal semicolons themselves.
The hope is that these variables provide a much cleaner solution to
`EXTRAFINDRULES` and `EXTRAFINDINCLUDERULES` hackery. Those are still
needed (for now) to manage two‐stage builds, but they’re cumbersome and
probably aren’t ideal in most cases.
Lady [Sat, 25 Jan 2025 03:00:06 +0000 (22:00 -0500)]
Reduce @书社:archived-as noise
This commit causes `@书社:archived-as` to be dropped in the following
cases :—
- In the components of archives, during extraction.
- In wrapped nodes, where it is raised to the wrapping `<html:html>`
element.
It also makes `lib/archive2extractor.xslt` a prerequisite for the
finalization step and `lib/catalog2transform.xslt` a prerequisite for
results, to ensure that files are appropriately updated when these
change.
Lady [Sat, 25 Jan 2025 02:32:09 +0000 (21:32 -0500)]
Fix prerequisite handling when there are none
In a directory with no sources, there won’t be any metadata, and so
the `$(and …)` in `$(diffprereqs)` would exit early, before creating
the file in `$(BUILDDIR)/lastprereqs`. However, this latter file is
still returned as a prerequisite. This commit touches it if it doesn’t
exist to ensure it is always created.
Lady [Sat, 25 Jan 2025 02:16:09 +0000 (21:16 -0500)]
Enable multiple DATADIR
⛩📰 书社 requires that `$(DATADIR)` point to at least one real
directory before entering two‐step mode, but it failed to correctly
handle this check in the case where there were multiple `$(DATADIR)`
supplied.
Lady [Sun, 15 Dec 2024 01:01:43 +0000 (20:01 -0500)]
Don’t use literal result elements in transforms
See also the prior work to do this with parsers.
Lady [Sun, 15 Dec 2024 00:48:17 +0000 (19:48 -0500)]
Support expanded archives in multi‐step data
When attempting to delete outdated files, if there is an exact match
for a line in `build/data.out`, prevent checking for nested files.
Previously, these lines would match, but `find` would keep descending
into them, so the directories would not be deleted but all files inside
would be.
Lady [Sun, 15 Dec 2024 00:31:21 +0000 (19:31 -0500)]
Fix time·zone handling
The variable `UTC0` was mistakenly exported, instead of `TZ` (which has
the _value_ `UTC0` and controls the time·zone of Posix commands).
Lady [Tue, 26 Nov 2024 04:16:36 +0000 (23:16 -0500)]
Don’t use literal result elements in parsers
Literal result elements inherit name·spaces from their surrounding
context. Using `<xslt:element>` elements avoids this trouble (and also
allows for the removal of name·space prefixes, reducing sizes of
results).
Lady [Sun, 27 Oct 2024 20:20:55 +0000 (16:20 -0400)]
Delete installed directories during uninstall
Expanded archives produce directories, so this needs to be a recursive
`rm`.
Lady [Sun, 27 Oct 2024 19:28:09 +0000 (15:28 -0400)]
Move parse/magic building into different stage
There is a lot of calculation which goes into every “default” run
(every source file must be found and characterized every time), which
results in a lot of file·system reads. This is unnecessary, and
needlessly slow for large numbers of files, on the first run (building
the magic and parsers). This commit moves parser‐building into a new
“initial” mode which then calls into a submake for the actual build,
negating the need for the first restart, simplyfying various aspects of
the code, and generally making things quite a bit more efficient.
The existing “_2stage” mode is combined with the new “initial” mode, as
their functionalities largely overlap.
Lady [Sat, 26 Oct 2024 21:17:56 +0000 (17:17 -0400)]
Don’t recompile without transform/dependency change
Because any change to a file updates its metadata, and metadata is
a dependency of the main transform, changing any file used to require
recompiling all of them. This is needlessly expensive: Files should
only be recompiled for changes to files they actually depend on. (Of
course, files might have an undeclared dependency, but relying on this
is at user’s own risk.)
This commit changes compiled files to depend only on the transform
catalog, not the transform itself, and only the metadata of files they
depend on (which presumably will always be updated alongside the
files). The main transform itself is now a make·file prerequisite,
mirroring the main parser, to ensure it is always current even tho no
compilation properly depends on it anymore.
Lady [Sat, 26 Oct 2024 20:45:08 +0000 (16:45 -0400)]
Use <书社:apply-attributes-to-root> to add version
Now that application happens after every stage, it is simple enough to
just inject an `<书社:apply-attributes-to-root>` into the result
fragment prior to application, rather than supporting an entirely
separate `and-version` param (which may not have been properly applied
in recent commits).
Lady [Sat, 26 Oct 2024 20:32:03 +0000 (16:32 -0400)]
Fix multi‐stage exclusion of [$%] in file·names
Make interprets the dollar signs in commandline variable assignments as
variable references, so they need to be escaped (doubled) when
forwarding values to a submake thru the commandline.
Lady [Sat, 21 Sep 2024 05:16:33 +0000 (01:16 -0400)]
Simplify two‐step build
The two‐step build originally installed to `$(BUILDDIR)/data`, but this
installation step is unnecessary (it just copies over files from the
`public/` folder of the first build). This commit uses the `public/`
folder of the first build directly, allowing both builds to have the
same `$(DESTDIR)` which is only used when actually `make install`ing.
This also enables renaming the folders for the first and second build
from `stage1/` and `stage2/` to `data/` and `site/`, which are more
informative.
Lady [Fri, 20 Sep 2024 03:21:16 +0000 (23:21 -0400)]
Apply attributes at every stage
Previously, there was a lot of complicated logic to account for the
fact that certain important attributes might not be added until the end
of the transformation process (via `<书社:apply-attributes>` or
`<书社:apply-attributes-to-root>`). It’s much simpler, conceptually, to
just apply attributes after every transformation phase and not worry
about them besides.
This does mean that if an embed contains an
`<书社:apply-attributes-to-root>` element, it _will_ almost definitely
be applied when·ever that embed is embedded, before the next phase gets
a chance to put a word in edge·wise. Presumably, tho, this is one of
the main utilities of the `<书社:apply-attributes-to-root>` element in
the first place, so maybe that is okay.
This commit introduces a new `书社:finalize` mode for things wot used
to be in the `书社:apply` mode but weren’t actually related to
attribute application.
Lady [Fri, 20 Sep 2024 03:21:04 +0000 (23:21 -0400)]
Don’t remove invalid @书社:* attributes
There is a lot of difficult logic particularly around
`@书社:archived-as` to remove it if it won’t have any effect. This is
unnecessary and it is probably better to just leave these attributes
untouched (akin to how `<书社:link>` is left untouched when invalid).
Lady [Fri, 20 Sep 2024 03:20:43 +0000 (23:20 -0400)]
Preserve comments in Record‐Jar and T·S·V formats
Lady [Sun, 15 Sep 2024 19:57:34 +0000 (15:57 -0400)]
Update list, listout for two‐stage builds
`make list` and `make listout` now list files from both stages. Note
that in the case of `make listout`, these files may be in _either_
`/build/stage1/public/` or `/build/stage2/public/` (but hopefully not
both).
`list1`, `list2`, `listout1`, and `listout2` are added to list files
just from a particular stage.
Lady [Sun, 15 Sep 2024 19:08:51 +0000 (15:08 -0400)]
Use diffprereqs files as dependencies, not FORCE
“`diffprereqs`” files are updated whenever the prereqs change, as part
of dependency expansion (and so, obviously, before dependency
comparison). So depending on them is effectively the same as depending
on FORCE iff the dependency changed. However, this approach continues
working across Make restarts.
Previously, if a transform was removed, but Make restarted due to a
parser change, the removal would be ignored because the prereqs would
be updated on the first run but the transform catalog would not. This
commit resolves this issue.
Lady [Sun, 15 Sep 2024 17:31:34 +0000 (13:31 -0400)]
Allow empty archives
Previously, when an archive was empty, it would cause Make to endlessly
restart. This was especially a problem for archives generated from
includes, as if the include was missing (or an empty folder), the
archive would have no members and Make would get stuck in a retry loop.
This commit provides the necessary adjustments to ensure archive code
continues working even when the archive is empty: The archive index
file is always written, and the archive files folder is made to exist
before attempting to `cd` into it.
Lady [Sun, 15 Sep 2024 04:24:45 +0000 (00:24 -0400)]
Enable two‐stage builds using a “data” directory
One pattern for building sites is to use a large number of data files
which are all compiled into a single large file, which is then used to
derive the various pages of the website (using expanded archive
functionality). While this can be done using ordinary includes, it is
expensive to do so, because inclusions and transformations on the
“single large file” will re‐happen every time that it is included. What
is actually desired in this case is an intermediate data file, which
has already had all transformations applied, which can then be included
into other files.
This commit establishes a pattern for doing so, where·by certain files
(conventionally, by file extension; by default, `.rdf`) can be
designated as “data files” and built during an initial pass using
includes from a “data directory”, and then themselves be available as
includes for the second stage. Installing installs files from both
stages. Other commands (such as `listout`) currently ignore data files
because they don’t follow common assumptions (they are not built to
`$(BUILDDIR)/stage2/public`, for example); variants or flags to enable
listing these files may be fruitful future work.
Lady [Thu, 22 Aug 2024 01:37:31 +0000 (21:37 -0400)]
Minor updates to comments
- Update makefileinfo to match README regarding Posix requirements.
- Remove verbose CC0 marking, as the SPDX tags have equivalent effect.
Lady [Tue, 20 Aug 2024 06:22:17 +0000 (02:22 -0400)]
Improve <书社:apply-attributes>, @书社:archived-as
- `<书社:apply-attributes>` should not prevent H·T·M·L from wrapping.
Note that the H·T·M·L wrapper is still not
`<书社:apply-attributes>`‐aware; it will _not_ seek into the wrapped
contents to search for attributes to pull upwards to the root
element. This could probably be improved.
- `@书社:archived-as` can now be applied to `<书社:link>` and will be
passed down to any embedded contents.
- `@书社:archived-as` will not be deleted during attribute application
onto the root element; it now ensures there is a nonroot, nonarchive
ancestor. This is required because archive children are processed
into a separate document prior to application.
An alternative approach might be to wrap archive children in a
`<书社:archive>` element before application and then strip it after,
but this is a fair bit of added work for little benefit. It’s a fair
question whether removing invalid `@书社:*` attributes like this is
even a good practice—invalid `<书社:link>` elements are maintained,
in contrast.
Lady [Sat, 3 Aug 2024 18:04:28 +0000 (14:04 -0400)]
Improve dependency tracking
- Add a `.metadata-format-changed-since` file which is a dependency for
metadata generation. The hope is that this file will change when·ever
the metadata format does, forcing a rebuild of stale metadata.
- Add `PARSERLIBS` and `TRANSFORMLIBS` (and `EXTRA⸺` variants) to
enable rebuilds on changes to files that parsers or transforms depend
on.
Lady [Sat, 3 Aug 2024 17:21:55 +0000 (13:21 -0400)]
Add H·T·M·L microdata to archive children
These attributes (`@itemscope` and `@itemtype`) are normally added at
the beginning of expansion to the root node of the document, prior to
it being wrapped. With archives, they should be added to archive
children as part of the processing which happens during application,
just prior to the wrapping which likewise occurs there. Having these
attributes present is important for title microdata processing (which
happens as a part of wrapping) to work correctly.
As part of this work, microdata handling is improved slightly in all
cases.
Note: If the `@itemscope` or `@itemtype` attributes were already
present on the children of the archive element, for example because
the child was the result of an embed, they will not necessicarily be
adjusted. It’s necessary to remove any embed typing during normal
processing if document typing is desired during the application phase.
Lady [Sat, 3 Aug 2024 16:56:59 +0000 (12:56 -0400)]
Fix transform from sometimes expanding twice
The default behaviour for processing expanded replacements of
`<书社:link>` elements was to expand them again, which was wrong,
beccause they have already been expanded once. They should just be
copied instead.
This line was probably copied from the default behaviour for
`<书社:link>` elements which are not expanded or replaced, where it is
the correct behaviour.
Lady [Thu, 4 Jul 2024 19:04:47 +0000 (15:04 -0400)]
Provide source file in metadata to transforms
While I’ve generally resisted doing this, since tranforms _should_
generally always be looking at the parsed form of the file and not the
original, having access to this property is necessary in some cases to
enable embedding the original source file within the tranformation
result (e·g, when the source file is X·M·L, and there are parsers which
preprocess it). When the source file is _not_ X·M·L, this property is
probably use·less, but included never·the·less.
Lady [Wed, 3 Jul 2024 01:42:56 +0000 (21:42 -0400)]
Fix/improve recursive dependency detection
The old method of detecting recursive dependencies was overcomplicated
and only worked in the simple case of A → B → C → A and not
A → B → C → B. This new method works as follows:
- Given a dependency path…
- Get all of the links in the last document in the path.
- If there are no links, return the path.
- If there are links which point to a file in the path, it is a
recursive dependency. Return the path ending at the point of
recursion.
- Otherwise (there are nonrecursive links), process each path which
results from appending each link to the end of the current path and
return all of them.
The algorithm ends with a set of paths to leaf nodes in the dependency
tree, and each nonroot node in this tree (leaf or branch) is a
dependency. This is what the behaviour should have been from the
beginning. (The old method attempted to process the tree in layers,
rather than as a set of paths.)
Lady [Wed, 3 Jul 2024 01:10:31 +0000 (21:10 -0400)]
Allow including entire directories
This commit enables `@xlink:href`s pointing to entire directories
(ending in `/`) in `<书社:link>`s as an alias for providing a link to
each file in the directory individually. This was always planned, but
apparently never actually implemented before now.
Lady [Sun, 30 Jun 2024 20:41:48 +0000 (16:41 -0400)]
Do asset transforms during application
It’s reasonable to expect ordinary transforms to create new
`<html:style>` and `<html:object>` elements, and these should be
handled as well.
Lady [Sat, 22 Jun 2024 22:07:50 +0000 (18:07 -0400)]
Disallow @xlink:actuate values other than none
This is for forward‐compatibility; future versions of ⛩📰 书社 will
likely define semantics for other `@xlink:actuate` values.
Lady [Sat, 22 Jun 2024 21:54:29 +0000 (17:54 -0400)]
Provide the location of parsed files in metadata
Rather than hardcoding parsed file lookup into `expandmetadata.xslt`
and `catalog2transform.xslt`, provide a file U·R·I for the parsed file
as a part of its metadata and use that instead. It _is_ reasonable for
transforms to want to access the original parsed documents of
dependencies. Note, however, that there is no guarantee that the parsed
document actually exists if it _isn’t_ a dependency for the file.
Lady [Sat, 22 Jun 2024 21:43:40 +0000 (17:43 -0400)]
Disable make·file prerequisites when not needed
Specifically, the `help` and `clean` targets don’t require any
compilation of types, parsers, dependencies, or destinations. G·N·U
Make provides the `$(MAKECMDGOALS)` to check which targets were set as
goals on the commandline; when the only goals are `help` and `clean`,
excessive computation can be disabled.
Lady [Sat, 22 Jun 2024 20:06:53 +0000 (16:06 -0400)]
“Simplify” the restart mechanism using $?
Instead of having two GNUmakefile rules which are present under
different conditions (and which could hypothetically both apply), just
have one and check to see which prerequisites are out·of·date in order
to adjust the behaviour.
In order to prevent unnecessary builds of metadata and parsed files
prior to a type update, wrap the recipes in a check to see if
`$(BUILDDIR)/.update-types` was created over the course of the build.
This needs to happen in the shell, not in Make, because older versions
of Make cache the `$(wildcard)` function. The implementation of
`$(unlesstypeswillupdate)` uses an `if` function instead of a `and`
because the latter seems to trim white·space.
It is no longer an error if the type of a file cannot be determined;
this is required to enable recipe expansion when types are not yet
generated now that the test is happening in the shell. Instead, files
are given a default type of `application/octet-stream`.
Lady [Sat, 22 Jun 2024 17:02:24 +0000 (13:02 -0400)]
Generate dependencies & destinations with metadata
This commit obviates the need for separate `metadata2dependencies` and
`metadata2destinations` transforms and simply bundles their
functionality into `expandmetadata`.
Making this work right is a bit tricky because we are outputting the
main document to `stdout` but want the other result documents to be
output to `BUILDDIR`. The best solution would be to just read in the
build directory inside of the transform and use it to determine the
output location, but unfortunately `exsl:document` does not support
dynamic computation of the destination directory. The current solution
is instead to `cd` into the build directory in a subshell before
calling `xsltproc`.
Lady [Sun, 2 Jun 2024 02:11:10 +0000 (22:11 -0400)]
Simplify metadata using new 书社vocab terms
This commit also changes the behaviour of `@书社:destination`:
Formerly, the value of this attribute needed to be a percent·encoded;
now, it must _not_ be percent·encoded.
Lady [Sun, 2 Jun 2024 01:31:55 +0000 (21:31 -0400)]
Generate destinations and dependencies as metadata
The format of this is subject to change. It might actually be desirable
to have the dependency and destination files be side·effects of the
metadata file generated alongside it (in the same `xsltproc` call)
rather than needing to generate them separately.
Lady [Mon, 27 May 2024 21:38:46 +0000 (17:38 -0400)]
Don’t allow xsltproc to output files
…with the exception of the archive extractor, which is
specially constructed to do so. In all other cases, just output to
standard output and pipe to a file as with other commands, for
consistency and security.
Lady [Mon, 27 May 2024 21:16:23 +0000 (17:16 -0400)]
Provide template identifiers as <书社:id>s
This is definitely going to break existing websites, but it’s much more
sensible and straightforward to deal with, in my opinion. Alternatives
included instead providing them as comments or processing instructions,
which would be much harder to process.
Lady [Mon, 27 May 2024 20:16:44 +0000 (16:16 -0400)]
Do not wrap results which contain no H·T·M·L
It’s much more likely that a result which is not H·T·M·L is intended to
remain that way; wrapping it in `<html:body>` can be used as a
work·around when H·T·M·L wrapping is desired.
Lady [Mon, 27 May 2024 19:48:12 +0000 (15:48 -0400)]
Add nfo:fileName to file metadata
This is useful as `nfo:fileUrl` is percent‐encoded.
Lady [Mon, 27 May 2024 19:46:56 +0000 (15:46 -0400)]
Simplify 书社:literally transform output
Use literal result elements and attributes in cases where it is safe to
do so.
Lady [Mon, 27 May 2024 19:23:51 +0000 (15:23 -0400)]
Drop apostrophe from ‹ Ladys ›
Lady [Mon, 27 May 2024 19:09:44 +0000 (15:09 -0400)]
Remove variation selectors from sigil
The choice of whether to render a character as emoji style or text
style is properly a font and typesetting decision, not a character
encoding one. Altho Unicode provides variation selectors for indicating
a preference in plain text, these selectors should not be given formal
significance. To be clear that the canonical encoding for the sigil is
`<U+26E9,U+1F4F0>`, remove them across the board.
Lady [Mon, 27 May 2024 18:50:22 +0000 (14:50 -0400)]
Set locale and timezone and export them
All programs should execute using (U·T·F 8) C strings and all times
should be in U·T·C.
Lady [Wed, 22 May 2024 06:37:02 +0000 (02:37 -0400)]
Provide metadata in transform; add attributes there
The metadata actually depends on the parser, so it’s a recursive
dependency to make the parser use it. Instead, just make it available
in transforms and add the various ⛩️📰 书社 attributes during the
expansion phase.
Literally including the metadata R·D·F in the transform greatly
increases its file size, but it “should” be fine.
This commit also brings with it a few other improvements and changes to
transforms :—
- All of the `$书社:*` variables which used to return result tree
fragments now return node sets.
- The `书社:application` mode has been renamed to `书社:apply`, to
match `书社:expand`.
Lady [Wed, 22 May 2024 05:21:45 +0000 (01:21 -0400)]
Drop CKSUM and SRCTIME params; add as attributes
`@书社:cksum`, `@书社:mtime`, and `@书社:identifier` are now all added
during the parsing phase. (`@书社:identifier` used to be added during
the transformation phase, but badly. `@书社:mtime` is new.)
This hardcodes the location of the metadata file for now; ideally the
metadata would be embedded.
Lady [Wed, 22 May 2024 04:44:49 +0000 (00:44 -0400)]
Replace source catalog with metadata file
There are two things which this approach should eventally bring :—
1. Availability of various aspects of file metadata for every file
during the parsing and transformation phases. Right now, only
metadata for the file currently being processed is available, and
while loading the catalog is possible in transforms, it’s probably
not really advisable and hasn’t been extensively tested.
2. Cacheing of file metadata for files which have not changed since the
last time Make was run. This comes with the usual Make drawback that
if a file is changed to be older, rather than newer, it won’t be
recognized as having been changed.
Neither of these things are really implemented at this point, but the
metadata file is created and being used and the old catalog has been
removed. Future commits should refine the behaviour.
Lady [Thu, 11 Jul 2024 01:45:26 +0000 (21:45 -0400)]
Give magic file symlinks unique names
Rather than deal with the potential for conflicts in the names of magic
files from different sources, give each file a unique name by taking
the `cksum` of its absolute path.
Lady [Thu, 11 Jul 2024 01:45:04 +0000 (21:45 -0400)]
Support multiple SRCDIR in INCLUDEDIR default
If multiple `SRCDIR`s are provided, the default `INCLUDEDIR` needs to
append `/includes` to each, not simply the last one.
Lady [Sun, 7 Jul 2024 04:37:28 +0000 (00:37 -0400)]
Eliminate unnecessary use of cat
Input redirection works just as well here.
Lady [Sat, 6 Jul 2024 22:50:57 +0000 (18:50 -0400)]
Support -exec in find
`-print` is only implicitly added to `find` rules which do not contain
an `-exec`. The desired behaviour is that `-print` is called
regardless, with the assumption that `-exec` commands are always
silent.
Lady [Sat, 6 Jul 2024 20:42:47 +0000 (16:42 -0400)]
Actually use FINDINCLUDERULES
Commit
d94cfdc987aba3983f4945d59b02cbb062573432 added this variable and
documented it, but strangely it was never actually used in the
appropriate place; `FINDRULES` was used instead for both ordinary
sources and includes.
Lady [Sat, 22 Jun 2024 22:20:59 +0000 (18:20 -0400)]
Fix generator metadata
Formerly, existing generator metadata was preserved and also duplicated
in the tag added by ⛩📰 书社. It only makes sense to do one or the
other.
Lady [Sat, 22 Jun 2024 22:18:17 +0000 (18:18 -0400)]
Don’t recognize title metadata in templates
Per H·T·M·L, the elements in templates are _not_ children, and these
semantics should be respected for microdata.
Lady [Sat, 22 Jun 2024 15:59:53 +0000 (11:59 -0400)]
Allow overriding of finalization program
Lady [Sat, 22 Jun 2024 16:11:04 +0000 (12:11 -0400)]
Use --nonet on xmllint, too
This option was already being supplied for `xsltproc`. Networking
should always be disabled by default; mechanisms for selectively
enabling it may be added later.
Lady [Mon, 27 May 2024 18:41:47 +0000 (14:41 -0400)]
Use --noent when calling xmllint
The X·Path expressions do not correctly match text provided within
entities if the entities are not expanded. Adding `--noent` ensures
that all entities are expanded and X·Path works correctly.
Lady [Sat, 25 May 2024 04:14:34 +0000 (00:14 -0400)]
Wrap EXTRAFINDRULES in parentheses
It shouldn’t be required that users do this.
Lady [Sat, 25 May 2024 04:08:01 +0000 (00:08 -0400)]
Improve SRCDIR/INCLUDEDIR handling; allow dot
- Explicitly allow `find` to match `.`, which otherwise would be
excluded as a dotfile.
- Add special handling to drop the leading `./` that results from the
above, and generate the appropriate local paths without needing it.
- Error when trying to perform certain transformations on file·names
and failing, to better aid diagnosis.
- When a file has no destination (because `destinations` has not been
generated yet), use the fake destination `NOTDEF`. (Make will restart
before this destination is used.)
Lady [Sat, 25 May 2024 04:05:27 +0000 (00:05 -0400)]
INCLUDEDIR should default to be in SRCDIR
…not the literal value `sources`, regardless of what `SRCDIR` might
be.
Lady [Fri, 24 May 2024 05:10:58 +0000 (01:10 -0400)]
Mark GNUmakefile as precious
One would hope that Make wouldn’t ever delete the make·file it is
running, but the documentation doesn’t seem to explicitly give that
guarantee, so it’s good to be explicit about it.
Lady [Fri, 24 May 2024 03:21:50 +0000 (23:21 -0400)]
Reformat redirections
- Remove the space after, but not before redirection operators.
- Do `>>/dev/null` instead of `> /dev/null`; appending makes more
logical sense in this case.
- Use `>|` for other outputs because this make·file should always
clobber.
Lady [Fri, 24 May 2024 02:09:26 +0000 (22:09 -0400)]
Improve documentation regarding Posix utilities
Lady [Fri, 24 May 2024 03:43:06 +0000 (23:43 -0400)]
Set .SHELLFLAGS to match Posix behaviour
Early failure upon the failure of a command seems like a good thing??
Lady [Fri, 24 May 2024 02:16:00 +0000 (22:16 -0400)]
Move variable overrides before targets in submake
It doesn’t matter, but this is the Posix ordering.
Lady [Fri, 24 May 2024 02:44:58 +0000 (22:44 -0400)]
Use exit with a nonzero exit status, not false
Lady [Fri, 24 May 2024 02:43:09 +0000 (22:43 -0400)]
Use colon (:), not true
These are equivalent, but `:` is a special shell builtin and `true` is
not.
Lady [Fri, 24 May 2024 02:39:49 +0000 (22:39 -0400)]
Allow overriding of cd
Altho `cd` is builtin in most shells, it is not a special builtin
utility as defined by Posix, and the use of an alternative
implementation is conceivable.
Lady [Wed, 22 May 2024 04:31:41 +0000 (00:31 -0400)]
Prepend X·M·L declaration on parsed assets
⛩️📰 书社 policy is to never omit it.
Lady [Wed, 22 May 2024 04:29:51 +0000 (00:29 -0400)]
FORCE on type updates
When this was originally implemented, I’m not sure `FORCE` was defined,
but it’s needed now for `diffprereqs` so there’s no reason why not to
use it here as well.
Lady [Wed, 22 May 2024 04:26:34 +0000 (00:26 -0400)]
Fix typeoffile
The old implementation switched some things around and probably would
not work if called with multiple files (it never was).
Lady [Tue, 21 May 2024 06:06:07 +0000 (02:06 -0400)]
Use diff to get better dates
See the comments for more information, including Macintosh quirks. This
is a great deal better than using `ls` and allows for the dropping of
the latter as a dependency.
Lady [Tue, 21 May 2024 03:46:42 +0000 (23:46 -0400)]
Redirect messages to stderr & support disabling
This enables `make -s listout` to work as intended without need for
additional processing.
Lady [Tue, 21 May 2024 03:19:48 +0000 (23:19 -0400)]
Support +xml suffix for determining X·M·L files
This gets around operating system extensions to `file` which might
identify S·V·G files (for example) as `image/svg+xml` before
attempting magic detection. If not every X·M·L‐based syntax should be
handled as such by ⛩️📰 书社, redefine `XMLTYPES` to exclude the
`+xml`.
Lady [Sun, 19 May 2024 21:43:05 +0000 (17:43 -0400)]
Remove support for pagination
Expanded archives support this need better.
Lady [Sun, 19 May 2024 21:16:42 +0000 (17:16 -0400)]
Remove stat dependency
This is, strictly speaking, a downgrade in functionality, with the
upside of reducing reliance on non·Posix programs (namely `stat`). A
better, Posix‐compliant solution is to archive an empty file with the
correct modification time and then list out the time from that archive;
however, as far as I’m aware, it’s not possible to obtain an
implementation of the `pax` utility which actually supports this. macOS
only supports a very limited subset of the `listopt` option, and only
for pax archives (not tarballs); other implementations don’t seem to
support it at all.
Lady [Sun, 19 May 2024 22:09:06 +0000 (18:09 -0400)]
Force removal of existing directories
…prior to processing results or installing. Mostly, this prevents a
failure when an expanded archive is changed to no longer be expanded.
This also simplifies the installation code a bit.
Lady [Sun, 19 May 2024 21:55:58 +0000 (17:55 -0400)]
Fix base64 decoding
The `tr -d` in this pipeline also removed the trailing newline, so it’s
necessary to re·add it prior to the closing equals.
Lady [Sun, 19 May 2024 19:54:20 +0000 (15:54 -0400)]
Remove sed range expressions
These are technically only Posix in the Posix locale and have undefined
meaning otherwise. It’s not the policy of ⛩️📰 书社 to require the
Posix locale, so the safest thing is to just not use range expressions
here.
(Actually, this policy might be worth revisiting for things which
definitely need to be operating on Unicode text.)
Lady [Fri, 3 May 2024 04:19:46 +0000 (00:19 -0400)]
Explicitly declare ustar format to pax
In Posix, the default format for writing is implementation‐defined, but
⛩️📰 书社 is documented to always produce tarballs.
Lady [Fri, 3 May 2024 03:48:12 +0000 (23:48 -0400)]
Use compound commands to join strings, not sed
Previously, the script would sometimes use sed to insert text at the
beginning or end of a string, but it is better to just printf as a
separate step instead.
Lady [Fri, 3 May 2024 03:19:01 +0000 (23:19 -0400)]
Remove dependency on echo
`printf` is always preferable to `echo` for portability reasons.
Lady [Fri, 3 May 2024 03:13:55 +0000 (23:13 -0400)]
Support “expanded” archives
The intent is for this mechanism, which is much simpler to implement,
to replace the pagination functionality which was recently added.
Lady [Thu, 2 May 2024 05:51:44 +0000 (01:51 -0400)]
Fix base64 output
Due to a typo, the `uuencode` trailer of four equals signs was being
appended to base64 outputs.
Lady [Thu, 2 May 2024 05:48:21 +0000 (01:48 -0400)]
Improve xargs handling
- Always specify -E '' to disable end‐of‐file handling
- Quote standard input before passing it thru to xargs, and eliminate
usage of the nonstandard `-0` option
- Get rid of xargs where it isn’t strictly required, to avoid line
length limits
Lady [Thu, 2 May 2024 03:05:51 +0000 (23:05 -0400)]
Add @data-tsv-header to TSV data cells
This produces pretty verbose output, but gzipping should be able to
significantly compress it as the attributes will be repeated verbatim
every row.
Lady [Thu, 2 May 2024 02:20:40 +0000 (22:20 -0400)]
Use -u option on date, instead of TZ=
`-u` is a Posix option, so it’s safe to use.
Lady [Thu, 2 May 2024 02:14:51 +0000 (22:14 -0400)]
Update documentation regarding (non‐)Posix needs
Lady [Tue, 30 Apr 2024 07:53:58 +0000 (03:53 -0400)]
Support pagination
It’s not clear to me that this is actually a good idea, and this
functionality may be reverted later. It adds a lot of complexity
despite still having significant drawbacks, and the alternative pattern
of just generating archives and later expanding them is a much safer
and more versatile solution.
However, the pattern of e·g needing a paginated feed of all the posts
in one’s blog suggests that something along these lines (backed by this
method or archiving~expanding) *should* be supported by default in
⛩️📰 书社. One alternative might be to add (e·g) a `@书社:expand`
attribute to <书社:archive> elements, tho how exactly this would be
tracked on the resulting archives is unclear, and it would be
restricted to producing folders (with exclusively archive contents)
that could not easily be mixed with other files.
Lady [Tue, 30 Apr 2024 01:56:58 +0000 (21:56 -0400)]
Update readme
⛩️📰 is now tested on newer versions of Make, al·be·it not
particularly extensively.
Lady [Tue, 30 Apr 2024 01:53:06 +0000 (21:53 -0400)]
Add listout target
Useful for post·processing of files which were installed by ⛩️📰 书社.
Note: There will be plenty of other Make output; use the following to
get just the files :—
make listout | sed '/^⛩️📰 书社 Output:/!d;s/^⛩️📰 书社 Output://'
Lady [Mon, 29 Apr 2024 03:18:59 +0000 (23:18 -0400)]
Don’t use xargs -J
It isn’t portable!
Lady [Sun, 28 Apr 2024 18:44:55 +0000 (14:44 -0400)]
Update documentation to reflect usage on Linux
Lady [Sun, 28 Apr 2024 18:42:21 +0000 (14:42 -0400)]
Make base64 handling Posix
Posix doesn’t allow for a `-r` option on `uudecode` or `uuencode`, but
the headers and footers are easy enough to manually add and remove.
Lady [Sun, 28 Apr 2024 18:06:18 +0000 (14:06 -0400)]
Fix T·S·V parser
A pair of mistakes meant that the final body column was dropped, and
would have been unprocessable if it wasn’t.
Lady [Sun, 28 Apr 2024 04:02:37 +0000 (00:02 -0400)]
Touch important files before making with xsltproc
When there is nothing to output, `xsltproc` does not create files.
However, Make will find itself in an endless restart loop if these
files are never created.
Lady [Sun, 28 Apr 2024 03:46:11 +0000 (23:46 -0400)]
Fix X·M·L 1.1 handling to be portable
A typo meant it was calling `PRINTF` instead of `printf`; amazingly,
the built·in seems to be case‐insensitive on Macintosh so it wasn’t
noticed.
Lady [Sun, 28 Apr 2024 03:06:06 +0000 (23:06 -0400)]
Don’t allow network or DTD loading
This still processes the internal DTD in a nonvalidating way.
Formerly, it would try to fetch the XML catalog DTD every time.
Lady [Sun, 28 Apr 2024 02:48:30 +0000 (22:48 -0400)]
Support GNU stat
`stat` isn’t at all portable; it’s necessary to just try to figure out
which version is being used and then handle each case accordingly.
This page took 0.22347 seconds and 4 git commands to generate.