Verified Commit b26d4361 authored by Karel Koci's avatar Karel Koci 🤘

Extract turris and openwrt version from packages to bin

parent 599d8558
...@@ -93,6 +93,9 @@ set -- "$@" PKG_BRANCH=${PKG_BRANCH/-/} ...@@ -93,6 +93,9 @@ set -- "$@" PKG_BRANCH=${PKG_BRANCH/-/}
make "$@" make "$@"
# Get Turris OS and OpenWRT version
./scripts/unpack-version.sh bin/*/packages bin/*/
if [ -n "$PRIMARY_ONLY" ] ; then if [ -n "$PRIMARY_ONLY" ] ; then
# If we want only the primary system and want to use the build directory for more tests, exit now # If we want only the primary system and want to use the build directory for more tests, exit now
exit exit
......
#!/bin/sh
# Copyright (C) 2017 CZ.NIC
# Unpack Turris OS and OpenWRT version from packages
SOURCE="$1"
DESTINATION="$2"
OPENWRT_PKG=base/base-files_*.ipk
OPENWRT_VERSION=./etc/openwrt_version
OPENWRT_RELEASE=./etc/openwrt_release
TURRIS_PKG=base/turris-version_*.ipk
TURRIS_VERSION=./etc/turris-version
unpack_files() {
local PKG=`realpath "$SOURCE"`/"$1"
local DIR="$2"
local FILES="${@:3}"
(cd "$DIR" && tar -xzOf $PKG ./data.tar.gz | tar -xz $FILES)
}
TMPDIR=`mktemp -d`
unpack_files $OPENWRT_PKG "$TMPDIR" "$OPENWRT_VERSION" "$OPENWRT_RELEASE"
unpack_files $TURRIS_PKG "$TMPDIR" "$TURRIS_VERSION"
mv "$TMPDIR"/"$OPENWRT_VERSION" "$TMPDIR"/"$OPENWRT_RELEASE" "$TMPDIR"/"$TURRIS_VERSION" "$DESTINATION"
rm -rf "$TMPDIR"
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment