From: Nathan Wagner Date: Wed, 6 Feb 2019 02:40:41 +0000 (+0000) Subject: fixes for zpm-update X-Git-Tag: v0.5.0~29 X-Git-Url: https://pd.if.org/git/?p=zpackage;a=commitdiff_plain;h=a694aec82a1062a9f6dce92ee62dcce229658f7a fixes for zpm-update --- diff --git a/Makefile b/Makefile index 5334ad8..c135bad 100644 --- a/Makefile +++ b/Makefile @@ -206,6 +206,26 @@ install: $(COMPILED) $(MANPAGES) scan-prep: clean sqlite/sqlite3.o sqlite/shell.o lib/liblzma.a @echo scan-build -v -o report make -j10 +# crypto/tls items +X255OBJ= \ +base.o \ +fe_0.o \ +fe_1.o \ +fe_add.o \ +fe_copy.o \ +fe_cswap.o \ +fe_frombytes.o \ +fe_invert.o \ +fe_mul.o \ +fe_mul121666.o \ +fe_sq.o \ +fe_sub.o \ +fe_tobytes.o \ +scalarmult.o + +x25519.o: $(addprefix crypto/ref10/, $(X255OBJ)) + ld -o $@ -r $+ + clean: rm -f *.o sqlite/*.o lib/*.o $(LZMAOBJ) liblzma.a \ libelf.a libzpm.a zpm-addfile soname \ @@ -214,4 +234,6 @@ clean: t/ctap/*.o \ $(ZPKGBIN) \ db.sql \ - elf/*.o lib/jsw/*.o + elf/*.o lib/jsw/*.o \ + $(addprefix crypto/ref10/, $(X255OBJ)) \ + x25519.o diff --git a/zpm-update b/zpm-update index dbec8b0..39c111a 100755 --- a/zpm-update +++ b/zpm-update @@ -132,10 +132,22 @@ while getopts f:d:R:nSCvAObBLUzp opt; do *) die "usage ..." ;; esac done -shift $(( OPTIND - 1)) +shift $(( OPTIND - 1 )) + +if [ -n "$rootdir" ]; then + : rootdir=${rootdir%%/} + ZPM_ROOT_DIR=$rootdir + export ZPM_ROOT_DIR +fi + +if [ -n "$localdb" ]; then + ZPMDB=$localdb +elif [ -z "$ZPMDB" ]; then + ZPMDB="$ZPM_ROOT_DIR/var/lib/zpm/local.db" +fi -ZPMDB=${localdb:-${ZPMDB:-/var/lib/zpm/local.db}} export ZPMDB + # create the localdb if needed zpm init $ZPMDB @@ -323,12 +335,6 @@ if [ -n "$to_remove" ]; then done fi -if [ -n "$rootdir" ]; then - ZPM_ROOT_DIR=$rootdir - export ZPM_ROOT_DIR - : rootdir=${rootdir%%/} -fi - if [ $dryrun -gt 0 ]; then runscripts=0 # we don't want to run post scripts on a dry-run syncopts="$syncopts -n"