APPDATA: migrated to METAINFO

This commit is contained in:
XargonWan 2025-01-30 13:36:33 +09:00
parent 0e8f7361b1
commit 8b21326bb4
14 changed files with 65 additions and 62 deletions

View file

@ -15,7 +15,7 @@ on:
- 'rd-submodules/**' - 'rd-submodules/**'
- '*.sh' - '*.sh'
- 'net.retrodeck.retrodeck.yml' - 'net.retrodeck.retrodeck.yml'
- 'net.retrodeck.retrodeck.appdata.xml' - 'net.retrodeck.retrodeck.metainfo.xml'
pull_request_target: pull_request_target:
types: [opened, synchronize, reopened] types: [opened, synchronize, reopened]
branches: branches:
@ -153,8 +153,8 @@ jobs:
if: github.ref != 'refs/heads/main' if: github.ref != 'refs/heads/main'
run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/cooker_flatpak_portal_add.sh" run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/cooker_flatpak_portal_add.sh"
- name: "Updating release notes in appdata" - name: "Updating release notes in metainfo"
run: "automation_tools/appdata_management.sh" run: "automation_tools/metainfo_management.sh"
- name: "[DEBUG] Outputting manifest" - name: "[DEBUG] Outputting manifest"
run: cat net.retrodeck.retrodeck.yml run: cat net.retrodeck.retrodeck.yml
@ -190,7 +190,7 @@ jobs:
# uses: Mudlet/xmlstarlet-action@master # uses: Mudlet/xmlstarlet-action@master
# id: extract-description # id: extract-description
# with: # with:
# args: sel -t -v "/component/releases/release[1]/description//text()" ./net.retrodeck.retrodeck.appdata.xml # args: sel -t -v "/component/releases/release[1]/description//text()" ./net.retrodeck.retrodeck.metainfo.xml
# Generate Release Body # Generate Release Body
- name: Generate release body text - name: Generate release body text

View file

@ -5,27 +5,27 @@
source automation_tools/version_extractor.sh source automation_tools/version_extractor.sh
# Set the file paths # Set the file paths
appdata="net.retrodeck.retrodeck.appdata.xml" metainfo="net.retrodeck.retrodeck.metainfo.xml"
manifest="net.retrodeck.retrodeck.yml" manifest="net.retrodeck.retrodeck.yml"
manifest_content=$(cat "$manifest") manifest_content=$(cat "$manifest")
compare_versions() { compare_versions() {
local manifest_version_cleaned=$(echo "$1" | sed 's/[a-zA-Z]//g') local manifest_version_cleaned=$(echo "$1" | sed 's/[a-zA-Z]//g')
local appdata_version_cleaned=$(echo "$2" | sed 's/[a-zA-Z]//g') local metainfo_version_cleaned=$(echo "$2" | sed 's/[a-zA-Z]//g')
if [[ "$manifest_version_cleaned" == "$appdata_version_cleaned" ]]; then if [[ "$manifest_version_cleaned" == "$metainfo_version_cleaned" ]]; then
return 0 # Versions are equal return 0 # Versions are equal
fi fi
local IFS=. local IFS=.
local manifest_parts=($manifest_version_cleaned) local manifest_parts=($manifest_version_cleaned)
local appdata_parts=($appdata_version_cleaned) local metainfo_parts=($metainfo_version_cleaned)
for ((i=0; i<${#manifest_parts[@]}; i++)); do for ((i=0; i<${#manifest_parts[@]}; i++)); do
if ((manifest_parts[i] > appdata_parts[i])); then if ((manifest_parts[i] > metainfo_parts[i])); then
return 1 # Manifest version is greater return 1 # Manifest version is greater
elif ((manifest_parts[i] < appdata_parts[i])); then elif ((manifest_parts[i] < metainfo_parts[i])); then
return 2 # Appdata version is greater return 2 # Metainfo version is greater
fi fi
done done
@ -38,8 +38,8 @@ echo -e "Online repository:\t$repo_version"
manifest_version=$(fetch_manifest_version) manifest_version=$(fetch_manifest_version)
echo -e "Manifest:\t\t$manifest_version" echo -e "Manifest:\t\t$manifest_version"
appdata_version=$(fetch_appdata_version) metainfo_version=$(fetch_metainfo_version)
echo -e "Appdata:\t\t$appdata_version" echo -e "Metainfo:\t\t$metainfo_version"
# Additional checks # Additional checks
if [[ "$manifest_version" == "main" || "$manifest_version" == "THISBRANCH" || "$manifest_version" == *"cooker"* ]]; then if [[ "$manifest_version" == "main" || "$manifest_version" == "THISBRANCH" || "$manifest_version" == *"cooker"* ]]; then
@ -47,8 +47,8 @@ if [[ "$manifest_version" == "main" || "$manifest_version" == "THISBRANCH" || "$
exit 1 exit 1
fi fi
if [[ "$appdata_version" != "$manifest_version" ]]; then if [[ "$metainfo_version" != "$manifest_version" ]]; then
echo "Appdata version is not equal to manifest version. Please fix it." echo "Metainfo version is not equal to manifest version. Please fix it."
exit 1 exit 1
fi fi

View file

@ -1,26 +1,26 @@
#!/bin/bash #!/bin/bash
# THIS SCRIPT IS BROKEN HENCE DISABLED FTM # THIS SCRIPT IS BROKEN HENCE DISABLED FTM
# This script is getting the latest release notes from the wiki and add them to the appdata # This script is getting the latest release notes from the wiki and add them to the metainfo
source automation_tools/version_extractor.sh source automation_tools/version_extractor.sh
# Fetch appdata version # Fetch metainfo version
appdata_version=$(fetch_appdata_version) metainfo_version=$(fetch_metainfo_version)
echo -e "Appdata:\t\t$appdata_version" echo -e "metainfo:\t\t$metainfo_version"
# Defining manifest file location # Defining manifest file location
appdata_file="net.retrodeck.retrodeck.appdata.xml" metainfo_file="net.retrodeck.retrodeck.metainfo.xml"
# Check if release with appdata_version already exists # Check if release with metainfo_version already exists
if grep -q "version=\"$appdata_version\"" "$appdata_file"; then if grep -q "version=\"$metainfo_version\"" "$metainfo_file"; then
echo -e "Deleting existing release version $appdata_version..." echo -e "Deleting existing release version $metainfo_version..."
# Remove the existing release entry # Remove the existing release entry
sed -i "/<release version=\"$appdata_version\"/,/<\/release>/d" "$appdata_file" sed -i "/<release version=\"$metainfo_version\"/,/<\/release>/d" "$metainfo_file"
fi fi
echo -e "Adding new release version $appdata_version..." echo -e "Adding new release version $metainfo_version..."
# Get today's date in the required format (YYYY-MM-DD) # Get today's date in the required format (YYYY-MM-DD)
today_date=$(date +"%Y-%m-%d") today_date=$(date +"%Y-%m-%d")
@ -29,15 +29,15 @@ echo -e "Today is $today_date"
# Construct the release snippet # Construct the release snippet
release_snippet="\ release_snippet="\
<releases> <releases>
<release version=\"$appdata_version\" date=\"$today_date\"> <release version=\"$metainfo_version\" date=\"$today_date\">
<url>https://github.com/RetroDECK/RetroDECK/releases/tag/$appdata_version</url> <url>https://github.com/RetroDECK/RetroDECK/releases/tag/$metainfo_version</url>
<description> <description>
RELEASE_NOTES_PLACEHOLDER RELEASE_NOTES_PLACEHOLDER
</description> </description>
</release>" </release>"
# Read the entire content of the XML file # Read the entire content of the XML file
xml_content=$(cat "$appdata_file") xml_content=$(cat "$metainfo_file")
# Replace RELEASE_NOTES_PLACEHOLDER with the actual release notes # Replace RELEASE_NOTES_PLACEHOLDER with the actual release notes
# TODO # TODO
@ -89,7 +89,7 @@ release_description="${release_snippet/RELEASE_NOTES_PLACEHOLDER/$section_list}"
modified_xml_content="${xml_content/<releases>/$release_description}" modified_xml_content="${xml_content/<releases>/$release_description}"
# Overwrite the original XML file with the modified content # Overwrite the original XML file with the modified content
echo "$modified_xml_content" > "$appdata_file" echo "$modified_xml_content" > "$metainfo_file"
# Format the XML file # Format the XML file
#xmlstarlet fo --omit-decl "$appdata_file" #xmlstarlet fo --omit-decl "$metainfo_file"

View file

@ -2,11 +2,11 @@
# This script is intended to gather version information from various sources: # This script is intended to gather version information from various sources:
# RetroDECK repository # RetroDECK repository
# Appdata.xml file # Metainfo.xml file
# Manifest YAML file # Manifest YAML file
# It consists of three functions, each responsible for retrieving a specific version-related data. # It consists of three functions, each responsible for retrieving a specific version-related data.
appdata="net.retrodeck.retrodeck.appdata.xml" metainfo="net.retrodeck.retrodeck.metainfo.xml"
manifest="net.retrodeck.retrodeck.yml" manifest="net.retrodeck.retrodeck.yml"
manifest_content=$(cat "$manifest") manifest_content=$(cat "$manifest")
@ -19,10 +19,10 @@ fetch_repo_version(){
echo "$repo_version" echo "$repo_version"
} }
fetch_appdata_version(){ fetch_metainfo_version(){
# Extract the version from the net.retrodeck.retrodeck.appdata.xml file # Extract the version from the net.retrodeck.retrodeck.metainfo.xml file
appdata_version=$(grep -oPm1 "(?<=<release version=\")[^\"]+" "$appdata") metainfo_version=$(grep -oPm1 "(?<=<release version=\")[^\"]+" "$metainfo")
echo "$appdata_version" echo "$metainfo_version"
} }
fetch_manifest_version(){ fetch_manifest_version(){

View file

@ -45,7 +45,7 @@ export GITHUB_WORKSPACE="."
ostree init --mode=archive-z2 --repo=${GITHUB_WORKSPACE}/retrodeck-repo ostree init --mode=archive-z2 --repo=${GITHUB_WORKSPACE}/retrodeck-repo
# Backing up original manifest # Backing up original manifest
cp net.retrodeck.retrodeck.appdata.xml net.retrodeck.retrodeck.appdata.xml.bak cp net.retrodeck.retrodeck.metainfo.xml net.retrodeck.retrodeck.metainfo.xml.bak
cp net.retrodeck.retrodeck.yml net.retrodeck.retrodeck.yml.bak cp net.retrodeck.retrodeck.yml net.retrodeck.retrodeck.yml.bak
automation_tools/install_dependencies.sh automation_tools/install_dependencies.sh
@ -53,10 +53,10 @@ automation_tools/cooker_build_id.sh
automation_tools/manifest_placeholder_replacer.sh automation_tools/manifest_placeholder_replacer.sh
automation_tools/cooker_flatpak_portal_add.sh automation_tools/cooker_flatpak_portal_add.sh
# THIS SCRIPT IS BROKEN HENCE DISABLED FTM # THIS SCRIPT IS BROKEN HENCE DISABLED FTM
# automation_tools/appdata_management.sh # automation_tools/metainfo_management.sh
automation_tools/flatpak_build_download_only.sh automation_tools/flatpak_build_download_only.sh
automation_tools/flatpak_build_only.sh "${@}" automation_tools/flatpak_build_only.sh "${@}"
automation_tools/flatpak_build_bundle.sh automation_tools/flatpak_build_bundle.sh
mv -f net.retrodeck.retrodeck.appdata.xml.bak net.retrodeck.retrodeck.appdata.xml mv -f net.retrodeck.retrodeck.metainfo.xml.bak net.retrodeck.retrodeck.metainfo.xml
mv -f net.retrodeck.retrodeck.yml.bak net.retrodeck.retrodeck.yml mv -f net.retrodeck.retrodeck.yml.bak net.retrodeck.retrodeck.yml

View file

@ -161,14 +161,14 @@ configurator_move_folder_dialog() {
} }
changelog_dialog() { changelog_dialog() {
# This function will pull the changelog notes from the version it is passed (which must match the appdata version tag) from the net.retrodeck.retrodeck.appdata.xml file # This function will pull the changelog notes from the version it is passed (which must match the metainfo version tag) from the net.retrodeck.retrodeck.metainfo.xml file
# The function also accepts "all" as a version, and will print the entire changelog # The function also accepts "all" as a version, and will print the entire changelog
# USAGE: changelog_dialog "version" # USAGE: changelog_dialog "version"
log d "Showing changelog dialog" log d "Showing changelog dialog"
if [[ "$1" == "all" ]]; then if [[ "$1" == "all" ]]; then
xml sel -t -m "//component/releases/release/description" -c . $rd_appdata | tr -s '\n' | sed 's/^\s*//' > "/var/config/retrodeck/changelog-full.xml" xml sel -t -m "//component/releases/release/description" -c . $rd_metainfo | tr -s '\n' | sed 's/^\s*//' > "/var/config/retrodeck/changelog-full.xml"
convert_to_markdown "/var/config/retrodeck/changelog-full.xml" convert_to_markdown "/var/config/retrodeck/changelog-full.xml"
@ -177,7 +177,7 @@ changelog_dialog() {
--title "RetroDECK Changelogs" \ --title "RetroDECK Changelogs" \
--filename="/var/config/retrodeck/changelog-full.xml.md" --filename="/var/config/retrodeck/changelog-full.xml.md"
else else
xml sel -t -m "//component/releases/release[1]/description" -c . $rd_appdata | tr -s '\n' | sed 's/^\s*//' > "/var/config/retrodeck/changelog.xml" xml sel -t -m "//component/releases/release[1]/description" -c . $rd_metainfo | tr -s '\n' | sed 's/^\s*//' > "/var/config/retrodeck/changelog.xml"
convert_to_markdown "/var/config/retrodeck/changelog.xml" convert_to_markdown "/var/config/retrodeck/changelog.xml"

View file

@ -54,7 +54,7 @@ remote_network_target_1="https://flathub.org"
remote_network_target_2="$rd_repo" # The URL of a common internet target for testing network access remote_network_target_2="$rd_repo" # The URL of a common internet target for testing network access
remote_network_target_3="https://one.one.one.one" # The URL of a common internet target for testing network access remote_network_target_3="https://one.one.one.one" # The URL of a common internet target for testing network access
helper_files_folder="$config/retrodeck/helper_files" # The parent folder of RetroDECK documentation files for deployment helper_files_folder="$config/retrodeck/helper_files" # The parent folder of RetroDECK documentation files for deployment
rd_appdata="/app/share/metainfo/net.retrodeck.retrodeck.metainfo.xml" # The shipped appdata XML file for this version rd_metainfo="/app/share/metainfo/net.retrodeck.retrodeck.metainfo.xml" # The shipped metainfo XML file for this version
rpcs3_firmware="http://dus01.ps3.update.playstation.net/update/ps3/image/us/2024_0227_3694eb3fb8d9915c112e6ab41a60c69f/PS3UPDAT.PUP" # RPCS3 Firmware download location rpcs3_firmware="http://dus01.ps3.update.playstation.net/update/ps3/image/us/2024_0227_3694eb3fb8d9915c112e6ab41a60c69f/PS3UPDAT.PUP" # RPCS3 Firmware download location
RA_API_URL="https://retroachievements.org/dorequest.php" # API URL for RetroAchievements.org RA_API_URL="https://retroachievements.org/dorequest.php" # API URL for RetroAchievements.org
presets_dir="$config/retrodeck/presets" # Repository for all system preset config files presets_dir="$config/retrodeck/presets" # Repository for all system preset config files

View file

@ -9,7 +9,7 @@
<url type="homepage">https://retrodeck.net</url> <url type="homepage">https://retrodeck.net</url>
<url type="bugtracker">https://github.com/RetroDECK/RetroDECK/issues</url> <url type="bugtracker">https://github.com/RetroDECK/RetroDECK/issues</url>
<url type="help">https://retrodeck.readthedocs.io</url> <url type="help">https://retrodeck.readthedocs.io</url>
<url type="faq">https://github.com/RetroDECK/RetroDECK/wiki/FAQs---Frequently-asked-questions</url> <url type="faq">https://retrodeck.readthedocs.io/en/latest/wiki_faq/faq-rd-general/f</url>
<url type="donation">https://www.patreon.com/RetroDECK</url> <url type="donation">https://www.patreon.com/RetroDECK</url>
<content_rating type="oars-1.0" /> <content_rating type="oars-1.0" />
<screenshots> <screenshots>

View file

@ -76,7 +76,7 @@ modules:
# #
# UPDATE STEPS FOR MAIN: # UPDATE STEPS FOR MAIN:
# [ ] Update the VERSION variable on line containing "VERSION=THISBRANCH" # [ ] Update the VERSION variable on line containing "VERSION=THISBRANCH"
# [ ] Update the appdata.xml with the version number and notes # [ ] Update the net.retrodeck.retrodeck.metainfo.xml with the version number and notes
- name: retrodeck-initialization - name: retrodeck-initialization
buildsystem: simple buildsystem: simple
@ -798,6 +798,9 @@ modules:
ln -s "/lib/x86_64-linux-gnu/libSDL2-2.0.so.0" "${FLATPAK_DEST}/lib/libSDL2.so" ln -s "/lib/x86_64-linux-gnu/libSDL2-2.0.so.0" "${FLATPAK_DEST}/lib/libSDL2.so"
fi fi
# Installing metainfo
- install -Dm 644 net.retrodeck.retrodeck.metainfo.xml ${FLATPAK_DEST}/share/metainfo/net.retrodeck.retrodeck.metainfo.xml
sources: sources:
- type: dir - type: dir
path: . path: .

View file

@ -32,16 +32,16 @@ jobs:
git submodule update git submodule update
sudo apt install -y flatpak flatpak-builder p7zip-full xmlstarlet appstream-util sudo apt install -y flatpak flatpak-builder p7zip-full xmlstarlet appstream-util
- name: Validating the appdata - name: Validating the metainfo
run: appstream-util validate "net.retrodeck.retrodeck.appdata.xml" run: appstream-util validate "net.retrodeck.retrodeck.metainfo.xml"
continue-on-error: true continue-on-error: true
- name: Getting version info - name: Getting version info
id: version id: version
run: | run: |
appdata="https://raw.githubusercontent.com/RetroDECK/RetroDECK/main/net.retrodeck.retrodeck.appdata.xml" metainfo="https://raw.githubusercontent.com/RetroDECK/RetroDECK/main/net.retrodeck.retrodeck.metainfo.xml"
REL_VER=$(curl -s $appdata | xmlstarlet sel -t -v "//release/@version" | head -1) REL_VER=$(curl -s $metainfo | xmlstarlet sel -t -v "//release/@version" | head -1)
DES="$(curl -s $appdata | xmlstarlet sel -t -m "//release[1]" -v "description" -n | sed '1,2d;$d;s/^ */- /;/^- $/d')" DES="$(curl -s $metainfo | xmlstarlet sel -t -m "//release[1]" -v "description" -n | sed '1,2d;$d;s/^ */- /;/^- $/d')"
echo "REL_VER=$REL_VER" >> $GITHUB_ENV echo "REL_VER=$REL_VER" >> $GITHUB_ENV
echo -e "# Release Notes\n" >> "body.md" echo -e "# Release Notes\n" >> "body.md"
echo "$DES" >> "body.md" echo "$DES" >> "body.md"

View file

@ -17,7 +17,7 @@ on:
- 'rd-submodules/**' - 'rd-submodules/**'
- '*.sh' - '*.sh'
- 'net.retrodeck.retrodeck.yml' - 'net.retrodeck.retrodeck.yml'
- 'net.retrodeck.retrodeck.appdata.xml' - 'net.retrodeck.retrodeck.metainfo.xml'
pull_request: pull_request:
branches: branches:
- cooker* - cooker*
@ -83,8 +83,8 @@ jobs:
- name: "Adding flatpak portal for automated updates (cooker only)" - name: "Adding flatpak portal for automated updates (cooker only)"
run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/cooker_flatpak_portal_add.sh" run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/cooker_flatpak_portal_add.sh"
- name: "Updating release notes in appdata" - name: "Updating release notes in metainfo"
run: "automation_tools/appdata_management.sh" run: "automation_tools/metainfo_management.sh"
- name: "[DEBUG] Outputting manifest" - name: "[DEBUG] Outputting manifest"
run: cat net.retrodeck.retrodeck.yml run: cat net.retrodeck.retrodeck.yml

View file

@ -14,7 +14,7 @@ on:
- 'rd-submodules/**' - 'rd-submodules/**'
- '*.sh' - '*.sh'
- 'net.retrodeck.retrodeck.yml' - 'net.retrodeck.retrodeck.yml'
- 'net.retrodeck.retrodeck.appdata.xml' - 'net.retrodeck.retrodeck.metainfo.xml'
pull_request: pull_request:
branches: branches:
- cooker* - cooker*
@ -85,8 +85,8 @@ jobs:
- name: "Adding flatpak portal for automated updates (cooker only)" - name: "Adding flatpak portal for automated updates (cooker only)"
run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/cooker_flatpak_portal_add.sh" run: "/bin/bash ${GITHUB_WORKSPACE}/automation_tools/cooker_flatpak_portal_add.sh"
- name: "Updating release notes in appdata" - name: "Updating release notes in metainfo"
run: "automation_tools/appdata_management.sh" run: "automation_tools/metainfo_management.sh"
- name: "[DEBUG] Outputting manifest" - name: "[DEBUG] Outputting manifest"
run: cat net.retrodeck.retrodeck.yml run: cat net.retrodeck.retrodeck.yml

View file

@ -32,16 +32,16 @@ jobs:
git submodule update git submodule update
sudo apt install -y flatpak flatpak-builder p7zip-full xmlstarlet appstream-util sudo apt install -y flatpak flatpak-builder p7zip-full xmlstarlet appstream-util
- name: Validating the appdata - name: Validating the metainfo
run: appstream-util validate "net.retrodeck.retrodeck.appdata.xml" run: appstream-util validate "net.retrodeck.retrodeck.metainfo.xml"
continue-on-error: true continue-on-error: true
- name: Getting version info - name: Getting version info
id: version id: version
run: | run: |
appdata="https://raw.githubusercontent.com/RetroDECK/RetroDECK/main/net.retrodeck.retrodeck.appdata.xml" metainfo="https://raw.githubusercontent.com/RetroDECK/RetroDECK/main/net.retrodeck.retrodeck.metainfo.xml"
REL_VER=$(curl -s $appdata | xmlstarlet sel -t -v "//release/@version" | head -1) REL_VER=$(curl -s $metainfo | xmlstarlet sel -t -v "//release/@version" | head -1)
DES="$(curl -s $appdata | xmlstarlet sel -t -m "//release[1]" -v "description" -n | sed '1,2d;$d;s/^ */- /;/^- $/d')" DES="$(curl -s $metainfo | xmlstarlet sel -t -m "//release[1]" -v "description" -n | sed '1,2d;$d;s/^ */- /;/^- $/d')"
echo "REL_VER=$REL_VER" >> $GITHUB_ENV echo "REL_VER=$REL_VER" >> $GITHUB_ENV
echo -e "# Release Notes\n" >> "body.md" echo -e "# Release Notes\n" >> "body.md"
echo "$DES" >> "body.md" echo "$DES" >> "body.md"

View file

@ -1391,7 +1391,7 @@ disable_steam_sync() {
} }
configurator_version_history_dialog() { configurator_version_history_dialog() {
local version_array=($(xml sel -t -v '//component/releases/release/@version' -n $rd_appdata)) local version_array=($(xml sel -t -v '//component/releases/release/@version' -n $rd_metainfo))
local all_versions_list=() local all_versions_list=()
for rd_version in ${version_array[*]}; do for rd_version in ${version_array[*]}; do