3 #package=${1:-$ZPMPACKAGE}
4 pkgver=${ZPMPACKAGEVER:-1.0}
5 pkgrel=${ZPMPACKAGEREL:-1}
9 # allocate an install id, perhaps hash package and timestamp
10 # extract pre-scripts and run them
11 # get list of paths to install
12 # for each path, if directory, create and set mode
13 # for each path, create leading directories
14 # extract to something like /var/tmp/.hash, with low perms
15 # only atomic if same filesystem, so use .installid.hash in the
19 # after all the files, extract post scripts and run them
21 # option for "multipackage" just to let the system know that's what you meant
22 # option to take filenames from stdin
23 # parse package, version, release from file if not given
24 while getopts :f:v:r:d:a:u:l:p:b:P:R: opt; do
26 R) pkgroot="$OPTARG" ;;
27 f) pkgfile="$OPTARG" ;;
28 v) pkgver="$OPTARG" ;;
29 r) pkgrel="$OPTARG" ;;
30 d) description="$OPTARG" ;;
33 l) licenses="$OPTARG" ;;
34 p) packager="$OPTARG" ;;
35 b) builddate="$OPTARG" ;;
36 P) prefix="$OPTARG" ;;
42 if [ -z "$pkgfile" ]; then
43 # actually, if no pkgfile, get pkgfile from repo
44 pkgfile="$package-$pkgver-$pkgrel.zpm"
59 pkglist=$(zpm findpkg $pkgfile)
64 select path from packagefiles
65 where package||'-'||version||'-'||release = '$pkg'
70 for pkg in $pkglist; do
71 # TODO find scripts marked as pre-install
72 # TODO if this is an upgrade, run pre-upgrade
74 # TODO get total size of install so we can do a progress bar
76 # add package info to local package db
77 # zpm merge -L -f $pkgfile $pkg
78 # mark package in localdb as installing
79 # zpm setmark installing $pkg
80 # install all the files for a package
81 # TODO install directories first in order of path length
82 pathlist | xargs zpm ipkgfile -R "$pkgroot" -f $pkgfile -- $pkg
84 # TODO find scripts marked as post-install
85 # TODO if this is an upgrade, run post-upgrade
87 # mark as ready for install
88 #zpm setmark ready $pkg
91 #zpm setmark installed $pkglist