Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/building-images.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ operatingSystem:
keymap: us
packages:
noGPGCheck: false
enableExtras: false
enableExtras: true
packageList:
- pkg1
- pkg2
Expand Down Expand Up @@ -617,4 +617,4 @@ podman run --rm -it -v $IMAGE_DIR:/eib \
$EIB_IMAGE \
build --definition-file $DEFINITION_FILE \
--cache=false
```
```
38 changes: 37 additions & 1 deletion pkg/rpm/resolver/templates/rpm-resolution.sh.tpl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,43 @@ set -euo pipefail
{{ if ne .RegCode "" }}
suseconnect -r {{ .RegCode }}
{{ if $.EnableExtras -}}
VERSION=$(awk '/VERSION=/' /etc/os-release | cut -d'"' -f2)
VERSION=$(

OS_RELEASE_FILE="${1:-/etc/os-release}"

# Make sure the file actually exists before we try to read it.
if [[ ! -f "$OS_RELEASE_FILE" ]]; then
echo "Error: file not found: $OS_RELEASE_FILE"
exit 1
fi

# Step 1: try to read the new field first (SL Micro 6.2+).
new_version=$(grep '^SUSE_SUPPORT_PRODUCT_VERSION=' "$OS_RELEASE_FILE" | cut -d '=' -f2 | tr -d '"')

# Step 2: if that field wasn't found, fall back to the old field.
old_version=$(grep '^VERSION_ID=' "$OS_RELEASE_FILE" | cut -d '=' -f2 | tr -d '"')

if [[ -n "$new_version" ]]; then
version="$new_version"
else
version="$old_version"
fi

# Step 3: make sure we actually got something.
if [[ -z "$version" ]]; then
echo "Error: could not find a version in $OS_RELEASE_FILE"
exit 1
fi

# Step 4: check that it looks like a real version number, e.g. "6.2".
if [[ ! "$version" =~ ^[0-9]+(\.[0-9]+)*$ ]]; then
echo "Error: found version '$version' but it doesn't look valid"
exit 1
fi

echo "Version is: $version"
)

suseconnect -p SL-Micro-Extras/$VERSION/{{ .Arch }}
{{ end -}}
zypper ref
Expand Down
Loading