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
apk-tools
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
61
Issues
61
List
Boards
Labels
Service Desk
Milestones
Merge Requests
15
Merge Requests
15
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
alpine
apk-tools
Commits
a96572fb
Commit
a96572fb
authored
Nov 27, 2008
by
Timo Teräs
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db: compressed index file
parent
f0609951
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
3 deletions
+18
-3
src/apk_archive.h
src/apk_archive.h
+0
-1
src/apk_io.h
src/apk_io.h
+4
-0
src/database.c
src/database.c
+2
-2
src/io.c
src/io.c
+12
-0
No files found.
src/apk_archive.h
View file @
a96572fb
...
...
@@ -21,7 +21,6 @@ typedef int (*apk_archive_entry_parser)(void *ctx,
struct
apk_istream
*
istream
);
int
apk_file_get_info
(
const
char
*
filename
,
struct
apk_file_info
*
fi
);
struct
apk_istream
*
apk_gunzip_bstream
(
struct
apk_bstream
*
);
int
apk_parse_tar
(
struct
apk_istream
*
,
apk_archive_entry_parser
parser
,
void
*
ctx
);
int
apk_parse_tar_gz
(
struct
apk_bstream
*
,
apk_archive_entry_parser
parser
,
void
*
ctx
);
...
...
src/apk_io.h
View file @
a96572fb
...
...
@@ -38,6 +38,8 @@ struct apk_bstream {
void
(
*
close
)(
void
*
stream
,
csum_p
csum
);
};
struct
apk_istream
*
apk_gunzip_bstream
(
struct
apk_bstream
*
);
struct
apk_istream
*
apk_istream_from_fd
(
int
fd
);
struct
apk_istream
*
apk_istream_from_file
(
const
char
*
file
);
size_t
apk_istream_skip
(
struct
apk_istream
*
istream
,
size_t
size
);
...
...
@@ -46,6 +48,8 @@ size_t apk_istream_splice(void *stream, int fd, size_t size);
struct
apk_bstream
*
apk_bstream_from_istream
(
struct
apk_istream
*
istream
);
struct
apk_bstream
*
apk_bstream_from_fd
(
int
fd
);
struct
apk_istream
*
apk_istream_from_file_gz
(
const
char
*
file
);
apk_blob_t
apk_blob_from_istream
(
struct
apk_istream
*
istream
,
size_t
size
);
apk_blob_t
apk_blob_from_file
(
const
char
*
file
);
...
...
src/database.c
View file @
a96572fb
...
...
@@ -670,8 +670,8 @@ int apk_db_add_repository(apk_database_t _db, apk_blob_t repository)
.
url
=
apk_blob_cstr
(
repository
)
};
snprintf
(
tmp
,
sizeof
(
tmp
),
"%s/APK_INDEX"
,
db
->
repos
[
r
].
url
);
is
=
apk_istream_from_file
(
tmp
);
snprintf
(
tmp
,
sizeof
(
tmp
),
"%s/APK_INDEX
.gz
"
,
db
->
repos
[
r
].
url
);
is
=
apk_istream_from_file
_gz
(
tmp
);
if
(
is
==
NULL
)
{
apk_error
(
"Failed to open index file %s"
,
tmp
);
return
-
1
;
...
...
src/io.c
View file @
a96572fb
...
...
@@ -362,3 +362,15 @@ int apk_file_get_info(const char *filename, struct apk_file_info *fi)
return
0
;
}
struct
apk_istream
*
apk_istream_from_file_gz
(
const
char
*
file
)
{
int
fd
;
fd
=
open
(
file
,
O_RDONLY
);
if
(
fd
<
0
)
return
NULL
;
return
apk_gunzip_bstream
(
apk_bstream_from_fd
(
fd
));
}
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