From: Nathan Wagner Date: Sun, 15 Apr 2018 00:36:01 +0000 (-0500) Subject: expand install X-Git-Tag: v0.1.6~103 X-Git-Url: https://pd.if.org/git/?p=zpackage;a=commitdiff_plain;h=ff478f700fc6179cf7246b4f9624712c4e180c7e expand install --- diff --git a/zpm-install b/zpm-install index 26095d2..5c23bde 100755 --- a/zpm-install +++ b/zpm-install @@ -1,6 +1,14 @@ #!/bin/sh -#package=${1:-$ZPMPACKAGE} +# what we need to install a package: + +# recording repo: where we record what we've done +# source: where we get the package and files from +# install root: really just a prefix, but thought about differently, +# and we might need to do a chroot + +# zpm install [options] + pkgver=${ZPMPACKAGEVER:-1.0} pkgrel=${ZPMPACKAGEREL:-1} @@ -31,21 +39,28 @@ pkgroot=/ # TODO what's the difference between prefix and pkgroot # need an option to not chown the files # option to install but not merge/track -while getopts :f:v:r:d:a:u:l:p:b:P:R: opt; do + +# options +# -R install root, if installing as root, will chroot? +# -C no chroot, even if root +# -N no pre-scripts +# -X no post-scripts +# -f source repository file +# -d local (recording) repository database +# -D don't locally record +# -t only files matching tags +# -T exclude files matching tags + +chroot=1 + +while getopts :R:CNXf:d:Dt:T: opt; do case $opt in R) pkgroot="$OPTARG" ;; + C) chroot=0 ;; f) pkgfile="$OPTARG" ;; - v) pkgver="$OPTARG" ;; - r) pkgrel="$OPTARG" ;; - d) description="$OPTARG" ;; - a) arch="$OPTARG" ;; - u) url="$OPTARG" ;; - l) licenses="$OPTARG" ;; - p) packager="$OPTARG" ;; - b) builddate="$OPTARG" ;; - P) prefix="$OPTARG" ;; esac done + shift $((OPTIND - 1)) die() { @@ -80,6 +95,15 @@ select path from packagefiles EOS } +# find a repo file for a given package +findrepofor() { + false +} + +installpkg() ( + package="$1" +) + for pkg in $pkglist; do # TODO find scripts marked as pre-install # TODO if this is an upgrade, run pre-upgrade @@ -96,8 +120,8 @@ for pkg in $pkglist; do echo installing $pkglist filecount=$(pathlist | wc -l) echo $filecount files - pathlist - pathlist | xargs -t zpm ipkgfile -R "$pkgroot" -f $pkgfile -- $pkg + #pathlist + pathlist | xargs zpm ipkgfile -R "$pkgroot" -f $pkgfile -- $pkg # TODO find scripts marked as post-install # TODO if this is an upgrade, run post-upgrade