Skip to content

Commit

Permalink
rename duple to pair
Browse files Browse the repository at this point in the history
Signed-off-by: Tonis Tiigi <[email protected]>
  • Loading branch information
tonistiigi committed Feb 22, 2021
1 parent 9c85bfc commit bb7a1e8
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions base/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -255,7 +255,7 @@ RUN export CC=xx-clang CXX=xx-clang++ CFLAGS="$BINUTILS_CFLAGS" CXXFLAGS="$BINUT
tar xf binutils-${BINUTILS_VERSION}.tar.gz && \
cd binutils-${BINUTILS_VERSION} && \
for f in ../patches/*; do patch -p1 < $f; done && \
./configure --disable-separate-code --libdir=/lib --prefix=/out --disable-multilib --enable-deterministic-archives --target=$(TARGETPLATFORM= TARGETDUPLE=$BINUTILS_TARGET xx-info) --host $(xx-clang --print-target-triple) --disable-nls --enable-gold --enable-relro --enable-plugins --with-pic --with-mmap --with-system-zlib $BINUTILS_CONFIG && \
./configure --disable-separate-code --libdir=/lib --prefix=/out --disable-multilib --enable-deterministic-archives --target=$(TARGETPLATFORM= TARGETPAIR=$BINUTILS_TARGET xx-info) --host $(xx-clang --print-target-triple) --disable-nls --enable-gold --enable-relro --enable-plugins --with-pic --with-mmap --with-system-zlib $BINUTILS_CONFIG && \
make -j $(nproc) && \
make install && \
cd .. && rm -rf binutils-${BINUTILS_VERSION} && \
Expand All @@ -269,7 +269,7 @@ ARG LD_TARGET
ARG LD_CFLAGS="-Wl,-s -Os"
# BINUTILS_CONFIG defines extra options passed to binutils configure script
ARG BINUTILS_CONFIG=
RUN export CC=xx-clang CXX=xx-clang++ CFLAGS="$LD_CFLAGS --static" CXXFLAGS="$LD_CFLAGS" LD_TARGET=$(TARGETPLATFORM= TARGETDUPLE=$LD_TARGET xx-info) && \
RUN export CC=xx-clang CXX=xx-clang++ CFLAGS="$LD_CFLAGS --static" CXXFLAGS="$LD_CFLAGS" LD_TARGET=$(TARGETPLATFORM= TARGETPAIR=$LD_TARGET xx-info) && \
tar xf binutils-${BINUTILS_VERSION}.tar.gz && \
cd binutils-${BINUTILS_VERSION} && \
for f in ../patches/*; do patch -p1 < $f; done && \
Expand Down
14 changes: 7 additions & 7 deletions base/test-info-common.bats
Original file line number Diff line number Diff line change
Expand Up @@ -76,28 +76,28 @@ load 'assert'
assert_equal "ppc64le" "$(TARGETPLATFORM=linux/ppc64le xx-info march)"
}

@test "parse duple" {
TARGETDUPLE=linux-amd64 run xx-info os
@test "parse pair" {
TARGETPAIR=linux-amd64 run xx-info os
assert_success
assert_output "linux"

TARGETDUPLE=linux-arm64 run xx-info arch
TARGETPAIR=linux-arm64 run xx-info arch
assert_success
assert_output "arm64"

TARGETDUPLE=linux-armv7 run xx-info arch
TARGETPAIR=linux-armv7 run xx-info arch
assert_success
assert_output "arm"

TARGETDUPLE=linux-armv7 run xx-info
TARGETPAIR=linux-armv7 run xx-info
assert_success
assert_output "$(TARGETPLATFORM=linux/arm xx-info)"

TARGETDUPLE=linux-armv5 run xx-info
TARGETPAIR=linux-armv5 run xx-info
assert_success
assert_output "$(TARGETPLATFORM=linux/arm/v5 xx-info)"

TARGETDUPLE=linux-ppc64le run xx-info
TARGETPAIR=linux-ppc64le run xx-info
assert_success
assert_output "$(TARGETPLATFORM=linux/ppc64le xx-info)"
}
Expand Down
8 changes: 4 additions & 4 deletions base/xx-info
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ EOT

set -e

# TARGETDUPLE is an optional alternative format $TARGETOS-$TARGETARCH$TARGETVARIANT, eg linux-amd64, linux-armv7
# TARGETPAIR is an optional alternative format $TARGETOS-$TARGETARCH$TARGETVARIANT, eg linux-amd64, linux-armv7
# This format is recommended to be used in image and binary names where slashes are not allowed.
# Architecture and variant component are not separated with a dash to automatically handle empty value.
if [ -n "$TARGETDUPLE" ]; then
os="$(echo $TARGETDUPLE | cut -d"-" -f1)"
arch="$(echo $TARGETDUPLE | cut -d"-" -f2)"
if [ -n "$TARGETPAIR" ]; then
os="$(echo $TARGETPAIR | cut -d"-" -f1)"
arch="$(echo $TARGETPAIR | cut -d"-" -f2)"
if [ "${arch#armv}" != "${arch}" ]; then
variant="${arch#arm}"
arch="arm"
Expand Down

0 comments on commit bb7a1e8

Please sign in to comment.