You are not logged in.
Pages: 1
Hello,
I'm attempting to write a PKGBUILD file for logitechmediaserver (stable version).
The source URL is in this file
https://github.com/LMS-Community/lms-se … stable.xml
<servers><win64 url="https://downloads.slimdevices.com/nightly/LogitechMediaServer-8.4.1-1708338002-win64.exe" version="8.4.1" revision="1708338002" size="16 MB"/><win url="https://downloads.slimdevices.com/nightly/LogitechMediaServer-8.4.1-1708338002.exe" version="8.4.1" revision="1708338002" size="70 MB"/><osx url="https://downloads.slimdevices.com/nightly/LogitechMediaServer-8.4.1-1708338002.pkg" version="8.4.1" revision="1708338002" size="44 MB"/><rpm url="https://downloads.slimdevices.com/nightly/logitechmediaserver-8.4.1-0.1.1708338002.noarch.rpm" version="8.4.1" revision="1708338002" size="87 MB"/><tararm url="https://downloads.slimdevices.com/nightly/logitechmediaserver-8.4.1-1708338002-arm-linux.tgz" version="8.4.1" revision="1708338002" size="56 MB"/><nocpan url="https://downloads.slimdevices.com/nightly/logitechmediaserver-8.4.1-1708338002-noCPAN.tgz" version="8.4.1" revision="1708338002" size="17 MB"/><src url="https://downloads.slimdevices.com/nightly/logitechmediaserver-8.4.1-1708338002.tgz" version="8.4.1" revision="1708338002" size="119 MB"/><deb url="https://downloads.slimdevices.com/nightly/logitechmediaserver_8.4.1~1708338002_all.deb" version="8.4.1" revision="1708338002" size="57 MB"/><debamd64 url="https://downloads.slimdevices.com/nightly/logitechmediaserver_8.4.1~1708338002_amd64.deb" version="8.4.1" revision="1708338002" size="25 MB"/><debarm url="https://downloads.slimdevices.com/nightly/logitechmediaserver_8.4.1~1708338002_arm.deb" version="8.4.1" revision="1708338002" size="32 MB"/><debi386 url="https://downloads.slimdevices.com/nightly/logitechmediaserver_8.4.1~1708338002_i386.deb" version="8.4.1" revision="1708338002" size="18 MB"/></servers>Specifically this part
<src url="https://downloads.slimdevices.com/nightly/logitechmediaserver-8.4.1-1708338002.tgz" version="8.4.1" revision="1708338002" size="119 MB"/>What's the best way to extract url, version and revision?
Thank you. Simon.
Last edited by simonhiggs (2024-02-22 08:42:47)
Offline
There is an existing package: https://aur.archlinux.org/packages/logitechmediaserver
Any reason why you're creating a new one?
Offline
The existing package is for the Logitech 8.4.0 release. I want to follow the 8.4.1 Community (stable) version.
Offline
Have you looked at xq for the XML parsing? Although the data also appears to be available through JSON and for that you could use jq.
The existing package is for the Logitech 8.4.0 release. I want to follow the 8.4.1 Community (stable) version.
The 8.4.1 is a nightly build of the 8.4 branch until 8.4.1 is released?
Offline
sed 's/.*<src url="\([^"]*\)".*/\1/' original.xmlThis is the url - but the version and revision are included in it already.
Last edited by Trilby (2024-02-22 14:06:27)
"UNIX is simple and coherent" - Dennis Ritchie; "GNU's Not Unix" - Richard Stallman
Offline
You can also use xmlstarlet and require it as a build dependency:
$ curl https://raw.githubusercontent.com/LMS-Community/lms-server-repository/master/stable.xml | xmlstarlet sel -t -v "/servers/src/@url" -Inofficial first vice president of the Rust Evangelism Strike Force
Offline
Have you looked at xq for the XML parsing?
Thanks for this, and the other suggestions too.
simon@macmini ~ % curl -s -L https://github.com/LMS-Community/lms-server-repository/raw/master/stable.xml | xq -e /servers/src/@url
https://downloads.slimdevices.com/nightly/logitechmediaserver-8.4.1-1708338002.tgzOffline
sed 's/.*<src url="\([^"]*\)".*/\1/' original.xml
This reminded me of my favorite Stack Overflow answer.
That one had me in tears when first read back in the day.
Offline
Pages: 1