From 2d8e0983c89f07281a65f2a0d4562c95a9bb806f Mon Sep 17 00:00:00 2001 From: OSAK Buildhauer <osak@fsmpi.rwth-aachen.de> Date: Tue, 19 Feb 2019 18:18:13 +0000 Subject: [PATCH] Use names from sourced lsb-release --- create_offlinerepo.sh | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) diff --git a/create_offlinerepo.sh b/create_offlinerepo.sh index 8fd3963..4fb3b0d 100755 --- a/create_offlinerepo.sh +++ b/create_offlinerepo.sh @@ -26,13 +26,11 @@ mkdir -p "$dest" 7z e -so "$iso_file" casper/filesystem.squashfs > "$workspace"/offlinerepo/filesystem.squashfs unsquashfs -no-xattrs -d "$workspace"/offlinerepo/squashfs-root "$workspace"/offlinerepo/filesystem.squashfs -ISO_RELEASE="$(grep DISTRIB_CODENAME "$workspace/offlinerepo/squashfs-root/etc/lsb-release" | cut -d= -f 2-)" -ISO_VERSION="$(grep DISTRIB_RELEASE "$workspace/offlinerepo/squashfs-root/etc/lsb-release" | cut -d= -f 2-)" -ISO_DESCRIPTION="$(grep DISTRIB_DESCRIPTION "$workspace/offlinerepo/squashfs-root/etc/lsb-release" | cut -d'"' -f 2)" -echo "deb $APT_SOURCE_URL_OVERRIDE ${ISO_RELEASE} main restricted universe multiverse" > "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list" -echo "deb $APT_SOURCE_URL_OVERRIDE ${ISO_RELEASE}-security main restricted universe multiverse" >> "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list" -echo "deb $APT_SOURCE_URL_OVERRIDE ${ISO_RELEASE}-updates main restricted universe multiverse" >> "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list" -echo "deb $APT_SOURCE_URL_OVERRIDE ${ISO_RELEASE}-backports main restricted universe multiverse" >> "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list" +source "$workspace/offlinerepo/squashfs-root/etc/lsb-release" +echo "deb $APT_SOURCE_URL_OVERRIDE ${DISTRIB_CODENAME} main restricted universe multiverse" > "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list" +echo "deb $APT_SOURCE_URL_OVERRIDE ${DISTRIB_CODENAME}-security main restricted universe multiverse" >> "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list" +echo "deb $APT_SOURCE_URL_OVERRIDE ${DISTRIB_CODENAME}-updates main restricted universe multiverse" >> "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list" +echo "deb $APT_SOURCE_URL_OVERRIDE ${DISTRIB_CODENAME}-backports main restricted universe multiverse" >> "$workspace/offlinerepo/squashfs-root/etc/apt/sources.list" apt-get -o Dir="$workspace"/offlinerepo/squashfs-root update { @@ -41,12 +39,12 @@ apt-get -o Dir="$workspace"/offlinerepo/squashfs-root update } | cut -d"'" -f2 | while read url; do wget -q -nc -P "$dest" "$url"; done apt-get -o Dir="$workspace"/offlinerepo/squashfs-root install --reinstall --print-uris -qq $packages -mkdir -p "$dest/dists/$ISO_RELEASE/lip/binary-amd64" -( cd "$dest" && dpkg-scanpackages . | gzip > "dists/$ISO_RELEASE/lip/binary-amd64/Packages.gz" ) +mkdir -p "$dest/dists/$DISTRIB_CODENAME/lip/binary-amd64" +( cd "$dest" && dpkg-scanpackages . | gzip > "dists/$DISTRIB_CODENAME/lip/binary-amd64/Packages.gz" ) -cat <<EOF > "$dest/dists/$ISO_RELEASE/lip/binary-amd64/Release" -Archive: $ISO_RELEASE -Version: $ISO_VERSION +cat <<EOF > "$dest/dists/$DISTRIB_CODENAME/lip/binary-amd64/Release" +Archive: $DISTRIB_CODENAME +Version: $DISTRIB_RELEASE Component: lip Origin: Ubuntu Label: Ubuntu @@ -57,13 +55,13 @@ touch "$dest/.aptignr" cat <<EOF > "$dest/Release" Origin: Ubuntu Label: LIP Ubuntu Extra Packages -Suite: $ISO_RELEASE -Version: $ISO_VERSION -Codename: $ISO_RELEASE +Suite: $DISTRIB_CODENAME +Version: $DISTRIB_RELEASE +Codename: $DISTRIB_CODENAME Date: $(LC_ALL=C date -u) Architectures: amd64 Components: lip -Description: $ISO_DESCRIPTION +Description: $DISTRIB_DESCRIPTION EOF # Maybe sort files into the usual directory structure ("pool/main/g/glib2.0...") -- GitLab