Skip to content

Commit

Permalink
Use declare to write the build() function
Browse files Browse the repository at this point in the history
The build() function was extracted from the SLKBUILD using sed, reading
the line that starts with "build()" and ending at the first line that
has a closing brace as the first and only character in the line. But
this could very well not be the actual closing brace of the build()
function. So now, the declare internal bash command is used to write the
function to the buildscript, which fixes this.

This closes #4
  • Loading branch information
gapan committed Nov 19, 2015
1 parent 98fb42d commit fd25cc3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/slkbuild
Original file line number Diff line number Diff line change
Expand Up @@ -654,7 +654,7 @@ extract_source() {
EOEXTRACTSOURCES
fi

sed -n '/^build()/,/^}$/p' $startdir/SLKBUILD >> $startdir/build-$pkgname.sh
declare -f build >> $startdir/build-$pkgname.sh

cat <<EOM >>$startdir/build-$pkgname.sh
Expand Down

1 comment on commit fd25cc3

@jrd
Copy link

@jrd jrd commented on fd25cc3 Nov 20, 2015

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good !! Until now I always have to put a space in front of my closing curling brackets for sed not to match it. This is great \o/

Please sign in to comment.