summaryrefslogtreecommitdiffstats
path: root/src/opk
diff options
context:
space:
mode:
Diffstat (limited to 'src/opk')
-rw-r--r--src/opk/write.c38
1 files changed, 35 insertions, 3 deletions
diff --git a/src/opk/write.c b/src/opk/write.c
index b9e50c7..7968ff4 100644
--- a/src/opk/write.c
+++ b/src/opk/write.c
@@ -25,6 +25,7 @@
#include <stdlib.h>
#include <string.h>
#include <sys/stat.h>
+#include <sys/sysmacros.h>
#include <unistd.h>
#include "../defs.h"
#include "../dirent.h"
@@ -186,11 +187,42 @@ _opkg_opk_opk_write_dir_read(struct opkg_opk_opk *opk,
goto out1;
}
} else if (S_ISCHR(st.st_mode)) {
- /* TODO */
+ if (opkg_opk_ustar_write_header(opk->inner_ustar,
+ &child, st.st_mode & 0777,
+ uid, uname, gid, gname,
+ major(st.st_rdev),
+ minor(st.st_rdev),
+ 0, opk->mtime, 'c', NULL) !=
+ OPKG_OPK_OK) {
+ fputs(_("Error: Failed to write header\n"),
+ stderr);
+ ret = OPKG_OPK_ERROR;
+ goto out1;
+ }
} else if (S_ISBLK(st.st_mode)) {
- /* TODO */
+ if (opkg_opk_ustar_write_header(opk->inner_ustar,
+ &child, st.st_mode & 0777,
+ uid, uname, gid, gname,
+ major(st.st_rdev),
+ minor(st.st_rdev),
+ 0, opk->mtime, 'b', NULL) !=
+ OPKG_OPK_OK) {
+ fputs(_("Error: Failed to write header\n"),
+ stderr);
+ ret = OPKG_OPK_ERROR;
+ goto out1;
+ }
} else if (S_ISFIFO(st.st_mode)) {
- /* TODO */
+ if (opkg_opk_ustar_write_header(opk->inner_ustar,
+ &child, st.st_mode & 0777,
+ uid, uname, gid, gname, 0, 0, 0,
+ opk->mtime, 'p', NULL) !=
+ OPKG_OPK_OK) {
+ fputs(_("Error: Failed to write header\n"),
+ stderr);
+ ret = OPKG_OPK_ERROR;
+ goto out1;
+ }
} else if (S_ISREG(st.st_mode)) {
if (opkg_opk_ustar_write_header(opk->inner_ustar,
&child,