From 4238c6794cfe19c0d8fd62da35eb966f1868f9da Mon Sep 17 00:00:00 2001 From: Nathan Wagner Date: Fri, 2 Nov 2018 15:25:22 +0000 Subject: [PATCH] cleanup dead code --- lib/compress.c | 13 ----- lib/zpm.c | 134 ------------------------------------------------- zpm-contents | 13 ++--- zpm-syncfs.c | 5 +- zpm-verify.c | 1 - 5 files changed, 7 insertions(+), 159 deletions(-) diff --git a/lib/compress.c b/lib/compress.c index 72fe159..efbec3d 100644 --- a/lib/compress.c +++ b/lib/compress.c @@ -41,16 +41,3 @@ void *compresslzma(void *buf, size_t bufsize, size_t *len) { *len = outlen; return outbuf; } - -#if 0 -static int callback(void *NotUsed, int argc, char **argv, char **azColName){ - int i; - for(i=0; ipkg = dupstr(base); - z->version = dupstr(version); - z->release = release; -} -#endif - int zpm_begin(struct zpm *z) { char *errstr = 0; sqlite3_exec(z->db, "begin;", NULL, NULL, &errstr); diff --git a/zpm-contents b/zpm-contents index d6a5996..8b7dde0 100755 --- a/zpm-contents +++ b/zpm-contents @@ -67,15 +67,10 @@ cols=${cols%,} printf ', ' fi - cat <<-EOC - case when filetype = 'd' then - rtrim(path,'/') || '/' - when filetype = 'l' then - printf('%s -> %s', path, target) - else - path - end as path - EOC + printf "case\n"; + printf "when filetype = 'd' then rtrim(path,'/') || '/'\n" + printf "when filetype = 'l' then printf('%s -> %s', path, target)\n" + printf "else path end as path\n" fi printf 'from packagefiles_pkgid\nwhere true\n' if [ -n "$globlist" ]; then diff --git a/zpm-syncfs.c b/zpm-syncfs.c index ff80041..2e43dbe 100644 --- a/zpm-syncfs.c +++ b/zpm-syncfs.c @@ -960,13 +960,14 @@ static int install_files(void *f, int ncols, char **vals, char **cols) { if (mdsame && hashsame && (accept || overwrite)) { /* do nothing */ if (conf->dryrun || conf->verbose) { - fprintf(stderr, "accepting existing file: %s\n", nitem.dest); + fprintf(stderr, "accept %s: %s\n", + eisdir ? "directory" : "file", nitem.dest); } return 0; } if (mdsame && hashsame && !(accept || overwrite)) { /* error */ - return seterror(conf, "will not accept or overwrite existing file: %s", nitem.dest); + return seterror(conf, "file exists: %s", nitem.dest); } if (mdsame && !hashsame && overwrite) { /* install */ diff --git a/zpm-verify.c b/zpm-verify.c index fa690e9..14112c2 100644 --- a/zpm-verify.c +++ b/zpm-verify.c @@ -12,7 +12,6 @@ #include -#include "sqlite3.h" #include "zpm.h" #include "t/ctap/ctap.h" -- 2.40.0