X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1af04af978a0d15f9e4e16db1270e42ff0fc6d11..f3ae712a1b95294052b6e8136d0f0f2d4b30e6eb:/tools/check_dist_archive diff --git a/tools/check_dist_archive b/tools/check_dist_archive index 7937222119..963a4a3495 100755 --- a/tools/check_dist_archive +++ b/tools/check_dist_archive @@ -1,5 +1,11 @@ #!/bin/bash +# Copyright (c) 2013-2014. The SimGrid Team. +# All rights reserved. + +# This program is free software; you can redistribute it and/or modify it +# under the terms of the license (GNU LGPL) which comes with this package. + set -e if [ "$1" = "-batch" ]; then @@ -12,24 +18,24 @@ else fi if [ $# -lt 1 -o $# -gt 3 ]; then - cat <&2 <&2 exit 1 fi if [ $# -ge 2 ]; then giturl=$2 - gitbranch=${3:-master} + gitref=${3:-master} else giturl=$(git rev-parse --show-toplevel) - gitbranch=$(git branch | sed -n '/^\*/{s/^..//;p;}') + gitref=HEAD fi tmpdir=$(mktemp -d) @@ -49,7 +55,7 @@ case "$myname" in esac if [ ! -r "$exclude" ]; then - printf 'File not found: %s\n' "$exclude" + printf 'File not found: %s\n' "$exclude" >&2 exit 1 fi @@ -60,8 +66,8 @@ tar --directory "$tmpdir" \ --transform 's!^[^/]*!a!' \ --extract --gunzip --file "$archive" -echo "Copying git repository: $giturl/$gitbranch -> $git_dir" -git archive --format=tar --prefix="b/" --remote="$giturl" "$gitbranch" \ +echo "Copying git repository: $giturl/$gitref -> $git_dir" +git archive --format=tar --prefix="b/" --remote="$giturl" "$gitref" \ | tar --directory "$tmpdir" --extract --file - fa=from_tgz @@ -86,12 +92,18 @@ diffcmd() { echo "The archive looks good." else status=1 - echo "Some files are missing and/or unexpected in the archive." + cat <