summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/opk/write.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/src/opk/write.c b/src/opk/write.c
index 1561e38..2986ae0 100644
--- a/src/opk/write.c
+++ b/src/opk/write.c
@@ -32,6 +32,7 @@
#include "../gzip.h"
#include "../i18n.h"
#include "../opk.h"
+#include "../specials.h"
#include "../ustar.h"
#include "opk.h"
@@ -100,6 +101,9 @@ _opkg_opk_opk_write_dir_read(struct opkg_opk_opk *opk,
* overflow, not for NUL */
char link[OPKG_OPK_USTAR_LINKNAME_SIZE];
ssize_t link_len;
+ char type;
+ uint32_t devmajor;
+ uint32_t devminor;
FILE *fp;
char *buffer;
size_t size;
@@ -211,6 +215,24 @@ _opkg_opk_opk_write_dir_read(struct opkg_opk_opk *opk,
goto err;
}
} else if (S_ISREG(st.st_mode)) {
+ if (opkg_opk_specials_find(opk->specials,
+ opk->path_virt, &type,
+ &devmajor, &devminor) ==
+ OPKG_OPK_OK) {
+ if (opkg_opk_ustar_write_header(
+ opk->inner_ustar,
+ &child,
+ st.st_mode & 0777,
+ uid, uname, gid, gname,
+ devmajor, devminor, 0,
+ opk->mtime, type, NULL)
+ != OPKG_OPK_OK) {
+ fputs(_("Error: Failed to write header"
+ "\n"), stderr);
+ goto err;
+ }
+ continue;
+ }
if (opkg_opk_ustar_write_header(opk->inner_ustar,
&child, st.st_mode & 0777,
uid, uname, gid, gname, 0, 0,