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
a96572fb
Commit
a96572fb
authored
16 years ago
by
Timo Teräs
Browse files
Options
Downloads
Patches
Plain Diff
db: compressed index file
parent
f0609951
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
src/apk_archive.h
+0
-1
0 additions, 1 deletion
src/apk_archive.h
src/apk_io.h
+4
-0
4 additions, 0 deletions
src/apk_io.h
src/database.c
+2
-2
2 additions, 2 deletions
src/database.c
src/io.c
+12
-0
12 additions, 0 deletions
src/io.c
with
18 additions
and
3 deletions
src/apk_archive.h
+
0
−
1
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
);
...
...
This diff is collapsed.
Click to expand it.
src/apk_io.h
+
4
−
0
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
);
...
...
This diff is collapsed.
Click to expand it.
src/database.c
+
2
−
2
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
;
...
...
This diff is collapsed.
Click to expand it.
src/io.c
+
12
−
0
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
));
}
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