Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
D
dbp
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Incidents
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
packages
dbp
Commits
9b9c5a48
Commit
9b9c5a48
authored
May 10, 2016
by
Steven Arnow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Check for unused icons
parent
aa37918a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
6 deletions
+28
-6
changelog
changelog
+3
-0
dbp-validate-extracted/validate.c
dbp-validate-extracted/validate.c
+24
-5
version.mk
version.mk
+1
-1
No files found.
changelog
View file @
9b9c5a48
...
...
@@ -2,6 +2,9 @@
+ Feature added
- Feature removed
* Bug fixed
[0.6.12.1] 2016-05-10
+ meta-data validation tool will now chekck package icon and
% check for unused icons
[0.6.12] 2016-05-10
+ Added a crude meta-data validation utility
...
...
dbp-validate-extracted/validate.c
View file @
9b9c5a48
...
...
@@ -180,6 +180,16 @@ bool _valid_category(const char *prev, const char *cat) {
}
void
_find_unused_icons
()
{
struct
CheckList
*
next
;
char
*
tmp
;
for
(
next
=
icons_avail
;
next
;
next
=
next
->
next
)
if
(
!
checklist_find
(
next
->
name
,
icons_used
))
LOG_FREE
((
asprintf
(
&
tmp
,
"Icon file %s is present but not used"
,
next
->
name
),
tmp
),
warning
);
}
bool
validate_desktop_file
(
const
char
*
path
)
{
int
section
;
struct
DBPDesktopFile
*
df
;
...
...
@@ -259,6 +269,9 @@ bool validate_package_data(struct DBPDesktopFile *def) {
int
section
;
char
*
path
,
*
tmp
;
asprintf
(
&
path
,
"%s/icons"
,
meta_path
);
if
(
!
directorylist_to_checklist
(
path
,
&
icons_avail
,
NULL
,
".png"
))
LOG_FREE
((
asprintf
(
&
tmp
,
"Icon directory '%s' is missing"
,
path
),
tmp
),
warning
);
if
((
section
=
dbp_desktop_lookup_section
(
def
,
"Package Entry"
))
<
0
)
return
LOG
(
"default.desktop is missing the [Package Entry] section"
,
error
),
false
;
if
(
!
(
tmp
=
dbp_desktop_lookup
(
def
,
"Id"
,
NULL
,
"Package Entry"
)))
...
...
@@ -267,7 +280,15 @@ bool validate_package_data(struct DBPDesktopFile *def) {
LOG
(
"default.desktop has a package ID specified, but it's invalid"
,
error
);
else
if
(
_contains_uppercase
(
tmp
))
LOG
(
"default.desktop has a package ID containg upper-case characters"
,
error
);
if
(
!
(
tmp
=
dbp_desktop_lookup
(
def
,
"Icon"
,
NULL
,
"Package Entry"
)))
LOG
(
"default.desktop does not have an icon specified in its Package Entry"
,
warning
);
else
{
checklist_add
(
tmp
,
tmp
,
&
icons_used
);
if
(
!
checklist_find
(
tmp
,
icons_avail
))
LOG_FREE
((
asprintf
(
&
path
,
"default.desktop has the icon '%s' specified in its Package Entry, which is missing"
,
tmp
),
path
),
error
);
}
if
(
!
(
tmp
=
dbp_desktop_lookup
(
def
,
"Appdata"
,
NULL
,
"Package Entry"
)));
else
if
(
!
_conforms_strict_name_type
(
tmp
))
LOG
(
"default.desktop has an appdata directory specified, but it contains illegal characters"
,
error
);
...
...
@@ -275,9 +296,6 @@ bool validate_package_data(struct DBPDesktopFile *def) {
/* Check package ID etc. etc. */
if
(
dbp_desktop_lookup_section
(
def
,
"Desktop Entry"
)
<
0
)
LOG
(
"default.desktop is lacking a [Desktop Entry], this package will not have a default launch action"
,
warning
);
asprintf
(
&
path
,
"%s/icons"
,
meta_path
);
if
(
!
directorylist_to_checklist
(
path
,
&
icons_avail
,
NULL
,
".png"
))
LOG_FREE
((
asprintf
(
&
tmp
,
"Icon directory '%s' is missing"
,
path
),
tmp
),
warning
);
free
(
path
);
asprintf
(
&
path
,
"%s/meta"
,
meta_path
);
directorylist_to_checklist
(
path
,
&
desktop_files_to_scan
,
NULL
,
".desktop"
);
...
...
@@ -285,7 +303,7 @@ bool validate_package_data(struct DBPDesktopFile *def) {
LOG
(
"No icons found, this is probably not what you want"
,
warning
);
if
(
!
desktop_files_to_scan
)
LOG
(
"No desktop files found"
,
warning
);
/* TODO: Check for unused icons */
/* TODO: Check that exported execs are present */
/* TODO: Check for illegal characters in dependencies */
...
...
@@ -346,6 +364,7 @@ int main(int argc, char **argv) {
for
(
next
=
desktop_files_to_scan
;
next
;
next
=
next
->
next
)
validate_desktop_file
(
next
->
full_name
);
_find_unused_icons
();
fatal:
print_messages
();
...
...
version.mk
View file @
9b9c5a48
CFLAGS
+=
-DVERSION
=
\"
0.6.12
~volatile
\"
CFLAGS
+=
-DVERSION
=
\"
0.6.12
.1
\"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment