aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRobin H. Johnson <robbat2@gentoo.org>2017-04-19 16:42:27 -0700
committerRobin H. Johnson <robbat2@gentoo.org>2017-04-19 16:42:27 -0700
commit5fbe111d7f0576431a4ca8535a2ab0e674432c86 (patch)
tree758915f4c373574f34d70fdd4e420ac3ea8d7af4
parentmastermirror-staging: Disable ident expansion per bug #611234. (diff)
downloadmastermirror-scripts-5fbe111d7f0576431a4ca8535a2ab0e674432c86.tar.gz
mastermirror-scripts-5fbe111d7f0576431a4ca8535a2ab0e674432c86.tar.bz2
mastermirror-scripts-5fbe111d7f0576431a4ca8535a2ab0e674432c86.zip
mastermirror-staging: add new timestamp that shows git export point clearly
Signed-off-by: Robin H. Johnson <robbat2@gentoo.org>
-rwxr-xr-xmastermirror-staging.sh11
1 files changed, 10 insertions, 1 deletions
diff --git a/mastermirror-staging.sh b/mastermirror-staging.sh
index 8137bca..b72ee65 100755
--- a/mastermirror-staging.sh
+++ b/mastermirror-staging.sh
@@ -69,7 +69,10 @@ fetch_git() {
targetdir=$1
repo=$2
shift 2
+ timestampfile=${timestampfile:-timestamp.commit}
gitdir=${targetdir}.git
+ timestampfile=${gitdir}/$timestampfile
+ [ -e "$timestampfile" ] && rm -f "$timestampfile"
if [[ ! -d "${targetdir}" ]] ; then
# not checked out yet, run initial co
mkdir -p "${targetdir}.git" "$gitdir" && \
@@ -83,10 +86,16 @@ fetch_git() {
fgrep -sq -e "$line" "$attribfile" ||
echo "$line" >>"$attribfile"
done
+ excludefile=${gitdir}/info/exclude
+ for line in timestamp.commit timestamp.chk timestamp.x timestamp ; do
+ fgrep -sq -e "$line" "$excludefile" ||
+ echo "$line" >>"$excludefile"
+ done
cd "${targetdir}" || return 1
$GIT fetch -q --force origin master || return 1
$GIT reset -q --hard origin/master || return 1
$GIT_RESTORE_MTIME || return 1
+ TZ=UTC $GIT log -1 --date=iso-strict-local --format='%H %ct %cd' >${timestampfile}
}
fetch_uri() {
@@ -106,7 +115,7 @@ fetch_uri() {
rc_sum=0
# repo/gentoo (formerly CVS gentoo-x86)
-fetch_git ${STAGING_DIR_gentoo} ${REPO_gentoo} "${ATTRIB_gentoo[@]}"
+timestampfile=metadata/timestamp.commit fetch_git ${STAGING_DIR_gentoo} ${REPO_gentoo} "${ATTRIB_gentoo[@]}"
rc=$?
rc_sum=$((rc_sum + $rc))