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
b864f612
Commit
b864f612
authored
May 10, 2016
by
Steven Arnow
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
dbp-validate-extraced has some basic functionality now
parent
820dc74f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
12 additions
and
3 deletions
+12
-3
changelog
changelog
+4
-0
dbp-validate-extracted/validate.c
dbp-validate-extracted/validate.c
+8
-3
No files found.
changelog
View file @
b864f612
...
...
@@ -3,6 +3,10 @@
- Feature removed
* Bug fixed
[0.6.12] 2016-05-nn
+ Added a crude meta-data validation utility
% Most probably quite buggy and incomplete
[0.6.11] 2015-11-05
+ New dependency checking system
% Dependencies are now in 5 different categories
...
...
dbp-validate-extracted/validate.c
View file @
b864f612
...
...
@@ -150,6 +150,8 @@ bool _valid_parent_category(struct CategoryEntry *ce, const char *prev) {
if
(
!
ce
->
requires_parent
)
return
true
;
if
(
!
prev
)
return
false
;
for
(
i
=
0
;
ce
->
parents
[
i
];
i
++
)
if
(
!
strcmp
(
ce
->
parents
[
i
],
prev
))
...
...
@@ -206,7 +208,7 @@ bool validate_desktop_file(const char *path) {
if
(
!
(
tmp
=
dbp_desktop_lookup
(
df
,
"Name"
,
NULL
,
"Desktop Entry"
))
||
!
strlen
(
tmp
))
LOG_FREE
((
asprintf
(
&
tmp
,
"Desktop file %s does not have a name set in its desktop entry"
,
path
),
tmp
),
error
),
valid
=
false
;
if
(
!
(
tmp
=
dbp_desktop_lookup
(
df
,
"Comment"
,
NULL
,
"Desktop Entry"
))
||
strlen
(
tmp
))
if
(
!
(
tmp
=
dbp_desktop_lookup
(
df
,
"Comment"
,
NULL
,
"Desktop Entry"
))
||
!
strlen
(
tmp
))
LOG_FREE
((
asprintf
(
&
tmp
,
"Desktop file %s is missing a comment in its desktop entry"
,
path
),
tmp
),
warning
);
if
(
!
(
tmp
=
dbp_desktop_lookup
(
df
,
"Icon"
,
NULL
,
"Desktop Entry"
))
||
!
strlen
(
tmp
))
LOG_FREE
((
asprintf
(
&
tmp
,
"Desktop file %s is missing an icon in its desktop entry"
,
path
),
tmp
),
warning
);
...
...
@@ -217,8 +219,8 @@ bool validate_desktop_file(const char *path) {
}
/* Check categories */
{
char
*
category
,
**
catlist
,
*
last
;
int
categories
,
i
;
char
*
category
=
NULL
,
**
catlist
=
NULL
,
*
last
;
int
categories
=
0
,
i
;
if
(
!
(
category
=
dbp_desktop_lookup
(
df
,
"Categories"
,
NULL
,
"Desktop Entry"
)))
return
LOG_FREE
((
asprintf
(
&
tmp
,
"Desktop file %s does not have any categories set in its desktop entry"
,
path
),
tmp
),
error
),
false
;
category
=
strdup
(
category
);
...
...
@@ -283,6 +285,9 @@ 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 */
return
true
;
}
...
...
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