.
This commit is contained in:
parent
55385f8857
commit
4e4bb0b396
31 changed files with 16 additions and 12 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -13,5 +13,6 @@ goal:
|
||||||
- lazy metadata
|
- lazy metadata
|
||||||
-
|
-
|
||||||
|
|
||||||
deps: aria2
|
makedeps: meson, ninja, libowfat
|
||||||
makedeps: meson(or muon), ninja(or samu), a c compiler
|
deps: aria2, libowfat
|
||||||
|
`-> or statically link
|
||||||
|
|
|
||||||
|
|
@ -1,2 +0,0 @@
|
||||||
|
|
||||||
int pkin_pkg_fetch(char *url, char *dir, stralloc *result);
|
|
||||||
|
|
@ -3,6 +3,8 @@
|
||||||
void pkin_fetch_add(pkin_fetch_queue *queue, char *url, char *output)
|
void pkin_fetch_add(pkin_fetch_queue *queue, char *url, char *output)
|
||||||
{
|
{
|
||||||
buffer_puts(&queue->writeb, url);
|
buffer_puts(&queue->writeb, url);
|
||||||
buffer_puts(&queue->writeb, "\n -o ");
|
buffer_puts(&queue->writeb, "\n out=");
|
||||||
buffer_puts(&queue->writeb, output);
|
buffer_puts(&queue->writeb, output);
|
||||||
|
buffer_puts(&queue->writeb, "\n user-agent=pkin <https://git.lab0x13.site/kento2/pkin>");
|
||||||
|
buffer_puts(&queue->writeb, "\n");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,6 @@
|
||||||
#include <libowfat/errmsg.h>
|
#include <libowfat/errmsg.h>
|
||||||
#include <sys/wait.h>
|
#include <sys/wait.h>
|
||||||
|
#include <unistd.h>
|
||||||
#include "../pkin.h"
|
#include "../pkin.h"
|
||||||
#include "../pkin_internal.h"
|
#include "../pkin_internal.h"
|
||||||
|
|
||||||
|
|
@ -11,6 +12,7 @@ int pkin_fetch_start(pkin_fetch_queue *queue)
|
||||||
carpsys("write to pipe");
|
carpsys("write to pipe");
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
close(queue->pipefd[1]);
|
||||||
|
|
||||||
fetchcmd = (char *[]){"aria2c", "-i", "-", NULL};
|
fetchcmd = (char *[]){"aria2c", "-i", "-", NULL};
|
||||||
pid = pkin__spawn(fetchcmd, queue->pipefd[0], 1, 2);
|
pid = pkin__spawn(fetchcmd, queue->pipefd[0], 1, 2);
|
||||||
|
|
|
||||||
|
|
@ -25,17 +25,18 @@ pid_t pkin__spawn(char *args[], int infd, int outfd, int errfd)
|
||||||
switch (pid) {
|
switch (pid) {
|
||||||
case -1: carpsys("fork: "); return -1;
|
case -1: carpsys("fork: "); return -1;
|
||||||
case 0:
|
case 0:
|
||||||
// TODO pipe
|
if (dup2(infd, 0)<0
|
||||||
if (dup2(0, infd)<0
|
|| dup2(outfd, 1)<0
|
||||||
|| dup2(1, outfd)<0
|
|| dup2(errfd, 2)<0
|
||||||
|| dup2(2, errfd)<0
|
|
||||||
) {
|
) {
|
||||||
carpsys("dup2");
|
diesys(111, "dup2");
|
||||||
return -1;
|
|
||||||
}
|
}
|
||||||
|
if (infd != 0) close(infd);
|
||||||
|
if (outfd != 1) close(outfd);
|
||||||
|
if (errfd != 2) close(errfd);
|
||||||
execvp(args[0], args);
|
execvp(args[0], args);
|
||||||
carpsysargs(args);
|
carpsysargs(args);
|
||||||
return -1;
|
_exit(111);
|
||||||
default:
|
default:
|
||||||
return pid;
|
return pid;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue