Skip to content

Commit defa690

Browse files
committed
linux/{pack,layout}.sh: allow specification of output dir
Allow a caller of pack.sh and layout.sh to specify the location of the payload and symbols. Signed-off-by: Matthew John Cheetham <[email protected]>
1 parent ede8541 commit defa690

File tree

3 files changed

+24
-7
lines changed

3 files changed

+24
-7
lines changed

src/linux/Packaging.Linux/build.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ PAYLOAD="$OUTDIR/payload"
6464
SYMBOLS="$OUTDIR/payload.sym"
6565

6666
# Lay out payload
67-
"$INSTALLER_SRC/layout.sh" --configuration="$CONFIGURATION" --runtime="$RUNTIME" || exit 1
67+
"$INSTALLER_SRC/layout.sh" --configuration="$CONFIGURATION" --runtime="$RUNTIME" --output="$PAYLOAD" --symbol-output="$SYMBOLS" || exit 1
6868

6969
if [ $INSTALL_FROM_SOURCE = true ]; then
7070
echo "Installing to $INSTALL_PREFIX"

src/linux/Packaging.Linux/layout.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,17 @@ case "$i" in
2323
CONFIGURATION="${i#*=}"
2424
shift # past argument=value
2525
;;
26+
--output=*)
27+
PAYLOAD="${i#*=}"
28+
shift # past argument=value
29+
;;
2630
--runtime=*)
2731
RUNTIME="${i#*=}"
2832
shift # past argument=value
2933
;;
34+
--symbol-output=*)
35+
SYMBOLOUT="${i#*=}"
36+
;;
3037
*)
3138
# unknown option
3239
;;
@@ -46,10 +53,12 @@ FRAMEWORK=net8.0
4653

4754
# Perform pre-execution checks
4855
CONFIGURATION="${CONFIGURATION:=Debug}"
49-
50-
# Outputs
51-
PAYLOAD="$PROJ_OUT/$CONFIGURATION/payload"
52-
SYMBOLOUT="$PROJ_OUT/$CONFIGURATION/payload.sym"
56+
if [ -z "$PAYLOAD" ]; then
57+
die "--output was not set"
58+
fi
59+
if [ -z "$SYMBOLOUT" ]; then
60+
SYMBOLOUT="$PAYLOAD.sym"
61+
fi
5362

5463
# Cleanup payload directory
5564
if [ -d "$PAYLOAD" ]; then

src/linux/Packaging.Linux/pack.sh

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,10 @@ case "$i" in
3636
CONFIGURATION="${i#*=}"
3737
shift # past argument=value
3838
;;
39+
--output=*)
40+
OUTPUT_ROOT="${i#*=}"
41+
shift # past argument=value
42+
;;
3943
*)
4044
# unknown option
4145
;;
@@ -59,11 +63,15 @@ if [ -z "$RUNTIME" ]; then
5963
die "--runtime was not set"
6064
fi
6165

62-
TAROUT="$PROJ_OUT/$CONFIGURATION/tar/"
66+
if [ -z "$OUTPUT_ROOT" ]; then
67+
OUTPUT_ROOT="$PROJ_OUT/$CONFIGURATION"
68+
fi
69+
70+
TAROUT="$OUTPUT_ROOT/tar"
6371
TARBALL="$TAROUT/gcm-$RUNTIME.$VERSION.tar.gz"
6472
SYMTARBALL="$TAROUT/gcm-$RUNTIME.$VERSION-symbols.tar.gz"
6573

66-
DEBOUT="$PROJ_OUT/$CONFIGURATION/deb"
74+
DEBOUT="$OUTPUT_ROOT/deb"
6775
DEBROOT="$DEBOUT/root"
6876
DEBPKG="$DEBOUT/gcm-$RUNTIME.$VERSION.deb"
6977
mkdir -p "$DEBROOT"

0 commit comments

Comments
 (0)