git.schokokeks.org
Repositories
Help
Report an Issue
freewvs.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
7a448f8
Branches
Tags
master
v0.1.1
v0.1.2
v0.1.3
v0.1.4
v0.1.5
freewvs.git
misc
create-freewvsdb
Use simpler ustar format to make sure we never store unnecessary metadata
Hanno Böck
commited
7a448f8
at 2026-01-28 15:52:05
create-freewvsdb
Blame
History
Raw
#!/bin/bash # # This script is used to generate the update files for freewvs. # You do not need it if you merely want to use freewvs. # # SPDX-License-Identifier: 0BSD TARGETDIR="$HOME/websites/freewvsdb.schokokeks.org/htdocs/" GITDIR="$HOME/gitmirror/freewvs/" TIMESTAMP=$(git --git-dir $GITDIR.git --no-pager log --format=%ct -1) TIMESTAMP_OLD=0 if [ -e "$TARGETDIR/freewvsdb.timestamp" ]; then TIMESTAMP_OLD=$(cat "$TARGETDIR/freewvsdb.timestamp") fi if [ "$TIMESTAMP" -lt "$TIMESTAMP_OLD" ]; then echo "ERROR: New timestamp is smaller than old timestamp" exit 1 fi if [ "$TIMESTAMP" -eq "$TIMESTAMP_OLD" ]; then # nothing to do exit 0 fi # We try to be as reproducible as possible, see # https://h2.jaguarpaw.co.uk/posts/reproducible-tar/ # https://reproducible-builds.org/docs/archives/ pushd $GITDIR/freewvsdb >/dev/null tar --mtime="@$TIMESTAMP" --owner=0 --group=0 --numeric-owner -sort=name --format=ustar \ --strip-components=99 \ -cJf $TARGETDIR/$TIMESTAMP.tar.xz \ *.json popd >/dev/null echo -n $TIMESTAMP >$TARGETDIR/freewvsdb.timestamp