#!/bin/sh
set -e
NAME=ca-certificates
VERSION=1
datefmt="%Y%m%d%H%M"
LAST_COMMIT=(`git rev-list --timestamp HEAD^..HEAD`)
DATE=`date +$datefmt -d "1970-01-01 00:00 UTC $LAST_COMMIT seconds"`
scmver="$DATE"
fullver="$VERSION${scmver:+_}$scmver"
pfx="$NAME${fullver:+-$fullver}"
fn="$pfx".tar.xz
if ! git config --get tar.umask >/dev/null 2>&1 ; then
	git config --add tar.umask 022
fi
git archive --prefix="$pfx"/ HEAD | xz > $fn
echo "version $fullver -> $fn"
