]> pd.if.org Git - zpackage/commitdiff
expand install
authorNathan Wagner <nw@hydaspes.if.org>
Sun, 15 Apr 2018 00:36:01 +0000 (19:36 -0500)
committerNathan Wagner <nw@hydaspes.if.org>
Sun, 15 Apr 2018 00:36:01 +0000 (19:36 -0500)
zpm-install

index 26095d26bd0ec80ba48e489e7cdbf9d5a18278dd..5c23bdeb889a25e9d37fb2a34fec3bb31b9a66ba 100755 (executable)
@@ -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] <package ...>
+
 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