Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
alpine
apk-tools
Commits
b75ae58b
Commit
b75ae58b
authored
Feb 27, 2009
by
Timo Teräs
Browse files
pkg: show warning if deprecated .INSTALL is present in package
parent
7027a7d8
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/package.c
View file @
b75ae58b
...
...
@@ -182,6 +182,7 @@ int apk_script_type(const char *name)
struct
read_info_ctx
{
struct
apk_database
*
db
;
struct
apk_package
*
pkg
;
int
version
;
int
has_install
;
};
...
...
@@ -278,15 +279,21 @@ static int read_info_entry(void *ctx, const struct apk_file_info *ae,
/* Meta info and scripts */
if
(
ae
->
name
[
0
]
==
'.'
)
{
/* APK 2.0 format */
ri
->
version
=
2
;
if
(
strcmp
(
ae
->
name
,
".PKGINFO"
)
==
0
)
{
apk_blob_t
blob
=
apk_blob_from_istream
(
is
,
ae
->
size
);
apk_blob_for_each_segment
(
blob
,
"
\n
"
,
read_info_line
,
ctx
);
free
(
blob
.
ptr
);
return
0
;
}
if
(
strcmp
(
ae
->
name
,
".INSTALL"
)
==
0
)
{
apk_warning
(
"Package '%s-%s' contains deprecated .INSTALL"
,
pkg
->
name
->
name
,
pkg
->
version
);
return
1
;
}
/* FIXME: Check for .INSTALL */
}
else
if
(
strncmp
(
ae
->
name
,
"var/db/apk/"
,
11
)
==
0
)
{
/* APK 1.0 format */
ri
->
version
=
1
;
if
(
!
S_ISREG
(
ae
->
mode
))
return
0
;
...
...
@@ -315,7 +322,12 @@ static int read_info_entry(void *ctx, const struct apk_file_info *ae,
if
(
apk_script_type
(
slash
+
1
)
==
APK_SCRIPT_POST_INSTALL
||
apk_script_type
(
slash
+
1
)
==
APK_SCRIPT_PRE_INSTALL
)
ri
->
has_install
=
1
;
}
else
if
(
ri
->
version
==
2
)
{
/* All metdata of version 2.x package handled */
return
1
;
}
else
{
/* Version 1.x packages do not contain installed size
* in metadata, so we calculate it here */
pkg
->
installed_size
+=
apk_calc_installed_size
(
ae
->
size
);
}
...
...
@@ -513,6 +525,7 @@ struct apk_package *apk_pkg_parse_index_entry(struct apk_database *db, apk_blob_
return
NULL
;
ctx
.
db
=
db
;
ctx
.
version
=
0
;
ctx
.
has_install
=
0
;
apk_blob_for_each_segment
(
blob
,
"
\n
"
,
parse_index_line
,
&
ctx
);
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment