Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DBP-Tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Wally
DBP-Tools
Commits
a9cd81a1
Commit
a9cd81a1
authored
Jan 9, 2022
by
Wally
Browse files
Options
Downloads
Plain Diff
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
!1
Corrections from gitlab :P
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
dbp-pack
+19
-15
19 additions, 15 deletions
dbp-pack
dbp-template
+17
-7
17 additions, 7 deletions
dbp-template
dbp-unpack
+12
-4
12 additions, 4 deletions
dbp-unpack
with
48 additions
and
26 deletions
dbp-pack
+
19
−
15
View file @
a9cd81a1
#!/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
...
...
This diff is collapsed.
Click to expand it.
dbp-template
+
17
−
7
View file @
a9cd81a1
...
...
@@ -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
This diff is collapsed.
Click to expand it.
dbp-unpack
+
12
−
4
View file @
a9cd81a1
#!/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"
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment