Skip to content
Snippets Groups Projects
Select Git revision
  • 7d4c669a74f78bfa3eae882be0724833a5afb2cf
  • master default protected
  • release/202005
  • release/202001
  • release/201912
  • release/windows-test/201910
  • release/201908
  • release/201906
  • release/201905
  • release/201904
  • release/201903
  • release/201902
  • release/201901
  • release/201812
  • release/201811
  • release/201808
  • releases/beta1
  • packaging
  • releases/alpha
  • 1.0.0
  • 0.2.0
  • 0.1.0
22 results

sparkle-xml-updater.sh

Blame
  • user avatar
    Alexandre Lision authored
    This commits brings optionnal linking against Sparkle framework.
    This framework is used to autoupdate apps not present in the Mac app store
    
    Refs #75349
    
    Change-Id: I82b14757c106f1282d91e631927057d00989feb7
    3d4143a5
    History
    Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    sparkle-xml-updater.sh 1.41 KiB
    #!/bin/bash
    
    # Take the package to add as argument ./sparkle-xml-updater.sh ring.dmg
    
    REPO_FOLDER=<dir>
    SPARKLE_FILE=<xml_filename>
    REPO_URL=<url>
    PACKAGE=$1
    DSA_KEY=<path_to_key_file>
    
    if [ ! -f ${PACKAGE} -o ! -f ${DSA_KEY} ]; then
        echo "Can't find package or dsa key, aborting..."
        exit 1
    fi
    
    if [ -f ${REPO_FOLDER}/${SPARKLE_FILE} ]; then
        ITEMS=$(sed -n "/<item>/,/<\/item>/p" ${REPO_FOLDER}/${SPARKLE_FILE}) 
    fi
    
    cat << EOFILE > ${REPO_FOLDER}/${SPARKLE_FILE}
    <?xml version="1.0" encoding="utf-8"?>
    <rss version="2.0" xmlns:sparkle="http://www.andymatuschak.org/xml-namespaces/sparkle" xmlns:dc="http://purl.org/dc/elements/1.1/">
        <channel>
            <title>Ring - nightly</title>
            <link>${REPO_URL}/${SPARKLE_FILE}</link>
            <description>Most recent changes with links to updates.</description>
            <language>en</language>
            <item>
                <title>Ring nightly $(date "+%Y/%m/%d %H:%M")</title>
                <pubDate>$(date -R)</pubDate>
                <enclosure url="${REPO_URL}/$(basename ${PACKAGE})" sparkle:version="$(date +%Y%m%d%H%M)" sparkle:shortVersionString="nightly-$(date "+%Y%m%d")" length="$(stat -c %s ${PACKAGE})" type="application/octet-stream" sparkle:dsaSignature="$(/opt/joulupukki/mac_keys/sign_update.sh ${PACKAGE} ${DSA_KEY})" />
                <sparkle:minimumSystemVersion>10.7</sparkle:minimumSystemVersion>
            </item>
    $(echo -e "${ITEMS}")
        </channel>
    </rss>
    EOFILE