Skip to content

Commit

Permalink
gcc: More debugging in the prescript.
Browse files Browse the repository at this point in the history
  • Loading branch information
mithro committed Sep 21, 2018
1 parent 62d4651 commit de705ac
Showing 1 changed file with 25 additions and 13 deletions.
38 changes: 25 additions & 13 deletions gcc/nostdc/prescript.or1k.sh
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
#!/bin/bash

if ! which conda ; then
echo "No conda in path?"
if [ $TOOLCHAIN_ARCH != "or1k" ]; then
echo "Only valid for or1k config."
exit 1
fi

if [ $TOOLCHAIN_ARCH != "or1k" ]; then
echo "Only valid for or1k config."
if [ -z "$PACKAGE" ]; then
echo "Must provide $PACKAGE environment variable."
exit 1
fi

if [ -z "$CONDA_PATH" ]; then
CONDA_PATH=~/conda/
export PATH=$CONDA_PATH:$PATH
fi
if ! which conda ; then
echo "No conda in path?"
exit 1
fi

TOP_DIR=$PWD
echo "Top dir: $TOP_DIR"
EXTRA_YAML_FILE=$TOP_DIR/gcc/nostdc/conda_build_config.$TOOLCHAIN_ARCH.yaml
EXTRA_YAML_FILE=$TOP_DIR/$PACKAGE/conda_build_config.$TOOLCHAIN_ARCH.yaml

OR1K_GIT_DIR="$($CONDA_PATH/bin/python $TOP_DIR/find-git-cache.py gcc/nostdc git_url)"
OR1K_GIT_REV="$($CONDA_PATH/bin/python $TOP_DIR/find-git-cache.py gcc/nostdc git_rev)"
Expand All @@ -28,6 +33,12 @@ else
exit 1
fi
pushd $OR1K_GIT_DIR >/dev/null

echo "-------------------"
du -h -s .
df -h
echo "-------------------"

git remote -v
if ! git remote -v | grep -q upstream; then
git remote add upstream git://gcc.gnu.org/git/gcc.git
Expand All @@ -38,22 +49,23 @@ git fetch upstream --tags
git fetch
git fetch --tags

echo > $EXTRA_YAML_FILE

# Find our current or1k release
OR1K_RELEASE=$(git describe --abbrev=0 --match or1k-*-* $OR1K_GIT_REV)
echo "or1k_release: $OR1K_RELEASE" >> $EXTRA_YAML_FILE
GCC_RELEASE=$(echo $OR1K_RELEASE | sed -e's/^or1k-/gcc-/' -e's/\./_/g' -e's/-[0-9]\+$/-release/')
GCC_RELEASE_FIXED=$(echo $GCC_RELEASE | sed -e's/_/./g')
echo "gcc_release: $GCC_RELEASE_FIXED" >> $EXTRA_YAML_FILE
GCC_GIT_REV=$(git describe --tags --long --match ${GCC_RELEASE} $OR1K_GIT_REV | sed -e"s/^${GCC_RELEASE}-//" -e's/-/_/')
echo "gcc_git_rev: $GCC_GIT_REV" >> $EXTRA_YAML_FILE

more $EXTRA_YAML_FILE
cat > $EXTRA_YAML_FILE <<EOF
or1k_release: $OR1K_RELEASE
gcc_release: $GCC_RELEASE_FIXED
gcc_git_rev: $GCC_GIT_REV
EOF

echo "-------------------"
du -h .
more $EXTRA_YAML_FILE
echo "-------------------"
du -h -s .
df -h
echo "-------------------"


popd >/dev/null

0 comments on commit de705ac

Please sign in to comment.