]> pd.if.org Git - zpackage/commitdiff
remove pkgid argument from pkgfiles
authorNathan Wagner <nw@hydaspes.if.org>
Tue, 25 Sep 2018 10:02:32 +0000 (10:02 +0000)
committerNathan Wagner <nw@hydaspes.if.org>
Tue, 25 Sep 2018 10:02:32 +0000 (10:02 +0000)
zpm-pkgfiles only reported the pkgid, but it didn't restrict
what was done.  The actions are determined by the package statuses
and the install_status view.

zpm-install
zpm-pkgfiles.c

index cf0df5f2e89f49ca567188cb27df629ef9728ada..7c7fff1d5f2e55ba2cd6844fcffdd1574cbebb63 100755 (executable)
@@ -138,17 +138,18 @@ for pkgstr in "$@"; do
                        die "merging $pkgid failed"
                fi
        fi
+       # TODO but need to mark as installing if not merged
 
        #zpm shell $ZPMDB 'select * from install_status' 1>&2
        if [ $dryrun -gt 0 ]; then
                #zpm list -v
                #zpm shell $ZPMDB 'select * from install_status'
-               zpm pkgfiles -nv -f $pkgfile $pkgid
+               zpm pkgfiles -nv -f $pkgfile
                zpm pkg $pkgid status=dryrun
                continue
        fi
 
-       zpm pkgfiles -f $pkgfile $pkgid
+       zpm pkgfiles -f $pkgfile
 
        if [ $? -ne 0 ]; then
                die 'zpm-pkgfiles failed';
index 7b14e670bb534b5545a7bc0a16b62a3e320c4c1f..0a0f1d51d1343d6c636f5f8c8719bdcc61cde37a 100644 (file)
@@ -24,7 +24,6 @@ struct config {
        struct zpm *log; /* logging db will be attached as "log" */
        struct zpm *src;
        char *dbfile;
-       char *pkgid;
        char *rootdir;
        int errabort, errors, verbose, dryrun;
        int setuser, setgroup;
@@ -453,7 +452,7 @@ static void runstage(struct config *conf, char *stage,
 int main(int ac, char **av){
        struct zpm localdb;
        struct zpm pkgdb;
-       int opt, argn;
+       int opt;
        char *pkgdbfile = 0, *localdbfile = 0;
        char *s;
 
@@ -516,16 +515,6 @@ int main(int ac, char **av){
                fprintf(stderr, "rootdir %s does not exist\n", conf.rootdir);
        }
 
-       argn = optind;
-       if (argn < ac) {
-               conf.pkgid = av[argn];
-               argn++;
-       } else {
-               fprintf(stderr, "must specify pkgid\n");
-               usage();
-               exit(EXIT_FAILURE);
-       }
-
        if (!zpm_open(&localdb, localdbfile)) {
                fprintf(stderr, "can't open zpm db %s\n", localdbfile);
                exit(EXIT_FAILURE);
@@ -545,8 +534,9 @@ int main(int ac, char **av){
 
        /* TODO set conf var to finalize error reporting */
        if (conf.verbose) {
-               fprintf(stderr, "installing %s (ldb %s) from %s\n",
-                               conf.pkgid, localdbfile, pkgdbfile);
+               fprintf(stderr, "syncing filesystem %s (ldb %s) from %s\n",
+                               conf.rootdir ? conf.rootdir : "/",
+                               localdbfile, pkgdbfile);
        }
 
        conf.errors = 0;