Skip to content

Commit ba4342d

Browse files
t-lokrnowak
andcommitted
Apply suggestions from code review
Thank you @krnowak! Great review and awesome feedback, as always. Co-authored-by: Krzesimir Nowak <[email protected]>
1 parent 6f38b9a commit ba4342d

File tree

3 files changed

+20
-20
lines changed

3 files changed

+20
-20
lines changed

PREFIX.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Before prefix build support are considered stable, the below must be implemented
1717
## About
1818

1919
Prefix builds let you build and ship applications and all their dependencies in a custom directory.
20-
This custom directory is self-contained, all dependencies are included, and binaries are only linked agains libraries in the custom directory.
20+
This custom directory is self-contained, all dependencies are included, and binaries are only linked against libraries in the custom directory.
2121
The applications' root will be `/` - i.e. there's no need to `chroot` into the custom directory.
2222

2323
For example, applications built with the prefix `/usr/local/my-app` will ship

build_library/prefix_util.sh

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
DEFAULT_STAGING_ROOT="/build/"
55

66
function lineprepend() {
7-
awk -v msg="$@" '{ print msg ": " $0}'
7+
awk -v msg="$*" '{ print msg ": " $0}'
88
}
99
# --
1010

@@ -114,17 +114,17 @@ function create_make_conf() {
114114

115115
sudo_clobber "${filepath}" <<EOF
116116
DISTDIR="/mnt/host/source/.cache/distfiles"
117-
PKGDIR="${STAGINGDIR}/pkgs"
118-
PORT_LOGDIR="${dir}/logs"
119-
PORTAGE_TMPDIR="${dir}/tmp"
117+
PKGDIR=${STAGINGDIR@Q}/pkgs
118+
PORT_LOGDIR=${dir@Q}/logs
119+
PORTAGE_TMPDIR=${dir@Q}/tmp
120120
PORTAGE_BINHOST=""
121121
PORTAGE_USERNAME="sdk"
122122
MAKEOPTS="--jobs=4"
123-
CHOST="${PREFIX_CHOST}"
123+
CHOST=${PREFIX_CHOST@Q}
124124
125-
ACCEPT_KEYWORDS="${PREFIX_KEYWORDS}"
125+
ACCEPT_KEYWORDS=${PREFIX_KEYWORDS@Q}
126126
127-
EMERGE_DEFAULT_OPTS="${emerge_opts}"
127+
EMERGE_DEFAULT_OPTS=${emerge_opts@Q}
128128
129129
USE="
130130
-desktop
@@ -162,11 +162,11 @@ function create_emerge_wrapper() {
162162
163163
set -euo pipefail
164164
165-
PREFIXNAME="${PREFIXNAME}"
166-
EPREFIX="${EPREFIX}"
167-
STAGINGROOT="${STAGINGROOT}"
168-
FINALROOT="${FINALROOT}"
169-
CB_ROOT="${CB_ROOT}"
165+
PREFIXNAME=${PREFIXNAME@Q}
166+
EPREFIX=${EPREFIX@Q}
167+
STAGINGROOT=${STAGINGROOT@Q}
168+
FINALROOT=${FINALROOT@Q}
169+
CB_ROOT=${CB_ROOT@Q}
170170
171171
if [ "\${1}" = "--help" ] ; then
172172
echo "\$0 : emerge prefix wrapper for prefix '\${PREFIXNAME}'"
@@ -178,11 +178,11 @@ if [ "\${1}" = "--help" ] ; then
178178
echo " --install Skip build, just install. Binpkg must exist in staging."
179179
echo
180180
echo " Prefix configuration:"
181-
echo " PREFIXNAME=\"\${PREFIXNAME}\""
182-
echo " EPREFIX=\"\${EPREFIX}\""
183-
echo " STAGINGROOT=\"\${STAGINGROOT}\""
184-
echo " FINALROOT=\"\${FINALROOT}\""
185-
echo " CB_ROOT="\${CB_ROOT}""
181+
echo " PREFIXNAME=\${PREFIXNAME@Q}"
182+
echo " EPREFIX=\${EPREFIX@Q}"
183+
echo " STAGINGROOT=\${STAGINGROOT@Q}"
184+
echo " FINALROOT=\${FINALROOT@Q}"
185+
echo " CB_ROOT=\${CB_ROOT@Q}"
186186
exit
187187
fi
188188
@@ -199,7 +199,7 @@ if [ "\${skip_build}" = "true" ] ; then
199199
echo "NOTE that install into final will fail if binpkgs are missing."
200200
else
201201
echo "Building in staging..."
202-
sudo -E EPREFIX=\${EPREFIX} \${CB_ROOT}/bin/cb-emerge \${STAGINGROOT} "\$@"
202+
sudo -E EPREFIX="\${EPREFIX}" "\${CB_ROOT}/bin/cb-emerge" "\${STAGINGROOT}" "\$@"
203203
fi
204204
205205
if [ "\${skip_install}" = "true" ] ; then

sdk_container/src/third_party/prefix-overlay/prefix/prefix-final/prefix-final-0.0.1.ebuild

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,6 @@ KEYWORDS="amd64 arm64"
1111

1212
# These should be the absolute minimum runtime dependencies of the "final" prefix.
1313
# "Staging" has @system so it is pretty heavyweight.
14-
RDEPEND="${RDEPEND}
14+
RDEPEND="
1515
virtual/libc
1616
"

0 commit comments

Comments
 (0)