X-Git-Url: https://pd.if.org/git/?a=blobdiff_plain;f=zpm-extract.c;h=026b5dfe237a1fce4c2e1ae09d2bc32709d27c30;hb=b76155431d2aece641af663146c3e9fb9cb1c0e2;hp=e050bf230a89a88904a076e4a23bba5e7f127b79;hpb=ecdd57da7df775c039aee834e1f74172004f352b;p=zpackage diff --git a/zpm-extract.c b/zpm-extract.c index e050bf2..026b5df 100644 --- a/zpm-extract.c +++ b/zpm-extract.c @@ -9,18 +9,33 @@ #include "zpm.h" +/* more usage: + * -t : use a temp file, then move into place, possible reverse the sense + * -u : userid + * -g : groupid + * -m : mode (i.e. final mode) + * -l : log all actions + * -d : logging database file, if different + * + * check if file exists, if it does, and has the same hash, do + * nothing, unless -f is given + */ + #if 1 int main(int ac, char **av){ struct zpm pkg; - int mode = 0644; + int mode = 0600; + int rv; if (ac < 3) { fprintf(stderr, "usage: db hash file\n"); return 1; } zpm_open(&pkg, av[1]); - zpm_extract(&pkg, av[2], av[3], mode); + rv = zpm_extract(&pkg, av[2], av[3], 0600); zpm_close(&pkg); + + return rv ? 0 : 1; } #else