From 5a5fb3563c6eaee14fb03fae46c1b5612a7c8d57 Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Tue, 25 Sep 2018 10:02:32 +0000 Subject: [PATCH] remove pkgid argument from pkgfiles 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 | 5 +++-- zpm-pkgfiles.c | 18 ++++-------------- 2 files changed, 7 insertions(+), 16 deletions(-) diff --git a/zpm-install b/zpm-install index cf0df5f..7c7fff1 100755 --- a/zpm-install +++ b/zpm-install @@ -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'; diff --git a/zpm-pkgfiles.c b/zpm-pkgfiles.c index 7b14e67..0a0f1d5 100644 --- a/zpm-pkgfiles.c +++ b/zpm-pkgfiles.c @@ -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; -- 2.40.0