Skip to content
Snippets Groups Projects
Commit a9cd81a1 authored by Wally's avatar Wally
Browse files

Merge branch 'main' into 'main'

Corrections from gitlab :P

See merge request !1
parents 1c62fd32 a8b8bc36
Branches main
No related tags found
1 merge request!1Corrections from gitlab :P
#!/bin/bash
error() {
echo "$@" >&2
exit 1
}
quit_message() {
echo "$@"
exit 0
}
# This tool will create a DBP file for use with DBPs
# Check for squashfs / zip
type mksquashfs >/dev/null 2>&1 || { echo >&2 "squashfs is required, please install first."; exit 1; }
type zip >/dev/null 2>&1 || { echo >&2 "zip is required, please install first. "; exit 1; }
type mksquashfs >/dev/null 2>&1 || error "squashfs is required, please install first."
type zip >/dev/null 2>&1 || error "zip is required, please install first. "
#Define default directory for DBPS, create it if not already done
DBPDIR="$HOME/DBPS"
......@@ -12,18 +19,15 @@ DBPDIR="$HOME/DBPS"
DBP_TARGET=$(cd "$1"; /bin/pwd)
if [ -z $1 ]; then
echo "Usage: dbp-pack TARGET_DIRECTORY" && exit 0
fi
[ -z $1 ] && error "Usage: dbp-pack TARGET_DIRECTORY"
cd $DBP_TARGET
# Standard Check
[ ! -d "$PWD/content" ] && echo "Please create content directory for $DBP_TARGET" && exit 0
[ ! -d "$PWD/icons" ] && echo "Please create icons directory" && exit 0
[ ! -d "$PWD/meta" ] && echo "Please create meta folder" && exit 0
[ ! -d "$PWD/teasers" ] && echo "Please create a teasers folder" && exit 0
[ ! -f "$PWD/meta/default.desktop" ] && echo "Please create default.desktop" && exit 0
[ ! -d "$PWD/content" ] && quit_message "Please create content directory for $DBP_TARGET"
[ ! -d "$PWD/icons" ] && quit_message "Please create icons directory"
[ ! -d "$PWD/meta" ] && quit_message "Please create meta folder"
[ ! -d "$PWD/teasers" ] && quit_message "Please create a teasers folder"
[ ! -f "$PWD/meta/default.desktop" ] && quit_message "Please create default.desktop"
## Probably should validate extracted data here
......
......@@ -2,13 +2,21 @@
# This script creates a simple template to create a basic DBP
error() {
echo "$@" >&2
exit 1
}
quit_message() {
echo "$@"
exit 0
}
DBP_TARGET=$(basename "$1" .)
[ -z $DBP_TARGET ] && echo "Usage: ./dbp-generate DBP_TARGET" && exit 0
[ -d "$PWD/$DBP_TARGET" ] && echo "$DBP_TARGET target folder already exists" && exit 0
[ -z $DBP_TARGET ] && error "Usage: ./dbp-generate DBP_TARGET"
[ -d "$PWD/$DBP_TARGET" ] && quit_message "$DBP_TARGET target folder already exists"
# Create required folders
mkdir "$DBP_TARGET" "$DBP_TARGET/content" "$DBP_TARGET/meta" "$DBP_TARGET/icons" "$DBP_TARGET/teasers"
mkdir -p "$DBP_TARGET" "$DBP_TARGET/content" "$DBP_TARGET/meta" "$DBP_TARGET/icons" "$DBP_TARGET/teasers"
## Create a default.desktop file
......@@ -31,7 +39,9 @@ Appdata=$DBP_TARGET
Icon=icon.png
EOF
echo "$DBP_TARGET template has been created sucessfully."
echo "To be fully compliant you will need to amend the default.desktop file:"
echo "Categories - Change to Application;SubCategory or Game;SubCategory"
echo "These are based on Free Desktop Standards: https://specifications.freedesktop.org/menu-spec/latest/apa.html"
cat <<EOF
$DBP_TARGET template has been created sucessfully.
To be fully compliant you will need to amend the default.desktop file:
Categories - Change to Application;SubCategory or Game;SubCategory
These are based on Free Desktop Standards: https://specifications.freedesktop.org/menu-spec/latest/apa.html
EOF
#!/bin/bash
error() {
echo "$@" >&2
exit 1
}
quit_message() {
echo "$@"
exit 0
}
# Check for squashfs / zip
type mksquashfs >/dev/null 2>&1 || { echo >&2 "squashfs is required, please install first."; exit 1; }
type zip >/dev/null 2>&1 || { echo >&2 "zip is required, please install first. "; exit 1; }
type mksquashfs >/dev/null 2>&1 || error "squashfs is required, please install first."
type zip >/dev/null 2>&1 || error "zip is required, please install first. "
#Strip the .dbp extension and add where required
DBP_TARGET=$(basename "$1" .dbp)
# Check to see if target exists.
[ ! -f "$DBP_TARGET.dbp" ] && echo "Usage: dbp-unpack TARGET.dbp"
[ ! -f "$DBP_TARGET.dbp" ] && quit_message "Usage: dbp-unpack TARGET.dbp"
mkdir "$DBP_TARGET"
mkdir -p "$DBP_TARGET"
unsquashfs -d "$DBP_TARGET/content" "$DBP_TARGET.dbp"
unzip "$DBP_TARGET.dbp" -d "$DBP_TARGET"
echo "Successfully extracted $DBP_TARGET.dbp"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment