Skip to content

Commit

Permalink
livebuild: Skip top-level directory if it matches recipe name
Browse files Browse the repository at this point in the history
If there is one directory with the recipe name in the tarball lets skip
into it before we check the configuration.

Signed-off-by: Jan Blunck <[email protected]>
  • Loading branch information
jblunck committed Jul 16, 2014
1 parent f8436e7 commit 87270ad
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion build-recipe-livebuild
Original file line number Diff line number Diff line change
Expand Up @@ -154,8 +154,20 @@ EOF
tar -xvf $BUILD_ROOT/$TOPDIR/SOURCES/$RECIPEFILE \
-C $BUILD_ROOT/$TOPDIR/$LIVEBUILD_ROOT || cleanup_and_exit 1

# Skip top-level directory if it matches recipe name, ...
local files=($BUILD_ROOT/$TOPDIR/$LIVEBUILD_ROOT/*)
# ... but ignore some well known names
files=(${files[@]%%*/auto})
files=(${files[@]%%*/config})
files=(${files[@]%%*/local})
if [ ${#files[@]} -eq 1 ] && \
[ -d $BUILD_ROOT/$TOPDIR/$LIVEBUILD_ROOT/${RECIPEFILE%.livebuild} ]
then
LIVEBUILD_ROOT="LIVEBUILD_ROOT/${RECIPEFILE%.livebuild}"
fi

# Sanity check to not configure archives inside configuration
local files=($BUILD_ROOT/$TOPDIR/$LIVEBUILD_ROOT/config/archives/*)
files=($BUILD_ROOT/$TOPDIR/$LIVEBUILD_ROOT/config/archives/*)
[ ${#files[@]} -gt 0 ] && cleanup_and_exit 1

# TODO: Add the repository public key
Expand Down

0 comments on commit 87270ad

Please sign in to comment.