Skip to content

Commit 5d3937e

Browse files
committed
script: publish early UCD snapshot
1 parent 7ae67b4 commit 5d3937e

File tree

2 files changed

+82
-0
lines changed

2 files changed

+82
-0
lines changed

docs/data-workflow.md

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,28 @@ Make sure to publish exactly the intended set of files.
9191
Skip the NamesList.txt and Unihan data files (see above),
9292
and skip any others that are only for internal use.
9393

94+
### Publish a UCD snapshot
95+
96+
When we have a usable snapshot of the UCD for new repertoire, we should publish the data files,
97+
so that the Charts WG and others can pick them up for their work.
98+
As a pre-alpha snapshot, we do not yet publish security/IDNA/emoji files.
99+
100+
Review/edit the pub/*.sh scripts and advance the version numbers and copyright years.
101+
102+
Run the [pub/copy-ucd-to-draft.sh](https://github.com/unicode-org/unicodetools/blob/main/pub/copy-ucd-to-draft.sh)
103+
script from an up-to-date repo workspace.
104+
The script copies the set of the .../dev/ data files for an alpha snapshot
105+
from a unicodetools workspace to a target folder with the layout of https://www.unicode.org/Public/draft/ .
106+
107+
Send the resulting zip file to Rick for posting to https://www.unicode.org/Public/draft/ .
108+
Ask Rick to add other files that are not tracked in the unicodetools repo:
109+
* Unihan.zip to .../draft/UCD/ucd
110+
111+
TODO: Figure out new process & people replacing Rick in 2025.
112+
113+
Note: No version/delta infixes in names of data files.
114+
We simply use the “draft” folder and the file-internal time stamps for versioning.
115+
94116
### Publish an alpha snapshot
95117

96118
For the alpha review, publish (at least) the UCD and emoji files, and the charts.

pub/copy-ucd-to-draft.sh

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
# Script for
2+
# https://github.com/unicode-org/unicodetools/blob/main/docs/data-workflow.md#publish-a-ucd-snapshot
3+
#
4+
# Invoke like this:
5+
#
6+
# pub/copy-ucd-to-draft.sh ~/unitools/mine/src /tmp/unicode/Public/draft
7+
8+
UNICODETOOLS=$1
9+
DRAFT=$2
10+
11+
UNITOOLS_DATA=$UNICODETOOLS/unicodetools/data
12+
13+
# Adjust the following for each year and version as needed.
14+
COPY_YEAR=2024
15+
UNI_VER=17.0.0
16+
EMOJI_VER=17.0
17+
18+
TODAY=`date --iso-8601`
19+
20+
mkdir -p $DRAFT
21+
22+
cat > $DRAFT/sed-readmes.txt << eof
23+
s/COPY_YEAR/$COPY_YEAR/
24+
s/PUB_DATE/$TODAY/
25+
s/PUB_STATUS/draft/
26+
s/UNI_VER/$UNI_VER/
27+
s/EMOJI_VER/$EMOJI_VER/
28+
s%PUBLIC_EMOJI%Public/draft/emoji%
29+
s%PUBLIC_UCD%Public/draft/UCD%
30+
eof
31+
32+
mkdir -p $DRAFT/UCD/ucd
33+
mkdir -p $DRAFT/zipped
34+
cp -r $UNITOOLS_DATA/ucd/dev/* $DRAFT/UCD/ucd
35+
rm -r $DRAFT/UCD/ucd/Unihan
36+
rm -r $DRAFT/UCD/ucd/emoji
37+
mv $DRAFT/UCD/ucd/version-ReadMe.txt $DRAFT/UCD/ReadMe.txt
38+
mv $DRAFT/UCD/ucd/zipped-ReadMe.txt $DRAFT/zipped/ReadMe.txt
39+
40+
# Fix permissions. Everyone can read, and search directories.
41+
chmod a+rX -R $DRAFT
42+
43+
# Update the readmes in-place (-i) as set up above.
44+
find $DRAFT -name '*ReadMe.txt' | xargs sed -i -f $DRAFT/sed-readmes.txt
45+
46+
# Zip files for some types of data, after fixing permissions
47+
rm $DRAFT/UCD/ucd/UCD.zip
48+
(cd $DRAFT/UCD/ucd; zip -r UCD.zip * && mv UCD.zip $DRAFT/zipped)
49+
50+
# Cleanup
51+
rm $DRAFT/sed-readmes.txt
52+
53+
rm $DRAFT/ucd-snapshot.zip
54+
(cd $DRAFT; zip -r ucd-snapshot.zip *)
55+
56+
echo "--------------------"
57+
echo "Copy files from elsewhere:"
58+
echo "- Unihan.zip to $DRAFT/UCD/ucd"
59+
echo "- Unihan.zip to $DRAFT/zipped"
60+

0 commit comments

Comments
 (0)