Fixed package updater to use release versions

This commit is contained in:
Krizsán Péter 2024-10-07 22:50:44 +02:00
parent 4c358e7724
commit a53f161b85
7 changed files with 31 additions and 55 deletions

View File

@ -3,7 +3,7 @@
# Add libtorrent-rasterbar
cp -fv networking/netlibs/libtorrent-rasterbar.xml ../blfs_root/blfs-xml/networking/netlibs
grep -qF libtorrent-rasterbar.xml ../blfs_root/blfs-xml/networking/netlibs/netlibs.xml || sed -i '/<\/chapter>.*/i <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="libtorrent-rasterbar.xml"/>' ../blfs_root/blfs-xml/networking/netlibs/netlibs.xml
grep -qF libtorrent-rasterbar-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY libtorrent-rasterbar-version "2.0.10-a3cdc51">' >> ../blfs_root/blfs-xml/packages.ent
grep -qF libtorrent-rasterbar-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY libtorrent-rasterbar-version "v2.0.10">' >> ../blfs_root/blfs-xml/packages.ent
# Add qBittorrent
cp -fv xsoft/other/qbittorrent.xml ../blfs_root/blfs-xml/xsoft/other
@ -13,7 +13,7 @@ grep -qF qbittorrent-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTIT
# Add pkcs11-helper
cp -fv postlfs/security/pkcs11-helper.xml ../blfs_root/blfs-xml/postlfs/security
grep -qF pkcs11-helper.xml ../blfs_root/blfs-xml/postlfs/security/security.xml || sed -i '/<\/chapter>.*/i <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="pkcs11-helper.xml"/>' ../blfs_root/blfs-xml/postlfs/security/security.xml
grep -qF pkcs11-helper-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY pkcs11-helper-version "1.30.0-d86851b">' >> ../blfs_root/blfs-xml/packages.ent
grep -qF pkcs11-helper-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY pkcs11-helper-version "1.30.0">' >> ../blfs_root/blfs-xml/packages.ent
# Add libid3tag
cp -fv multimedia/libdriv/libid3tag.xml ../blfs_root/blfs-xml/multimedia/libdriv
@ -28,14 +28,14 @@ grep -qF minidlna-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY m
# Add QMPlay2
cp -fv multimedia/videoutils/qmplay2.xml ../blfs_root/blfs-xml/multimedia/videoutils
grep -qF qmplay2.xml ../blfs_root/blfs-xml/multimedia/videoutils/videoutils.xml || sed -i '/<\/chapter>.*/i <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="qmplay2.xml"/>' ../blfs_root/blfs-xml/multimedia/videoutils/videoutils.xml
grep -qF qmplay2-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY qmplay2-version "24.06.16-f61024b">' >> ../blfs_root/blfs-xml/packages.ent
grep -qF qmplay2-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY qmplay2-version "24.06.16">' >> ../blfs_root/blfs-xml/packages.ent
# Add SDL2_ttf
cp -fv general/graphlib/sdl2-ttf.xml ../blfs_root/blfs-xml/general/graphlib
grep -qF sdl2-ttf.xml ../blfs_root/blfs-xml/general/graphlib/graphlib.xml || sed -i '/<\/chapter>.*/i <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sdl2-ttf.xml"/>' ../blfs_root/blfs-xml/general/graphlib/graphlib.xml
grep -qF sdl2-ttf-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY sdl2-ttf-version "2.22.0-aebd2d2">' >> ../blfs_root/blfs-xml/packages.ent
grep -qF sdl2-ttf-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY sdl2-ttf-version "2.22.0">' >> ../blfs_root/blfs-xml/packages.ent
# Add SDL2_image
cp -fv general/graphlib/sdl2-image.xml ../blfs_root/blfs-xml/general/graphlib
grep -qF sdl2-image.xml ../blfs_root/blfs-xml/general/graphlib/graphlib.xml || sed -i '/<\/chapter>.*/i <xi:include xmlns:xi="http://www.w3.org/2001/XInclude" href="sdl2-image.xml"/>' ../blfs_root/blfs-xml/general/graphlib/graphlib.xml
grep -qF sdl2-image-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY sdl2-image-version "2.8.2-6f45843">' >> ../blfs_root/blfs-xml/packages.ent
grep -qF sdl2-image-version ../blfs_root/blfs-xml/packages.ent || echo '<!ENTITY sdl2-image-version "2.8.2">' >> ../blfs_root/blfs-xml/packages.ent

View File

@ -4,7 +4,7 @@
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY sdl2-image-download-http "https://github.com/libsdl-org/SDL_image/archive/refs/heads/main.zip -O SDL2-image-2.8.2-6f45843.zip">
<!ENTITY sdl2-image-download-http "https://github.com/libsdl-org/SDL_image/releases/download/release-2.8.2/SDL2_image-2.8.2.tar.gz">
<!ENTITY sdl2-image-download-ftp " ">
<!ENTITY sdl2-image-md5sum " ">
<!ENTITY sdl2-image-size "12.6 MB">

View File

@ -4,7 +4,7 @@
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY sdl2-ttf-download-http "https://github.com/libsdl-org/SDL_ttf/archive/refs/heads/main.zip -O SDL2-ttf-2.22.0-aebd2d2.zip">
<!ENTITY sdl2-ttf-download-http "https://github.com/libsdl-org/SDL_ttf/releases/download/release-2.22.0/SDL2_ttf-2.22.0.tar.gz">
<!ENTITY sdl2-ttf-download-ftp " ">
<!ENTITY sdl2-ttf-md5sum " ">
<!ENTITY sdl2-ttf-size "12.6 MB">

View File

@ -4,7 +4,7 @@
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY qmplay2-download-http "https://github.com/zaps166/QMPlay2/archive/refs/heads/master.zip -O QMPlay2-24.06.16-f61024b.zip">
<!ENTITY qmplay2-download-http "https://github.com/zaps166/QMPlay2/releases/download/24.06.16/QMPlay2-src-24.06.16.tar.xz">
<!ENTITY qmplay2-download-ftp " ">
<!ENTITY qmplay2-md5sum " ">
<!ENTITY qmplay2-size "1.6 MB">

View File

@ -4,7 +4,7 @@
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY libtorrent-rasterbar-download-http "https://github.com/arvidn/libtorrent/archive/refs/heads/RC_2_0.zip -O libtorrent-rasterbar-2.0.10-a3cdc51.zip">
<!ENTITY libtorrent-rasterbar-download-http "https://github.com/arvidn/libtorrent/releases/download/v2.0.10/libtorrent-rasterbar-2.0.10.tar.gz">
<!ENTITY libtorrent-rasterbar-download-ftp " ">
<!ENTITY libtorrent-rasterbar-md5sum " ">
<!ENTITY libtorrent-rasterbar-size "4.2 MB">

View File

@ -4,7 +4,7 @@
<!ENTITY % general-entities SYSTEM "../../general.ent">
%general-entities;
<!ENTITY pkcs11-helper-download-http "https://github.com/OpenSC/pkcs11-helper/archive/refs/heads/master.zip -O pkcs11-helper-1.30.0-d86851b.zip">
<!ENTITY pkcs11-helper-download-http "https://github.com/OpenSC/pkcs11-helper/releases/download/pkcs11-helper-1.30.0/pkcs11-helper-1.30.0.tar.bz2">
<!ENTITY pkcs11-helper-download-ftp " ">
<!ENTITY pkcs11-helper-md5sum " ">
<!ENTITY pkcs11-helper-size "12.6 MB">

View File

@ -1,6 +1,21 @@
#!/bin/bash
# This script checks and updates the latest versions of the packages
# Function that gets the latest release of a specific package.
# This function works only with packages stored on github.
getLatestGithubRelease()
{
printf "\nUpdating package: $2\n"
URL="https://github.com/$1/releases"
URL=`curl -v --silent $URL 2>&1 | grep 'loading="lazy" src=' | tr '"' '\n' | grep /releases/ -m1`
URL="https://github.com`curl -v --silent $URL 2>&1 | grep '<a href=' | grep '.tar.' -m1 | tr '"' '\n' | grep /releases/`"
sed -i -E "s@($2-download-http \"+)(.+\">)@\1$URL\">@" ./$3/$2.xml
VER=`echo $URL | awk -F/ '{ print $(NF-1) }' | awk -F- '{ print $NF }'`
sed -i -E "s@($2-version \"+)(.+\">)@\1$VER\">@" add_packages.sh
echo "Latest version: $VER"
printf "Found package: $URL\n"
}
#minidlna
DOWNLOAD_URL=`curl -v --silent https://sourceforge.net/projects/minidlna/files/minidlna/ 2>&1 | grep net.sf.files | tr '"' '\n' | grep http -m1`
DOWNLOAD_URL="${DOWNLOAD_URL%/download}"
@ -18,30 +33,10 @@ DOWNLOAD_URL=$DOWNLOAD_URL/libid3tag-$LATEST_VERSION.tar.gz
sed -i -E "s@(libid3tag-download-http \"+)(.+\">)@\1$DOWNLOAD_URL\">@" ./multimedia/libdriv/libid3tag.xml
#pkcs11-helper
#DOWNLOAD_URL=`curl -v --silent https://github.com/OpenSC/pkcs11-helper/releases 2>&1 | grep src= | tr '"' '\n' | grep pkcs11-helper- | head -1`
#DOWNLOAD_URL="https://github.com`curl -v --silent $DOWNLOAD_URL 2>&1 | tr '"' '\n' | grep .tar.bz2 -m 1`"
#sed -i -E "s@(pkcs11-helper-download-http \"+)(.+\">)@\1$DOWNLOAD_URL\">@" ./postlfs/security/pkcs11-helper.xml
#LATEST_VERSION=`echo $DOWNLOAD_URL | tr '-' '\n' | tr '/' '\n' | grep '.tar.bz2'`
#LATEST_VERSION="${LATEST_VERSION%.tar.bz2}"
#sed -i -E "s@(pkcs11-helper-version \"+)(.+\">)@\1$LATEST_VERSION\">@" add_packages.sh
#pkcs11-helper
URL="https://github.com/OpenSC/pkcs11-helper/"
LAST_COMMIT=`curl -v --silent $URL 2>&1 | tr '"' '\n' | grep 'spoofed_commit_check' | awk -F/ '{ print $NF }' | cut -c1-7`
LAST_RELEASE=`curl -v --silent $URL 2>&1 | tr '"' '\n' | grep '/releases/tag' | awk -F\/ '{ print $NF }' | cut -c 15-`
LATEST_VERSION="$LAST_RELEASE-$LAST_COMMIT"
sed -i -E "s/(pkcs11-helper-version \"+)(.+\">)/\1$LATEST_VERSION\">/" add_packages.sh
DOWNLOAD_URL="https://github.com/OpenSC/pkcs11-helper/archive/refs/heads/master.zip -O pkcs11-helper-$LATEST_VERSION.zip"
sed -i -E "s@(pkcs11-helper-download-http \"+)(.+\">)@\1$DOWNLOAD_URL\">@" ./postlfs/security/pkcs11-helper.xml
getLatestGithubRelease OpenSC/pkcs11-helper pkcs11-helper postlfs/security
#QMPlay2
URL="https://github.com/zaps166/QMPlay2/"
LAST_COMMIT=`curl -v --silent $URL 2>&1 | tr '"' '\n' | grep 'spoofed_commit_check' | awk -F/ '{ print $NF }' | cut -c1-7`
LAST_RELEASE=`curl -v --silent $URL 2>&1 | tr '"' '\n' | grep '/releases/tag' | awk -F\/ '{ print $NF }'`
LATEST_VERSION="$LAST_RELEASE-$LAST_COMMIT"
sed -i -E "s/(qmplay2-version \"+)(.+\">)/\1$LATEST_VERSION\">/" add_packages.sh
DOWNLOAD_URL="https://github.com/zaps166/QMPlay2/archive/refs/heads/master.zip -O QMPlay2-$LATEST_VERSION.zip"
sed -i -E "s@(qmplay2-download-http \"+)(.+\">)@\1$DOWNLOAD_URL\">@" ./multimedia/videoutils/qmplay2.xml
getLatestGithubRelease zaps166/QMPlay2 qmplay2 multimedia/videoutils
#qBittorrent
URL="https://www.qbittorrent.org/download"
@ -53,31 +48,12 @@ LATEST_VERSION="${LATEST_VERSION%.tar.xz}"
sed -i -E "s@(qbittorrent-version \"+)(.+\">)@\1$LATEST_VERSION\">@" add_packages.sh
#libtorrent-rasterbar
URL="https://github.com/arvidn/libtorrent/"
LAST_COMMIT=`curl -v --silent $URL 2>&1 | tr '"' '\n' | grep 'spoofed_commit_check' | awk -F/ '{ print $NF }' | cut -c1-7`
LAST_RELEASE=`curl -v --silent $URL 2>&1 | tr '"' '\n' | grep '/releases/tag' | awk -F\/ '{ print $NF }' | cut -c 2-`
LATEST_VERSION="$LAST_RELEASE-$LAST_COMMIT"
sed -i -E "s/(libtorrent-rasterbar-version \"+)(.+\">)/\1$LATEST_VERSION\">/" add_packages.sh
DOWNLOAD_URL="https://github.com/arvidn/libtorrent/archive/refs/heads/RC_2_0.zip -O libtorrent-rasterbar-$LATEST_VERSION.zip"
sed -i -E "s@(libtorrent-rasterbar-download-http \"+)(.+\">)@\1$DOWNLOAD_URL\">@" ./networking/netlibs/libtorrent-rasterbar.xml
getLatestGithubRelease arvidn/libtorrent libtorrent-rasterbar networking/netlibs
#SDL2-image
URL="https://github.com/libsdl-org/SDL_image/"
LAST_COMMIT=`curl -v --silent $URL 2>&1 | tr '"' '\n' | grep 'spoofed_commit_check' | awk -F/ '{ print $NF }' | cut -c1-7`
LAST_RELEASE=`curl -v --silent $URL 2>&1 | tr '"' '\n' | grep '/releases/tag' | awk -F\/ '{ print $NF }' | cut -c 9-`
LATEST_VERSION="$LAST_RELEASE-$LAST_COMMIT"
sed -i -E "s/(sdl2-image-version \"+)(.+\">)/\1$LATEST_VERSION\">/" add_packages.sh
DOWNLOAD_URL="https://github.com/libsdl-org/SDL_image/archive/refs/heads/main.zip -O SDL2-image-$LATEST_VERSION.zip"
sed -i -E "s@(sdl2-image-download-http \"+)(.+\">)@\1$DOWNLOAD_URL\">@" ./general/graphlib/sdl2-image.xml
getLatestGithubRelease libsdl-org/SDL_image sdl2-image general/graphlib
#SDL2-ttf
URL="https://github.com/libsdl-org/SDL_ttf/"
LAST_COMMIT=`curl -v --silent $URL 2>&1 | tr '"' '\n' | grep 'spoofed_commit_check' | awk -F/ '{ print $NF }' | cut -c1-7`
LAST_RELEASE=`curl -v --silent $URL 2>&1 | tr '"' '\n' | grep '/releases/tag' | awk -F\/ '{ print $NF }' | cut -c 9-`
LATEST_VERSION="$LAST_RELEASE-$LAST_COMMIT"
sed -i -E "s/(sdl2-ttf-version \"+)(.+\">)/\1$LATEST_VERSION\">/" add_packages.sh
DOWNLOAD_URL="https://github.com/libsdl-org/SDL_ttf/archive/refs/heads/main.zip -O SDL2-ttf-$LATEST_VERSION.zip"
sed -i -E "s@(sdl2-ttf-download-http \"+)(.+\">)@\1$DOWNLOAD_URL\">@" ./general/graphlib/sdl2-ttf.xml
getLatestGithubRelease libsdl-org/SDL_ttf sdl2-ttf general/graphlib
# Patch scripts.xsl to handle -O parameter in wget urls
sed -i "s/BOOTPACKG=\$(basename \$URL)/BOOTPACKG=\$(basename \$URL | awk -F' ' '{ print \$NF}')/g" ../blfs_root/xsl/scripts.xsl