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
cb25f35e
Commit
cb25f35e
authored
Oct 26, 2008
by
Natanael Copa
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
give more helpful error messages
parent
219a1b2e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
16 additions
and
5 deletions
+16
-5
src/archive.c
src/archive.c
+3
-0
src/database.c
src/database.c
+7
-2
src/package.c
src/package.c
+6
-3
No files found.
src/archive.c
View file @
cb25f35e
...
...
@@ -276,6 +276,9 @@ int apk_archive_entry_extract(struct apk_archive_entry *ae, const char *fn)
r
=
chown
(
fn
,
ae
->
uid
,
ae
->
gid
);
else
r
=
lchown
(
fn
,
ae
->
uid
,
ae
->
gid
);
if
(
r
<
0
)
apk_error
(
"Failed to set ownership on %s: %s"
,
fn
,
strerror
(
errno
));
}
else
{
apk_error
(
"Failed to extract %s
\n
"
,
ae
->
name
);
}
...
...
src/database.c
View file @
cb25f35e
...
...
@@ -434,8 +434,10 @@ static int apk_db_read_config(struct apk_database *db)
fchdir
(
db
->
root_fd
);
fd
=
open
(
"var/lib/apk/world"
,
O_RDONLY
);
if
(
fd
<
0
)
if
(
fd
<
0
)
{
apk_error
(
"Please run 'apk create' to initialize root"
);
return
-
1
;
}
fstat
(
fd
,
&
st
);
buf
=
malloc
(
st
.
st_size
);
...
...
@@ -470,6 +472,7 @@ int apk_db_open(struct apk_database *db, const char *root)
db
->
root
=
strdup
(
root
);
db
->
root_fd
=
open
(
root
,
O_RDONLY
);
if
(
db
->
root_fd
<
0
)
{
apk_error
(
"%s: %s"
,
root
,
strerror
(
errno
));
free
(
db
->
root
);
return
-
1
;
}
...
...
@@ -791,8 +794,10 @@ int apk_db_install_pkg(struct apk_database *db,
db
->
repos
[
0
].
url
,
newpkg
->
name
->
name
,
newpkg
->
version
);
fd
=
open
(
file
,
O_RDONLY
);
if
(
fd
<
0
)
if
(
fd
<
0
)
{
apk_error
(
"%s: %s"
,
file
,
strerror
(
errno
));
return
errno
;
}
fcntl
(
fd
,
F_SETFD
,
FD_CLOEXEC
);
...
...
src/package.c
View file @
cb25f35e
...
...
@@ -9,6 +9,7 @@
* by the Free Software Foundation. See http://www.gnu.org/ for details.
*/
#include <errno.h>
#include <fcntl.h>
#include <ctype.h>
#include <stdio.h>
...
...
@@ -354,9 +355,11 @@ int apk_pkg_run_script(struct apk_package *pkg, int root_fd,
if
(
pid
==
-
1
)
return
-
1
;
if
(
pid
==
0
)
{
chroot
(
"."
);
execle
(
fn
,
script_types
[
script
->
type
],
pkg
->
version
,
""
,
NULL
,
environment
);
if
(
chroot
(
"."
)
<
0
)
{
apk_error
(
"chroot: %s"
,
strerror
(
errno
));
}
else
execle
(
fn
,
script_types
[
script
->
type
],
pkg
->
version
,
""
,
NULL
,
environment
);
exit
(
1
);
}
waitpid
(
pid
,
&
status
,
0
);
...
...
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