Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
A
apk-tools
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Analyze
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Hassan Albahri
apk-tools
Commits
8fb4f6d1
Commit
8fb4f6d1
authored
15 years ago
by
Natanael Copa
Browse files
Options
Downloads
Patches
Plain Diff
ver: added --check/-c option to vaildate given version string
parent
53814250
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/ver.c
+17
-0
17 additions, 0 deletions
src/ver.c
with
17 additions
and
0 deletions
src/ver.c
+
17
−
0
View file @
8fb4f6d1
...
...
@@ -45,6 +45,19 @@ static int ver_test(int argc, char **argv)
return
0
;
}
static
int
ver_validate
(
int
argc
,
char
**
argv
)
{
int
i
,
r
=
0
;
for
(
i
=
0
;
i
<
argc
;
i
++
)
{
if
(
!
apk_version_validate
(
APK_BLOB_STR
(
argv
[
i
])))
{
if
(
apk_verbosity
>
0
)
printf
(
"%s
\n
"
,
argv
[
i
]);
r
++
;
}
}
return
r
;
}
static
int
ver_parse
(
void
*
ctx
,
int
opt
,
int
optindex
,
const
char
*
optarg
)
{
struct
ver_ctx
*
ictx
=
(
struct
ver_ctx
*
)
ctx
;
...
...
@@ -52,6 +65,9 @@ static int ver_parse(void *ctx, int opt, int optindex, const char *optarg)
case
't'
:
ictx
->
action
=
ver_test
;
break
;
case
'c'
:
ictx
->
action
=
ver_validate
;
break
;
default:
return
-
1
;
}
...
...
@@ -93,6 +109,7 @@ static int ver_main(void *ctx, int argc, char **argv)
static
struct
option
ver_options
[]
=
{
{
"test"
,
no_argument
,
NULL
,
't'
},
{
"check"
,
no_argument
,
NULL
,
'c'
},
};
static
struct
apk_applet
apk_ver
=
{
...
...
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