Browse Source

contrib: reformat most shell scripts

Mostly just indentations.
For consistency, to conform to .editorconfig.
patch-4
SomberNight 2 years ago
parent
commit
b5900eae98
No known key found for this signature in database GPG Key ID: B33B5F232C6271E9
  1. 2
      contrib/android/make_apk.sh
  2. 37
      contrib/build-linux/appimage/make_appimage.sh
  3. 9
      contrib/build-linux/sdist/make_sdist.sh
  4. 2
      contrib/build-wine/build-electrum-git.sh
  5. 18
      contrib/build-wine/sign.sh
  6. 2
      contrib/build-wine/unsign.sh
  7. 32
      contrib/build_tools_util.sh
  8. 14
      contrib/freeze_containers_distro.sh
  9. 2
      contrib/freeze_packages.sh
  10. 2
      contrib/make_packages.sh
  11. 4
      contrib/osx/make_osx.sh
  12. 64
      contrib/osx/notarize_app.sh
  13. 36
      contrib/osx/package.sh
  14. 12
      contrib/release.sh
  15. 2
      contrib/upload.sh

2
contrib/android/make_apk.sh

@ -15,7 +15,7 @@ LOCALE="$PROJECT_ROOT"/electrum/locale/
export ELEC_APK_GUI=$1 export ELEC_APK_GUI=$1
if [ ! -d "$PACKAGES" ]; then if [ ! -d "$PACKAGES" ]; then
"$CONTRIB"/make_packages.sh || fail "make_packages failed" "$CONTRIB"/make_packages.sh || fail "make_packages failed"
fi fi
pushd "$PROJECT_ROOT" pushd "$PROJECT_ROOT"

37
contrib/build-linux/appimage/make_appimage.sh

@ -18,8 +18,7 @@ PYTHON_VERSION=3.9.11
PY_VER_MAJOR="3.9" # as it appears in fs paths PY_VER_MAJOR="3.9" # as it appears in fs paths
PKG2APPIMAGE_COMMIT="a9c85b7e61a3a883f4a35c41c5decb5af88b6b5d" PKG2APPIMAGE_COMMIT="a9c85b7e61a3a883f4a35c41c5decb5af88b6b5d"
VERSION=$(git describe --tags --dirty --always)
VERSION=`git describe --tags --dirty --always`
APPIMAGE="$DISTDIR/electrum-$VERSION-x86_64.AppImage" APPIMAGE="$DISTDIR/electrum-$VERSION-x86_64.AppImage"
. "$CONTRIB"/build_tools_util.sh . "$CONTRIB"/build_tools_util.sh
@ -52,11 +51,11 @@ tar xf "$CACHEDIR/Python-$PYTHON_VERSION.tar.xz" -C "$BUILDDIR"
# Patch taken from Ubuntu http://archive.ubuntu.com/ubuntu/pool/main/p/python3.9/python3.9_3.9.5-3~21.04.debian.tar.xz # Patch taken from Ubuntu http://archive.ubuntu.com/ubuntu/pool/main/p/python3.9/python3.9_3.9.5-3~21.04.debian.tar.xz
patch -p1 < "$CONTRIB_APPIMAGE/patches/python-3.9-reproducible-buildinfo.diff" patch -p1 < "$CONTRIB_APPIMAGE/patches/python-3.9-reproducible-buildinfo.diff"
./configure \ ./configure \
--cache-file="$CACHEDIR/python.config.cache" \ --cache-file="$CACHEDIR/python.config.cache" \
--prefix="$APPDIR/usr" \ --prefix="$APPDIR/usr" \
--enable-ipv6 \ --enable-ipv6 \
--enable-shared \ --enable-shared \
-q -q
make -j4 -s || fail "Could not build Python" make -j4 -s || fail "Could not build Python"
make -s install > /dev/null || fail "Could not install Python" make -s install > /dev/null || fail "Could not install Python"
# When building in docker on macOS, python builds with .exe extension because the # When building in docker on macOS, python builds with .exe extension because the
@ -73,10 +72,10 @@ cp -f "$PROJECT_ROOT/electrum/libsecp256k1.so.0" "$APPDIR/usr/lib/libsecp256k1.s
appdir_python() { appdir_python() {
env \ env \
PYTHONNOUSERSITE=1 \ PYTHONNOUSERSITE=1 \
LD_LIBRARY_PATH="$APPDIR/usr/lib:$APPDIR/usr/lib/x86_64-linux-gnu${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}" \ LD_LIBRARY_PATH="$APPDIR/usr/lib:$APPDIR/usr/lib/x86_64-linux-gnu${LD_LIBRARY_PATH+:$LD_LIBRARY_PATH}" \
"$APPDIR/usr/bin/python${PY_VER_MAJOR}" "$@" "$APPDIR/usr/bin/python${PY_VER_MAJOR}" "$@"
} }
python='appdir_python' python='appdir_python'
@ -173,17 +172,17 @@ info "stripping binaries from debug symbols."
# "-R .comment" also strips the GCC version information # "-R .comment" also strips the GCC version information
strip_binaries() strip_binaries()
{ {
chmod u+w -R "$APPDIR" chmod u+w -R "$APPDIR"
{ {
printf '%s\0' "$APPDIR/usr/bin/python${PY_VER_MAJOR}" printf '%s\0' "$APPDIR/usr/bin/python${PY_VER_MAJOR}"
find "$APPDIR" -type f -regex '.*\.so\(\.[0-9.]+\)?$' -print0 find "$APPDIR" -type f -regex '.*\.so\(\.[0-9.]+\)?$' -print0
} | xargs -0 --no-run-if-empty --verbose strip -R .note.gnu.build-id -R .comment } | xargs -0 --no-run-if-empty --verbose strip -R .note.gnu.build-id -R .comment
} }
strip_binaries strip_binaries
remove_emptydirs() remove_emptydirs()
{ {
find "$APPDIR" -type d -empty -print0 | xargs -0 --no-run-if-empty rmdir -vp --ignore-fail-on-non-empty find "$APPDIR" -type d -empty -print0 | xargs -0 --no-run-if-empty rmdir -vp --ignore-fail-on-non-empty
} }
remove_emptydirs remove_emptydirs
@ -200,8 +199,8 @@ rm -rf "$PYDIR"/site-packages/Cryptodome/SelfTest
rm -rf "$PYDIR"/site-packages/{psutil,qrcode,websocket}/tests rm -rf "$PYDIR"/site-packages/{psutil,qrcode,websocket}/tests
# rm lots of unused parts of Qt/PyQt. (assuming PyQt 5.15.3+ layout) # rm lots of unused parts of Qt/PyQt. (assuming PyQt 5.15.3+ layout)
for component in connectivity declarative help location multimedia quickcontrols2 serialport webengine websockets xmlpatterns ; do for component in connectivity declarative help location multimedia quickcontrols2 serialport webengine websockets xmlpatterns ; do
rm -rf "$PYDIR"/site-packages/PyQt5/Qt5/translations/qt${component}_* rm -rf "$PYDIR"/site-packages/PyQt5/Qt5/translations/qt${component}_*
rm -rf "$PYDIR"/site-packages/PyQt5/Qt5/resources/qt${component}_* rm -rf "$PYDIR"/site-packages/PyQt5/Qt5/resources/qt${component}_*
done done
rm -rf "$PYDIR"/site-packages/PyQt5/Qt5/{qml,libexec} rm -rf "$PYDIR"/site-packages/PyQt5/Qt5/{qml,libexec}
rm -rf "$PYDIR"/site-packages/PyQt5/{pyrcc*.so,pylupdate*.so,uic} rm -rf "$PYDIR"/site-packages/PyQt5/{pyrcc*.so,pylupdate*.so,uic}

9
contrib/build-linux/sdist/make_sdist.sh

@ -21,7 +21,7 @@ python3 -m pip install --upgrade pip
rm -rf "$PROJECT_ROOT/packages/" rm -rf "$PROJECT_ROOT/packages/"
if ([ "$OMIT_UNCLEAN_FILES" != 1 ]); then if ([ "$OMIT_UNCLEAN_FILES" != 1 ]); then
"$CONTRIB"/make_packages.sh || fail "make_packages failed" "$CONTRIB"/make_packages.sh || fail "make_packages failed"
fi fi
git submodule update --init git submodule update --init
@ -48,9 +48,10 @@ fi
find -exec touch -h -d '2000-11-11T11:11:11+00:00' {} + find -exec touch -h -d '2000-11-11T11:11:11+00:00' {} +
# note: .zip sdists would not be reproducible due to https://bugs.python.org/issue40963 # note: .zip sdists would not be reproducible due to https://bugs.python.org/issue40963
if ([ "$OMIT_UNCLEAN_FILES" = 1 ]) if ([ "$OMIT_UNCLEAN_FILES" = 1 ]); then
then PY_DISTDIR="dist/_sourceonly" # The DISTDIR variable of this script is only used to find where the output is *finally* placed. PY_DISTDIR="dist/_sourceonly" # The DISTDIR variable of this script is only used to find where the output is *finally* placed.
else PY_DISTDIR="dist" else
PY_DISTDIR="dist"
fi fi
TZ=UTC faketime -f '2000-11-11 11:11:11' python3 setup.py --quiet sdist --format=gztar --dist-dir="$PY_DISTDIR" TZ=UTC faketime -f '2000-11-11 11:11:11' python3 setup.py --quiet sdist --format=gztar --dist-dir="$PY_DISTDIR"
if ([ "$OMIT_UNCLEAN_FILES" = 1 ]); then if ([ "$OMIT_UNCLEAN_FILES" = 1 ]); then

2
contrib/build-wine/build-electrum-git.sh

@ -12,7 +12,7 @@ set -e
pushd $WINEPREFIX/drive_c/electrum pushd $WINEPREFIX/drive_c/electrum
VERSION=`git describe --tags --dirty --always` VERSION=$(git describe --tags --dirty --always)
info "Last commit: $VERSION" info "Last commit: $VERSION"
# Load electrum-locale for this release # Load electrum-locale for this release

18
contrib/build-wine/sign.sh

@ -29,14 +29,14 @@ echo "Found $(ls *.exe | wc -w) files to sign."
for f in $(ls *.exe); do for f in $(ls *.exe); do
echo "Signing $f..." echo "Signing $f..."
osslsigncode sign \ osslsigncode sign \
-pass $WIN_SIGNING_PASSWORD\ -pass "$WIN_SIGNING_PASSWORD" \
-h sha256 \ -h sha256 \
-certs "$CERT_FILE" \ -certs "$CERT_FILE" \
-key "$KEY_FILE" \ -key "$KEY_FILE" \
-n "Electrum" \ -n "Electrum" \
-i "https://electrum.org/" \ -i "https://electrum.org/" \
-t "http://timestamp.digicert.com/" \ -t "http://timestamp.digicert.com/" \
-in "$f" \ -in "$f" \
-out "../signed/$f" -out "../signed/$f"
ls ../signed/$f -lah ls ../signed/$f -lah
done done

2
contrib/build-wine/unsign.sh

@ -14,7 +14,7 @@ set -e
mkdir -p signed >/dev/null 2>&1 mkdir -p signed >/dev/null 2>&1
mkdir -p signed/stripped >/dev/null 2>&1 mkdir -p signed/stripped >/dev/null 2>&1
version=`python3 -c "import electrum; print(electrum.version.ELECTRUM_VERSION)"` version=$(python3 -c "import electrum; print(electrum.version.ELECTRUM_VERSION)")
echo "Found $(ls dist/*.exe | wc -w) files to verify." echo "Found $(ls dist/*.exe | wc -w) files to verify."

32
contrib/build_tools_util.sh

@ -23,7 +23,7 @@ function warn {
function verify_signature() { function verify_signature() {
local file=$1 keyring=$2 out= local file=$1 keyring=$2 out=
if out=$(gpg --no-default-keyring --keyring "$keyring" --status-fd 1 --verify "$file" 2>/dev/null) && if out=$(gpg --no-default-keyring --keyring "$keyring" --status-fd 1 --verify "$file" 2>/dev/null) &&
echo "$out" | grep -qs "^\[GNUPG:\] VALIDSIG "; then echo "$out" | grep -qs "^\[GNUPG:\] VALIDSIG "; then
return 0 return 0
else else
echo "$out" >&2 echo "$out" >&2
@ -52,23 +52,23 @@ function download_if_not_exist() {
# https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/templates/header.sh # https://github.com/travis-ci/travis-build/blob/master/lib/travis/build/templates/header.sh
function retry() { function retry() {
local result=0 local result=0
local count=1 local count=1
while [ $count -le 3 ]; do while [ $count -le 3 ]; do
[ $result -ne 0 ] && { [ $result -ne 0 ] && {
echo -e "\nThe command \"$@\" failed. Retrying, $count of 3.\n" >&2 echo -e "\nThe command \"$@\" failed. Retrying, $count of 3.\n" >&2
}
! { "$@"; result=$?; }
[ $result -eq 0 ] && break
count=$(($count + 1))
sleep 1
done
[ $count -gt 3 ] && {
echo -e "\nThe command \"$@\" failed 3 times.\n" >&2
} }
! { "$@"; result=$?; }
[ $result -eq 0 ] && break
count=$(($count + 1))
sleep 1
done
[ $count -gt 3 ] && { return $result
echo -e "\nThe command \"$@\" failed 3 times.\n" >&2
}
return $result
} }
function gcc_with_triplet() function gcc_with_triplet()

14
contrib/freeze_containers_distro.sh

@ -5,23 +5,23 @@
set -e set -e
DEBIAN_SNAPSHOT_BASE="https://snapshot.debian.org/archive/debian/" DEBIAN_SNAPSHOT_BASE="https://snapshot.debian.org/archive/debian/"
DEBIAN_APPIMAGE_DISTRO="buster" # should match build-linux/appimage Dockerfile base DEBIAN_APPIMAGE_DISTRO="buster" # should match build-linux/appimage Dockerfile base
DEBIAN_WINE_DISTRO="bullseye" # should match build-wine Dockerfile base DEBIAN_WINE_DISTRO="bullseye" # should match build-wine Dockerfile base
DEBIAN_ANDROID_DISTRO="bullseye" # should match android Dockerfile base DEBIAN_ANDROID_DISTRO="bullseye" # should match android Dockerfile base
contrib=$(dirname "$0") contrib=$(dirname "$0")
if [ ! -x /bin/wget ]; then if [ ! -x /bin/wget ]; then
echo "no wget" echo "no wget"
exit 1 exit 1
fi fi
DEBIAN_SNAPSHOT_LATEST=$(wget -O- ${DEBIAN_SNAPSHOT_BASE}$(date +"?year=%Y&month=%m") 2>/dev/null|grep "^<a href=\"20"|tail -1|sed -e 's#[^"]*"\(.\{17,17\}\).*#\1#') DEBIAN_SNAPSHOT_LATEST=$(wget -O- ${DEBIAN_SNAPSHOT_BASE}$(date +"?year=%Y&month=%m") 2>/dev/null | grep "^<a href=\"20" | tail -1 | sed -e 's#[^"]*"\(.\{17,17\}\).*#\1#')
if [ "${DEBIAN_SNAPSHOT_LATEST}x" = "x" ]; then if [ "${DEBIAN_SNAPSHOT_LATEST}x" = "x" ]; then
echo "could not find timestamp for debian packages" echo "could not find timestamp for debian packages"
exit 1 exit 1
fi fi
DEBIAN_SNAPSHOT=${DEBIAN_SNAPSHOT_BASE}${DEBIAN_SNAPSHOT_LATEST} DEBIAN_SNAPSHOT=${DEBIAN_SNAPSHOT_BASE}${DEBIAN_SNAPSHOT_LATEST}

2
contrib/freeze_packages.sh

@ -13,7 +13,7 @@ else
SYSTEM_PYTHON=$(which $SYSTEM_PYTHON) || printf "" SYSTEM_PYTHON=$(which $SYSTEM_PYTHON) || printf ""
fi fi
if [[ ! "$SYSTEM_PYTHON" ]] ; then if [[ ! "$SYSTEM_PYTHON" ]] ; then
echo "Please specify which python to use in \$SYSTEM_PYTHON" && exit 1; echo "Please specify which python to use in \$SYSTEM_PYTHON" && exit 1
fi fi
which virtualenv > /dev/null 2>&1 || { echo "Please install virtualenv" && exit 1; } which virtualenv > /dev/null 2>&1 || { echo "Please install virtualenv" && exit 1; }

2
contrib/make_packages.sh

@ -10,7 +10,7 @@ PACKAGES="$PROJECT_ROOT"/packages/
test -n "$CONTRIB" -a -d "$CONTRIB" || exit test -n "$CONTRIB" -a -d "$CONTRIB" || exit
if [ -d "$PACKAGES" ]; then if [ -d "$PACKAGES" ]; then
rm -r "$PACKAGES" rm -r "$PACKAGES"
fi fi
# create virtualenv # create virtualenv

4
contrib/osx/make_osx.sh

@ -73,7 +73,7 @@ if [ ! -f "$CACHEDIR/$PKG_FILE" ]; then
curl -o "$CACHEDIR/$PKG_FILE" "https://www.python.org/ftp/python/${PYTHON_VERSION}/$PKG_FILE" curl -o "$CACHEDIR/$PKG_FILE" "https://www.python.org/ftp/python/${PYTHON_VERSION}/$PKG_FILE"
fi fi
echo "c2073d44c404c661dadbf0cbda55c6e7d681baba9178ed1bdb126d34caa898a9 $CACHEDIR/$PKG_FILE" | shasum -a 256 -c \ echo "c2073d44c404c661dadbf0cbda55c6e7d681baba9178ed1bdb126d34caa898a9 $CACHEDIR/$PKG_FILE" | shasum -a 256 -c \
|| fail "python pkg checksum mismatched" || fail "python pkg checksum mismatched"
sudo installer -pkg "$CACHEDIR/$PKG_FILE" -target / \ sudo installer -pkg "$CACHEDIR/$PKG_FILE" -target / \
|| fail "failed to install python" || fail "failed to install python"
@ -232,7 +232,7 @@ find "$VENV_DIR/lib/python$PY_VER_MAJOR/site-packages/" -type f -name '*.so' -pr
info "Faking timestamps..." info "Faking timestamps..."
find . -exec touch -t '200101220000' {} + || true find . -exec touch -t '200101220000' {} + || true
VERSION=`git describe --tags --dirty --always` VERSION=$(git describe --tags --dirty --always)
info "Building binary" info "Building binary"
ELECTRUM_VERSION=$VERSION pyinstaller --noconfirm --ascii --clean contrib/osx/osx.spec || fail "Could not build binary" ELECTRUM_VERSION=$VERSION pyinstaller --noconfirm --ascii --clean contrib/osx/osx.spec || fail "Could not build binary"

64
contrib/osx/notarize_app.sh

@ -24,53 +24,57 @@ ditto -c -k --rsrc --keepParent "$APP_BUNDLE" "${APP_BUNDLE}.zip"
# Submit for notarization # Submit for notarization
echo "Submitting $APP_BUNDLE for notarization..." echo "Submitting $APP_BUNDLE for notarization..."
RESULT=$(xcrun altool --notarize-app --type osx \ RESULT=$(xcrun altool --notarize-app --type osx \
--file "${APP_BUNDLE}.zip" \ --file "${APP_BUNDLE}.zip" \
--primary-bundle-id org.electrum.electrum \ --primary-bundle-id org.electrum.electrum \
--username $APPLE_ID_USER \ --username $APPLE_ID_USER \
--password @env:APPLE_ID_PASSWORD \ --password @env:APPLE_ID_PASSWORD \
--output-format xml) --output-format xml
)
if [ $? -ne 0 ]; then if [ $? -ne 0 ]; then
echo "Submitting $APP_BUNDLE failed:" echo "Submitting $APP_BUNDLE failed:"
echo "$RESULT" echo "$RESULT"
exit 1 exit 1
fi fi
REQUEST_UUID=$(echo "$RESULT" | xpath \ REQUEST_UUID=$(echo "$RESULT" | xpath \
"//key[normalize-space(text()) = 'RequestUUID']/following-sibling::string[1]/text()" 2> /dev/null) "//key[normalize-space(text()) = 'RequestUUID']/following-sibling::string[1]/text()" 2>/dev/null
)
if [ -z "$REQUEST_UUID" ]; then if [ -z "$REQUEST_UUID" ]; then
echo "Submitting $APP_BUNDLE failed:" echo "Submitting $APP_BUNDLE failed:"
echo "$RESULT" echo "$RESULT"
exit 1 exit 1
fi fi
echo "$(echo "$RESULT" | xpath \ echo "$(echo "$RESULT" | xpath \
"//key[normalize-space(text()) = 'success-message']/following-sibling::string[1]/text()" 2> /dev/null)" "//key[normalize-space(text()) = 'success-message']/following-sibling::string[1]/text()" 2> /dev/null)"
# Poll for notarization status # Poll for notarization status
echo "Submitted notarization request $REQUEST_UUID, waiting for response..." echo "Submitted notarization request $REQUEST_UUID, waiting for response..."
sleep 60 sleep 60
while : while :
do do
RESULT=$(xcrun altool --notarization-info "$REQUEST_UUID" \ RESULT=$(xcrun altool --notarization-info "$REQUEST_UUID" \
--username "$APPLE_ID_USER" \ --username "$APPLE_ID_USER" \
--password @env:APPLE_ID_PASSWORD \ --password @env:APPLE_ID_PASSWORD \
--output-format xml) --output-format xml
STATUS=$(echo "$RESULT" | xpath \ )
"//key[normalize-space(text()) = 'Status']/following-sibling::string[1]/text()" 2> /dev/null) STATUS=$(echo "$RESULT" | xpath \
"//key[normalize-space(text()) = 'Status']/following-sibling::string[1]/text()" 2>/dev/null
)
if [ "$STATUS" = "success" ]; then if [ "$STATUS" = "success" ]; then
echo "Notarization of $APP_BUNDLE succeeded!" echo "Notarization of $APP_BUNDLE succeeded!"
break break
elif [ "$STATUS" = "in progress" ]; then elif [ "$STATUS" = "in progress" ]; then
echo "Notarization in progress..." echo "Notarization in progress..."
sleep 20 sleep 20
else else
echo "Notarization of $APP_BUNDLE failed:" echo "Notarization of $APP_BUNDLE failed:"
echo "$RESULT" echo "$RESULT"
exit 1 exit 1
fi fi
done done
# Staple the notary ticket # Staple the notary ticket

36
contrib/osx/package.sh

@ -31,26 +31,26 @@ fi
mkdir -p ~/bin mkdir -p ~/bin
if ! which ${genisoimage} > /dev/null 2>&1; then if ! which ${genisoimage} > /dev/null 2>&1; then
mkdir -p /tmp/electrum-macos mkdir -p /tmp/electrum-macos
cd /tmp/electrum-macos cd /tmp/electrum-macos
info "Downloading cdrkit $cdrkit_version" info "Downloading cdrkit $cdrkit_version"
wget -nc ${cdrkit_download_path}/${cdrkit_file_name} wget -nc ${cdrkit_download_path}/${cdrkit_file_name}
tar xvf ${cdrkit_file_name} tar xvf ${cdrkit_file_name}
info "Patching genisoimage" info "Patching genisoimage"
cd cdrkit-${cdrkit_version} cd cdrkit-${cdrkit_version}
patch -p1 < $CONTRIB/osx/cdrkit-deterministic.patch patch -p1 <$CONTRIB/osx/cdrkit-deterministic.patch
info "Building genisoimage" info "Building genisoimage"
cmake . -Wno-dev cmake . -Wno-dev
make genisoimage make genisoimage
cp genisoimage/genisoimage ~/bin/${genisoimage} cp genisoimage/genisoimage ~/bin/${genisoimage}
fi fi
if ! which dmg > /dev/null 2>&1; then if ! which dmg > /dev/null 2>&1; then
mkdir -p /tmp/electrum-macos mkdir -p /tmp/electrum-macos
cd /tmp/electrum-macos cd /tmp/electrum-macos
info "Downloading libdmg" info "Downloading libdmg"
LD_PRELOAD= git clone ${libdmg_url} LD_PRELOAD= git clone ${libdmg_url}
cd libdmg-hfsplus cd libdmg-hfsplus
info "Building libdmg" info "Building libdmg"
@ -60,11 +60,11 @@ if ! which dmg > /dev/null 2>&1; then
fi fi
${genisoimage} -version || fail "Unable to install genisoimage" ${genisoimage} -version || fail "Unable to install genisoimage"
dmg -|| fail "Unable to install libdmg" dmg - || fail "Unable to install libdmg"
plist=$1/Contents/Info.plist plist=$1/Contents/Info.plist
test -f "$plist" || fail "Info.plist not found" test -f "$plist" || fail "Info.plist not found"
VERSION=$(grep -1 ShortVersionString $plist |tail -1|gawk 'match($0, /<string>(.*)<\/string>/, a) {print a[1]}') VERSION=$(grep -1 ShortVersionString $plist | tail -1 | gawk 'match($0, /<string>(.*)<\/string>/, a) {print a[1]}')
echo $VERSION echo $VERSION
rm -rf /tmp/electrum-macos/image > /dev/null 2>&1 rm -rf /tmp/electrum-macos/image > /dev/null 2>&1

12
contrib/release.sh

@ -73,9 +73,9 @@ if [ ! -z "$RELEASEMANAGER" ] ; then
fi fi
VERSION=`python3 -c "import electrum; print(electrum.version.ELECTRUM_VERSION)"` VERSION=$(python3 -c "import electrum; print(electrum.version.ELECTRUM_VERSION)")
info "VERSION: $VERSION" info "VERSION: $VERSION"
REV=`git describe --tags` REV=$(git describe --tags)
info "REV: $REV" info "REV: $REV"
COMMIT=$(git rev-parse HEAD) COMMIT=$(git rev-parse HEAD)
@ -95,7 +95,7 @@ tarball="Electrum-$VERSION.tar.gz"
if test -f "dist/$tarball"; then if test -f "dist/$tarball"; then
info "file exists: $tarball" info "file exists: $tarball"
else else
./contrib/build-linux/sdist/build.sh ./contrib/build-linux/sdist/build.sh
fi fi
# create source-only tarball # create source-only tarball
@ -103,7 +103,7 @@ srctarball="Electrum-sourceonly-$VERSION.tar.gz"
if test -f "dist/$srctarball"; then if test -f "dist/$srctarball"; then
info "file exists: $srctarball" info "file exists: $srctarball"
else else
OMIT_UNCLEAN_FILES=1 ./contrib/build-linux/sdist/build.sh OMIT_UNCLEAN_FILES=1 ./contrib/build-linux/sdist/build.sh
fi fi
# appimage # appimage
@ -184,7 +184,7 @@ sha256sum contrib/build-wine/dist/*.exe
echo -n "proceed (y/n)? " echo -n "proceed (y/n)? "
read answer read answer
if [ "$answer" != "y" ] ;then if [ "$answer" != "y" ]; then
echo "exit" echo "exit"
exit 1 exit 1
fi fi
@ -250,7 +250,7 @@ else
info "updating www repo" info "updating www repo"
./contrib/make_download $WWW_DIR ./contrib/make_download $WWW_DIR
info "signing the version announcement file" info "signing the version announcement file"
sig=`./run_electrum -o signmessage $ELECTRUM_SIGNING_ADDRESS $VERSION -w $ELECTRUM_SIGNING_WALLET` sig=$(./run_electrum -o signmessage $ELECTRUM_SIGNING_ADDRESS $VERSION -w $ELECTRUM_SIGNING_WALLET)
echo "{ \"version\":\"$VERSION\", \"signatures\":{ \"$ELECTRUM_SIGNING_ADDRESS\":\"$sig\"}}" > $WWW_DIR/version echo "{ \"version\":\"$VERSION\", \"signatures\":{ \"$ELECTRUM_SIGNING_ADDRESS\":\"$sig\"}}" > $WWW_DIR/version

2
contrib/upload.sh

@ -15,7 +15,7 @@ fi
cd "$PROJECT_ROOT" cd "$PROJECT_ROOT"
version=`git describe --tags --abbrev=0` version=$(git describe --tags --abbrev=0)
echo $version echo $version
if [ -z "$ELECBUILD_UPLOADFROM" ]; then if [ -z "$ELECBUILD_UPLOADFROM" ]; then

Loading…
Cancel
Save