Eine aufbereitete Darstellung der Quelle

 
     
 
 
Anforderungen  |   Konzepte  |   Entwurf  |   Entwicklung  |   Qualitätssicherung  |   Lebenszyklus  |   Steuerung
 
 
 
 

Benutzer

Quelle  install_astyle.sh

  Sprache: Shell
 

#!/bin/sh

# Script to install a version of astyle in ~/astyle.local/
#
# Used by CI builds
#
# Currently only supports git repos as sources
#
# Usage: /path/to/install_astyle.sh <astyle-git-repo> <version-tag>

INSTALL_ROOT=~/astyle.local

# ----------------------------------------------------------------------------
# U S A G E
# ----------------------------------------------------------------------------
usage()
{
    echo "** Usage: $0 <git-repo> <version-tag>"
    echo "   e.g. $0 https://gitlab.com/saalen/astyle.git 3.4.12"
} >&2

# ----------------------------------------------------------------------------
# C A L L _ M A K E
#
# Calls make with the specified parameters, but only displays the error
# log if it fails
# ----------------------------------------------------------------------------
call_make()
{
    # Disable set -e, if active
    set_entry_opts=`set +o`
    set +e

    status=1
    log=`mktemp /tmp/astyle-log.XXXXXXXXXX`
    if [ -n "$log" ]; then
        make "$@" >"$log" 2>&1
        status=$?
        if [ $status -ne 0 ]; then
            cat "$log" >&2
        fi
        rm "$log"
    fi

    # Re-enable `set -e` if active before
    $set_entry_opts

    return $status
}


# ----------------------------------------------------------------------------
# M A I N
# ----------------------------------------------------------------------------
if [ $# -ne 2 ]; then
    usage
    exit 1
fi

REPO_URL="$1"
ASTYLE_VER="$2"

# Already installed?
exe=$INSTALL_ROOT/$ASTYLE_VER/usr/bin/astyle
if [ -x "$exe" ]; then
    echo "astyle version $ASTYLE_VER is already installed at $exe" >&2
    exit 0
fi

workdir=`mktemp -d /tmp/astyle.XXXXXXXXXX`
if [ -z "$workdir" ]; then
    echo "** Unable to create temporary working directory" 2>&1
    exit 1
fi

# Use a sub-process for the next bit to restrict the scope of 'set -e'
(
    set -e ; # Exit sub-process on first error

    # Put everything in this directory
    FILESDIR=$INSTALL_ROOT/$ASTYLE_VER

    git clone -b "${ASTYLE_VER}" --depth 1 ${REPO_URL} "$workdir"
    cd "$workdir"/AStyle

    make_args="DESTDIR=$FILESDIR"

    echo "Creating Makefiles..."
    cmake .

    echo "Making astyle..."
    call_make $make_args

    echo "Installing astyle..."
    mkdir -p "$FILESDIR"
    call_make install $make_args
    # make install DESTDIR=~/astyle.local/3.1
)
status=$?

if [ $status -eq 0 ]; then
    rm -rf "$workdir"
else
    "** Script failed. Work dir is $workdir" >&2
fi

exit $status

Messung V0.5 in Prozent
C=100 H=93 G=96

¤ Dauer der Verarbeitung: 0.21 Sekunden  (vorverarbeitet am  2026-07-10) ¤

*© Formatika GbR, Deutschland






Wurzel

Suchen

PVS Prover

Isabelle Prover

NIST Cobol Testsuite

Cephes Mathematical Library

Vienna Development Method

Haftungshinweis

Die Informationen auf dieser Webseite wurden nach bestem Wissen sorgfältig zusammengestellt. Es wird jedoch weder Vollständigkeit, noch Richtigkeit, noch Qualität der bereit gestellten Informationen zugesichert.

Bemerkung:

Die farbliche Syntaxdarstellung und die Messung sind noch experimentell.






                                                                                                                                                                                                                                                                                                                                                                                                     


Neuigkeiten

     Aktuelles
     Motto des Tages

Software

     Quellcodebibliothek
     Eigene Quellcodes
     Fremde Quellcodes
     Suchen

Aktivitäten

     Artikel über Sicherheit
     Anleitung zur Aktivierung von SSL

Muße

     Gedichte
     Musik
     Bilder

Jenseits des Üblichen ....
    

Besucherstatistik

Besucherstatistik