Skip to content

Commit 69291af

Browse files
committed
Use librespot tag in package version
Previously, librespot didn't have tagged versions so we made up our own Debian package version based on the SHA + last commit date. Now we can just librespot's tag.
1 parent 1ae2bef commit 69291af

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

build.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,7 @@ fi
3131

3232
# Get the git rev of librespot for .deb versioning
3333
cd librespot
34-
git checkout master
35-
LIBRESPOT_GIT_REV="$(git rev-parse --short HEAD 2>/dev/null || echo unknown)"
36-
LIBRESPOT_DEB_VER="$(TZ=UTC git show --quiet --date='format-local:%Y%m%dT%H%M%SZ' --format="%cd.%h" "$LIBRESPOT_GIT_REV" 2>/dev/null || echo "unknown")"
34+
LIBRESPOT_GIT_VER="$(git describe --tags --always --dirty 2>/dev/null || echo unknown)"
3735

3836
# Build librespot
3937
sed -i "s/\(librespot\)\( {} ({})\. Built on {}\. Build ID: {}\)/\1 (raspotify v$RASPOTIFY_GIT_VER)\2/" src/main.rs
@@ -50,7 +48,7 @@ cp -v /build/arm-unknown-linux-gnueabihf/release/librespot raspotify/usr/bin
5048
#arm-linux-gnueabihf-strip raspotify/usr/bin/librespot
5149

5250
# Compute final package version + filename for Debian control file
53-
DEB_PKG_VER="${RASPOTIFY_GIT_VER}~librespot.${LIBRESPOT_DEB_VER}"
51+
DEB_PKG_VER="${RASPOTIFY_GIT_VER}~librespot.${LIBRESPOT_GIT_VER}"
5452
DEB_PKG_NAME="raspotify_${DEB_PKG_VER}_armhf.deb"
5553
echo "$DEB_PKG_NAME"
5654

@@ -75,6 +73,6 @@ pandoc -f markdown -t plain --columns=80 README.md \
7573
dpkg-deb -b raspotify "$DEB_PKG_NAME"
7674

7775
# Perm fixup. Not needed on macOS, but is on Linux
78-
chown -R "$PERMFIX_UID:$PERMFIX_GID" /mnt/raspotify 2> /dev/null
76+
chown -R "$PERMFIX_UID:$PERMFIX_GID" /mnt/raspotify 2> /dev/null || true
7977

8078
echo "Package built as $DEB_PKG_NAME"

0 commit comments

Comments
 (0)