git.schokokeks.org
Repositories
Help
Report an Issue
freewvs.git
Code
Commits
Branches
Tags
Suche
Strukturansicht:
650ab3f
Branches
Tags
master
v0.1.1
v0.1.2
v0.1.3
v0.1.4
freewvs.git
misc
create-freewvsdb
share script to create freewvsdb update tarballs
Hanno Böck
commited
650ab3f
at 2025-01-07 11:10:31
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/ pushd $GITDIR/freewvsdb >/dev/null tar --sort=name --mtime="@$TIMESTAMP" --owner=0 --group=0 --numeric-owner \ --strip-components=99 \ -cJf $TARGETDIR/$TIMESTAMP.tar.xz \ *.json popd >/dev/null echo -n $TIMESTAMP >$TARGETDIR/freewvsdb.timestamp