repo: remive not neede files
This commit is contained in:
@@ -1,173 +0,0 @@
|
||||
#!/bin/sh
|
||||
# SPDX-License-Identifier: GPL-2.0-only
|
||||
#
|
||||
# cleanup-mars-unicode-tables-tree.sh
|
||||
#
|
||||
# Run from the root of the mars-unicode-tables repository.
|
||||
# This script only reorganizes files and writes repository/license metadata.
|
||||
# It does not regenerate TAB/*.c.
|
||||
|
||||
set -eu
|
||||
|
||||
die() {
|
||||
echo "error: $*" >&2
|
||||
exit 1
|
||||
}
|
||||
|
||||
[ -d .git ] || die "run this from the mars-unicode-tables repository root"
|
||||
|
||||
mkdir -p MAPPINGS/VENDORS
|
||||
mkdir -p LICENSES
|
||||
mkdir -p scripts
|
||||
mkdir -p TAB
|
||||
|
||||
# Move downloaded Unicode mapping vendor tree into the canonical upstream-shaped path.
|
||||
# Expected messy layout from wget/import:
|
||||
# VENDORS/MICSFT/...
|
||||
# VENDORS/APPLE/...
|
||||
# VENDORS/MISC/...
|
||||
#
|
||||
# Target:
|
||||
# MAPPINGS/VENDORS/MICSFT/...
|
||||
# MAPPINGS/VENDORS/APPLE/...
|
||||
# MAPPINGS/VENDORS/MISC/...
|
||||
if [ -d VENDORS ]; then
|
||||
for d in VENDORS/*; do
|
||||
[ -e "$d" ] || continue
|
||||
base=$(basename "$d")
|
||||
if [ -e "MAPPINGS/VENDORS/$base" ]; then
|
||||
echo "merge: $d -> MAPPINGS/VENDORS/$base"
|
||||
# Copy first, then remove the old tree. This is safer across filesystems.
|
||||
cp -a "$d"/. "MAPPINGS/VENDORS/$base"/
|
||||
rm -rf "$d"
|
||||
else
|
||||
echo "move: $d -> MAPPINGS/VENDORS/$base"
|
||||
mv "$d" "MAPPINGS/VENDORS/$base"
|
||||
fi
|
||||
done
|
||||
rmdir VENDORS 2>/dev/null || true
|
||||
fi
|
||||
|
||||
# Remove accidental web crawler metadata.
|
||||
find . -name robots.txt -type f -print -delete
|
||||
|
||||
# Convert downloaded Unicode copyright page into a repo-local Markdown notice.
|
||||
# Keep this as a short pointer/summary; the original upstream data files remain unchanged.
|
||||
rm -f copyright.html COPYRIGHT.html COPYRIGHT.txt
|
||||
|
||||
cat > COPYRIGHT.md <<'EOF'
|
||||
# Copyright and licensing
|
||||
|
||||
This repository contains two kinds of material.
|
||||
|
||||
## Unicode data files
|
||||
|
||||
The files under:
|
||||
|
||||
- `UCD/`
|
||||
- `MAPPINGS/`
|
||||
|
||||
are imported from the Unicode Consortium public data directories, including:
|
||||
|
||||
- `https://www.unicode.org/Public/17.0.0/ucd/`
|
||||
- `https://www.unicode.org/Public/MAPPINGS/`
|
||||
|
||||
These files are Unicode Data Files and are covered by the Unicode license terms.
|
||||
Do not replace these files with Novell NSS `unitables/*.tab` files.
|
||||
|
||||
## MARS-NWE generated/helper files
|
||||
|
||||
Repository helper scripts and generated C table glue maintained by the MARS-NWE
|
||||
project are licensed as GPL-2.0-only unless a file states otherwise.
|
||||
|
||||
The generated tables are derived from the Unicode data files above and are shaped
|
||||
for MARS-NWE/libnwcore compatibility, including NSS-compatible symbol names where
|
||||
needed.
|
||||
EOF
|
||||
|
||||
cat > LICENSES/README.md <<'EOF'
|
||||
# Licenses
|
||||
|
||||
## Unicode data
|
||||
|
||||
`UCD/` and `MAPPINGS/` contain Unicode Data Files imported from unicode.org.
|
||||
They are covered by the Unicode license terms as published by the Unicode
|
||||
Consortium.
|
||||
|
||||
The source data should remain clearly separated from generated MARS-NWE output.
|
||||
|
||||
## MARS-NWE repository code
|
||||
|
||||
Scripts, build glue, generated-output templates, and other project-authored files
|
||||
in this repository are GPL-2.0-only unless a file says otherwise.
|
||||
EOF
|
||||
|
||||
cat > LICENSES/GPL-2.0-only.txt <<'EOF'
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 2, June 1991
|
||||
|
||||
This repository uses GPL-2.0-only for MARS-NWE-authored scripts and glue files.
|
||||
|
||||
The full GPL-2.0 license text is available from the Free Software Foundation:
|
||||
https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt
|
||||
EOF
|
||||
|
||||
# Add SPDX to existing generator if present and not already marked.
|
||||
if [ -f scripts/gen_unicode_tables.py ]; then
|
||||
if ! grep -q 'SPDX-License-Identifier:' scripts/gen_unicode_tables.py; then
|
||||
tmp=$(mktemp)
|
||||
{
|
||||
echo '# SPDX-License-Identifier: GPL-2.0-only'
|
||||
cat scripts/gen_unicode_tables.py
|
||||
} > "$tmp"
|
||||
mv "$tmp" scripts/gen_unicode_tables.py
|
||||
chmod +x scripts/gen_unicode_tables.py 2>/dev/null || true
|
||||
fi
|
||||
fi
|
||||
|
||||
# Refresh README conservatively. Keep it factual and independent of generated code.
|
||||
cat > README.md <<'EOF'
|
||||
# mars-unicode-tables
|
||||
|
||||
Unicode data and generated table sources for MARS-NWE/libnwcore.
|
||||
|
||||
This repository intentionally keeps upstream Unicode source data separate from
|
||||
MARS-NWE-generated output.
|
||||
|
||||
## Layout
|
||||
|
||||
- `UCD/`
|
||||
Unicode Character Database input files, currently imported from Unicode 17.0.0.
|
||||
|
||||
- `MAPPINGS/`
|
||||
Unicode mapping files from `https://www.unicode.org/Public/MAPPINGS/`,
|
||||
preserving the upstream `VENDORS/...` hierarchy.
|
||||
|
||||
- `scripts/`
|
||||
MARS-NWE helper scripts/generators.
|
||||
|
||||
- `TAB/`
|
||||
Generated C table output consumed by MARS-NWE/libnwcore.
|
||||
|
||||
- `LICENSES/`
|
||||
License notes for Unicode data and MARS-NWE-authored helper code.
|
||||
|
||||
## Policy
|
||||
|
||||
Do not copy Novell NSS `shared/sdk/unitables/*.tab` files into this repository.
|
||||
They may be used only as compatibility/reference material outside the committed
|
||||
source data.
|
||||
|
||||
Unicode case/codepage tables should be generated from Unicode.org data files.
|
||||
EOF
|
||||
|
||||
echo
|
||||
echo "cleanup done."
|
||||
echo "Review with:"
|
||||
echo " git status"
|
||||
echo " git diff --stat"
|
||||
echo " git diff --check"
|
||||
echo
|
||||
echo "Suggested commit:"
|
||||
echo " git add -A"
|
||||
echo " git commit -m \"repo: organize Unicode mapping sources and licenses\""
|
||||
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user