From 7662bc50649df89f6369e766ec13f425675bbdb3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=89rico=20Nogueira=20Rolim?= <34201958+ericonr@users.noreply.github.com> Date: Thu, 28 Jan 2021 12:07:33 -0300 Subject: [PATCH 1/6] librespot-audio: update librespot-tremor. This picks up a fix for librespot-tremor when building with Rust 1.48. --- audio/Cargo.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/audio/Cargo.toml b/audio/Cargo.toml index 85de4eb0..7fe15356 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -22,7 +22,7 @@ num-traits = "0.2" tempfile = "3.1" aes-ctr = "0.3" -librespot-tremor = { version = "0.1.0", optional = true } +librespot-tremor = { version = "0.2.0", optional = true } vorbis = { version ="0.0.14", optional = true } [features] From a173fa7cc5a90e0f9d42150a89018df1b1c76cd4 Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Sun, 31 Jan 2021 01:36:10 +0000 Subject: [PATCH 2/6] Remove depreciated error description method --- audio/src/libvorbis_decoder.rs | 4 ---- 1 file changed, 4 deletions(-) diff --git a/audio/src/libvorbis_decoder.rs b/audio/src/libvorbis_decoder.rs index c2198251..48be2b86 100644 --- a/audio/src/libvorbis_decoder.rs +++ b/audio/src/libvorbis_decoder.rs @@ -73,10 +73,6 @@ impl fmt::Display for VorbisError { } impl error::Error for VorbisError { - fn description(&self) -> &str { - error::Error::description(&self.0) - } - fn source(&self) -> Option<&(dyn error::Error + 'static)> { error::Error::source(&self.0) } From 4e0f5e46a556acab2d846116a9806fa955aed731 Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Sat, 20 Feb 2021 22:59:35 +0000 Subject: [PATCH 3/6] Add skip-merge and dry-run options to publish script. Update Cargo.lock. --- Cargo.lock | 6 +-- publish.sh | 120 ++++++++++++++++++++++++++++++++++++++++++++++------- 2 files changed, 109 insertions(+), 17 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9c9c2f6f..01eb3c79 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -970,7 +970,7 @@ dependencies = [ "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", "librespot-core 0.1.3", - "librespot-tremor 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)", + "librespot-tremor 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-traits 0.2.12 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1091,7 +1091,7 @@ dependencies = [ [[package]] name = "librespot-tremor" -version = "0.1.0" +version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" dependencies = [ "cc 1.0.58 (registry+https://github.com/rust-lang/crates.io-index)", @@ -2627,7 +2627,7 @@ dependencies = [ "checksum libm 0.2.1 (registry+https://github.com/rust-lang/crates.io-index)" = "c7d73b3f436185384286bd8098d17ec07c9a7d2388a6599f824d8502b529702a" "checksum libmdns 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)" = "966e0f9cc15be41e9dbfcd74fd9c04cf69d3c0ec43fc56aa28f5e4da4e545c38" "checksum libpulse-sys 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)" = "9bb11b06faf883500c1b625cf4453e6c7737e9df9c7ba01df3f84b22b083e4ac" -"checksum librespot-tremor 0.1.0 (registry+https://github.com/rust-lang/crates.io-index)" = "b155a7dc4e4d272e01c37a1b85c1ee1bee7f04980ad4a7784c1a6e0f2de5929b" +"checksum librespot-tremor 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "97f525bff915d478a76940a7b988e5ea34911ba7280c97bd3a7673f54d68b4fe" "checksum linear-map 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)" = "bfae20f6b19ad527b550c223fddc3077a547fc70cda94b9b566575423fd303ee" "checksum lock_api 0.3.4 (registry+https://github.com/rust-lang/crates.io-index)" = "c4da24a77a3d8a6d4862d95f72e6fdb9c09a643ecdb402d754004a557f2bec75" "checksum log 0.3.9 (registry+https://github.com/rust-lang/crates.io-index)" = "e19e8d5c34a3e0e2223db8e060f9e8264aeeb5c5fc64a4ee9965c062211c024b" diff --git a/publish.sh b/publish.sh index c9fe9db8..3f4964fe 100755 --- a/publish.sh +++ b/publish.sh @@ -1,16 +1,25 @@ #!/bin/bash +SKIP_MERGE='false' +DRY_RUN='false' + WORKINGDIR="$( cd "$(dirname "$0")" ; pwd -P )" cd $WORKINGDIR crates=( "protocol" "core" "audio" "metadata" "playback" "connect" "librespot" ) function switchBranch { - # You are expected to have committed/stashed your changes before running this. - echo "Switching to master branch and merging development." - git checkout master - git pull - git merge dev + if [ "$SKIP_MERGE" = 'false' ] ; then + # You are expected to have committed/stashed your changes before running this. + echo "Switching to master branch and merging development." + git checkout master + git pull + if [ "$DRY_RUN" = 'true' ] ; then + git merge --no-commit --no-ff dev + else + git merge dev + fi + fi } function updateVersion { @@ -26,15 +35,25 @@ function updateVersion { echo "Path is $crate_path" if [ "$CRATE" = "librespot" ] then - cargo update - git add . && git commit -a -m "Update Cargo.lock" + if [ "$DRY_RUN" = 'true' ] ; then + cargo update --dry-run + git add . && git commit --dry-run -a -m "Update Cargo.lock" + else + cargo update + git add . && git commit -a -m "Update Cargo.lock" + fi fi done } function commitAndTag { - git commit -a -m "Update version numbers to $1" - git tag "v$1" -a -m "Update to version $1" + if [ "$DRY_RUN" = 'true' ] ; then + # Skip tagging on dry run. + git commit --dry-run -a -m "Update version numbers to $1" + else + git commit -a -m "Update version numbers to $1" + git tag "v$1" -a -m "Update to version $1" + fi } function get_crate_name { @@ -73,8 +92,17 @@ function publishCrates { then # Protocol crate needs --no-verify option due to build.rs modification. cargo publish --no-verify + if [ "$DRY_RUN" = 'true' ] ; then + cargo publish --no-verify --dry-run + else + cargo publish --no-verify + fi else - cargo publish + if [ "$DRY_RUN" = 'true' ] ; then + cargo publish --dry-run + else + cargo publish + fi fi echo "Successfully published $crate_name to crates.io" remoteWait 30 $crate_name @@ -83,10 +111,32 @@ function publishCrates { function updateRepo { cd $WORKINGDIR - echo "Pushing to master branch of repo." - git push origin master - echo "Pushing v$1 tag to master branch of repo." - git push origin v$1 + if [ "$DRY_RUN" = 'true' ] ; then + echo "Pushing to master branch of repo. [DRY RUN]" + git push --dry-run origin master + echo "Pushing v$1 tag to master branch of repo. [DRY RUN]" + git push --dry-run origin v$1 + + # Cancels any merges in progress + git merge --abort + + git checkout dev + git merge --no-commit --no-ff master + + # Cancels above merge + git merge --abort + + git push --dry-run + else + echo "Pushing to master branch of repo." + git push origin master + echo "Pushing v$1 tag to master branch of repo." + git push origin v$1 + # Update the dev repo with latest version commit + git checkout dev + git merge master + git push + fi } function run { @@ -98,5 +148,47 @@ function run { echo "Successfully published v$1 to crates.io and uploaded changes to repo." } +#Set Script Name variable +SCRIPT=`basename ${BASH_SOURCE[0]}` + +print_usage () { + local l_MSG=$1 + if [ ! -z "${l_MSG}" ]; then + echo "Usage Error: $l_MSG" + fi + echo "Usage: $SCRIPT " + echo " where specifies the version number in semver format, eg. 1.0.1" + echo "Recognized optional command line arguments" + echo "--dry-run -- Test the script before making live changes" + echo "--skip-merge -- Skip merging dev into master before publishing" + exit 1 +} + +### check number of command line arguments +NUMARGS=$# +if [ $NUMARGS -eq 0 ]; then + print_usage 'No command line arguments specified' +fi + +while test $# -gt 0; do + case "$1" in + -h|--help) + print_usage + exit 0 + ;; + --dry-run) + DRY_RUN='true' + shift + ;; + --skip-merge) + SKIP_MERGE='true' + shift + ;; + *) + break + ;; + esac +done + # First argument is new version number. run $1 From 66566e0b26bbc7ec39f23b5275a5869d3b5e421f Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Sat, 20 Feb 2021 23:04:08 +0000 Subject: [PATCH 4/6] remove errant live code in dry-run of publish.sh --- publish.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/publish.sh b/publish.sh index 3f4964fe..942adf84 100755 --- a/publish.sh +++ b/publish.sh @@ -91,7 +91,6 @@ function publishCrates { if [ "$CRATE" == "protocol" ] then # Protocol crate needs --no-verify option due to build.rs modification. - cargo publish --no-verify if [ "$DRY_RUN" = 'true' ] ; then cargo publish --no-verify --dry-run else From 2c110ca25659816c612d94fe7ff4f2ce52b9c38d Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Sat, 20 Feb 2021 23:05:56 +0000 Subject: [PATCH 5/6] Update version numbers to 0.1.5 --- Cargo.toml | 14 +++++++------- audio/Cargo.toml | 4 ++-- connect/Cargo.toml | 8 ++++---- core/Cargo.toml | 4 ++-- metadata/Cargo.toml | 6 +++--- playback/Cargo.toml | 8 ++++---- protocol/Cargo.toml | 2 +- 7 files changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 085ccb8e..da66ac19 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot" -version = "0.1.3" +version = "0.1.5" authors = ["Librespot Org"] license = "MIT" description = "An open source client library for Spotify, with support for Spotify Connect" @@ -22,22 +22,22 @@ doc = false [dependencies.librespot-audio] path = "audio" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-connect] path = "connect" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-core] path = "core" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-metadata] path = "metadata" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-playback] path = "playback" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-protocol] path = "protocol" -version = "0.1.3" +version = "0.1.5" [dependencies] base64 = "0.10" diff --git a/audio/Cargo.toml b/audio/Cargo.toml index 7fe15356..6743a324 100644 --- a/audio/Cargo.toml +++ b/audio/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-audio" -version = "0.1.3" +version = "0.1.5" authors = ["Paul Lietar "] description="The audio fetching and processing logic for librespot" license="MIT" @@ -8,7 +8,7 @@ edition = "2018" [dependencies.librespot-core] path = "../core" -version = "0.1.3" +version = "0.1.5" [dependencies] bit-set = "0.5" diff --git a/connect/Cargo.toml b/connect/Cargo.toml index 6c241133..7496a5c1 100644 --- a/connect/Cargo.toml +++ b/connect/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-connect" -version = "0.1.3" +version = "0.1.5" authors = ["Paul Lietar "] description="The discovery and Spotify Connect logic for librespot" license="MIT" @@ -8,13 +8,13 @@ edition = "2018" [dependencies.librespot-core] path = "../core" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-playback] path = "../playback" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-protocol] path = "../protocol" -version = "0.1.3" +version = "0.1.5" [dependencies] base64 = "0.10" diff --git a/core/Cargo.toml b/core/Cargo.toml index fbcd70ae..12f8227f 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-core" -version = "0.1.3" +version = "0.1.5" authors = ["Paul Lietar "] build = "build.rs" description="The core functionality provided by librespot" @@ -9,7 +9,7 @@ edition = "2018" [dependencies.librespot-protocol] path = "../protocol" -version = "0.1.3" +version = "0.1.5" [dependencies] base64 = "0.10" diff --git a/metadata/Cargo.toml b/metadata/Cargo.toml index a4ca2575..5e90b738 100644 --- a/metadata/Cargo.toml +++ b/metadata/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-metadata" -version = "0.1.3" +version = "0.1.5" authors = ["Paul Lietar "] description="The metadata logic for librespot" license="MIT" @@ -15,7 +15,7 @@ log = "0.4" [dependencies.librespot-core] path = "../core" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-protocol] path = "../protocol" -version = "0.1.3" +version = "0.1.5" diff --git a/playback/Cargo.toml b/playback/Cargo.toml index 699a3f53..48e3ce4d 100644 --- a/playback/Cargo.toml +++ b/playback/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-playback" -version = "0.1.3" +version = "0.1.5" authors = ["Sasha Hilton "] description="The audio playback logic for librespot" license="MIT" @@ -8,13 +8,13 @@ edition = "2018" [dependencies.librespot-audio] path = "../audio" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-core] path = "../core" -version = "0.1.3" +version = "0.1.5" [dependencies.librespot-metadata] path = "../metadata" -version = "0.1.3" +version = "0.1.5" [dependencies] futures = "0.1" diff --git a/protocol/Cargo.toml b/protocol/Cargo.toml index 4e59d7b3..ead3371b 100644 --- a/protocol/Cargo.toml +++ b/protocol/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "librespot-protocol" -version = "0.1.3" +version = "0.1.5" authors = ["Paul LiƩtar "] build = "build.rs" description="The protobuf logic for communicating with Spotify servers" From 91dc14794c2aebb32a7aa8765cc059324e4e26eb Mon Sep 17 00:00:00 2001 From: Sasha Hilton Date: Sat, 20 Feb 2021 23:23:44 +0000 Subject: [PATCH 6/6] Update Cargo.lock --- Cargo.lock | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 01eb3c79..2d844a65 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -932,7 +932,7 @@ dependencies = [ [[package]] name = "librespot" -version = "0.1.3" +version = "0.1.5" dependencies = [ "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", "env_logger 0.6.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -940,12 +940,12 @@ dependencies = [ "getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)", "hex 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-audio 0.1.3", - "librespot-connect 0.1.3", - "librespot-core 0.1.3", - "librespot-metadata 0.1.3", - "librespot-playback 0.1.3", - "librespot-protocol 0.1.3", + "librespot-audio 0.1.5", + "librespot-connect 0.1.5", + "librespot-core 0.1.5", + "librespot-metadata 0.1.5", + "librespot-playback 0.1.5", + "librespot-protocol 0.1.5", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -961,7 +961,7 @@ dependencies = [ [[package]] name = "librespot-audio" -version = "0.1.3" +version = "0.1.5" dependencies = [ "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "bit-set 0.5.2 (registry+https://github.com/rust-lang/crates.io-index)", @@ -969,7 +969,7 @@ dependencies = [ "bytes 0.4.12 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", "lewton 0.9.4 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-core 0.1.3", + "librespot-core 0.1.5", "librespot-tremor 0.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", @@ -980,7 +980,7 @@ dependencies = [ [[package]] name = "librespot-connect" -version = "0.1.3" +version = "0.1.5" dependencies = [ "aes-ctr 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -990,9 +990,9 @@ dependencies = [ "hmac 0.7.1 (registry+https://github.com/rust-lang/crates.io-index)", "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", "libmdns 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-core 0.1.3", - "librespot-playback 0.1.3", - "librespot-protocol 0.1.3", + "librespot-core 0.1.5", + "librespot-playback 0.1.5", + "librespot-protocol 0.1.5", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1007,7 +1007,7 @@ dependencies = [ [[package]] name = "librespot-core" -version = "0.1.3" +version = "0.1.5" dependencies = [ "aes 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "base64 0.10.1 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1020,7 +1020,7 @@ dependencies = [ "hyper 0.11.27 (registry+https://github.com/rust-lang/crates.io-index)", "hyper-proxy 0.4.1 (registry+https://github.com/rust-lang/crates.io-index)", "lazy_static 1.4.0 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-protocol 0.1.3", + "librespot-protocol 0.1.5", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "num-bigint 0.2.6 (registry+https://github.com/rust-lang/crates.io-index)", "num-integer 0.1.43 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1043,12 +1043,12 @@ dependencies = [ [[package]] name = "librespot-metadata" -version = "0.1.3" +version = "0.1.5" dependencies = [ "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", "futures 0.1.29 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-core 0.1.3", - "librespot-protocol 0.1.3", + "librespot-core 0.1.5", + "librespot-protocol 0.1.5", "linear-map 1.2.0 (registry+https://github.com/rust-lang/crates.io-index)", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1056,7 +1056,7 @@ dependencies = [ [[package]] name = "librespot-playback" -version = "0.1.3" +version = "0.1.5" dependencies = [ "alsa 0.2.2 (registry+https://github.com/rust-lang/crates.io-index)", "byteorder 1.3.4 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1068,9 +1068,9 @@ dependencies = [ "jack 0.5.7 (registry+https://github.com/rust-lang/crates.io-index)", "libc 0.2.73 (registry+https://github.com/rust-lang/crates.io-index)", "libpulse-sys 0.0.0 (registry+https://github.com/rust-lang/crates.io-index)", - "librespot-audio 0.1.3", - "librespot-core 0.1.3", - "librespot-metadata 0.1.3", + "librespot-audio 0.1.5", + "librespot-core 0.1.5", + "librespot-metadata 0.1.5", "log 0.4.11 (registry+https://github.com/rust-lang/crates.io-index)", "portaudio-rs 0.3.2 (registry+https://github.com/rust-lang/crates.io-index)", "rodio 0.9.0 (registry+https://github.com/rust-lang/crates.io-index)", @@ -1081,7 +1081,7 @@ dependencies = [ [[package]] name = "librespot-protocol" -version = "0.1.3" +version = "0.1.5" dependencies = [ "glob 0.3.0 (registry+https://github.com/rust-lang/crates.io-index)", "protobuf 2.14.0 (registry+https://github.com/rust-lang/crates.io-index)",