3 package=${1:-$ZPMPACKAGE}
4 pkgver=${ZPMPACKAGEVER:-1.0}
5 pkgrel=${ZPMPACKAGEREL:-1}
9 # option for "multipackage" just to let the system know that's what you meant
10 # option to take filenames from stdin
11 # parse package, version, release from file if not given
12 while getopts :f:v:r:d:a:u:l:p:b:P: opt; do
14 R) pkgroot="$OPTARG" ;;
16 f) pkgfile="$OPTARG" ;;
17 v) pkgver="$OPTARG" ;;
18 r) pkgrel="$OPTARG" ;;
19 d) description="$OPTARG" ;;
22 l) licenses="$OPTARG" ;;
23 p) packager="$OPTARG" ;;
24 b) builddate="$OPTARG" ;;
25 P) prefix="$OPTARG" ;;
32 if [ -z "$pkgfile" ]; then
33 pkgfile="$package-$pkgver-$pkgrel.zpm"
37 pkg=$(zpm-findpkg -f $pkgfile)
41 zpm shell $pkgfile <<-EOS
53 package, version, release, url, licenses, packager,description,
54 strftime('%Y-%m-%dT%H:%M:%S', build_time, 'unixepoch'),
59 '$pkg' = package||'-'||version||'-'||release
63 #mode user group hash mtime csvtags path
65 zpm shell $pkgfile <<-EOS
68 printf('%s %s %s %s %s %s %s',
69 F.mode, F.username, F.groupname,
70 case when F.filetype = 'c' then
71 F.devmajor || ',' || F.devminor
72 when F.filetype = 'd' then
77 ,strftime('%Y-%m-%dT%H:%M:%S', F.mtime, 'unixepoch')
78 , coalesce(T.tags, '-')
80 from packagefiles as F
82 select TG.package, TG.version, TG.release, TG.path
83 ,group_concat(tag) as tags
85 group by package, version, release, path
87 on T.package = F.package and T.version = F.version and T.release = F.release
89 -- apparently going to have to do this in C because there's
90 -- no way to order the aggregated tags
92 '$pkg' = F.package||'-'||F.version||'-'||F.release
99 path text, -- filesystem path
100 mode text, -- perms, use text for octal rep?
101 username text, -- name of owner
102 groupname text, -- group of owner
103 uid integer, -- numeric uid, generally ignored
104 gid integer, -- numeric gid, generally ignored
105 filetype varchar default 'r',
109 -- h hard link -- not supported
110 -- c character special and b device special files add dev number column
112 -- p fifos (i.e. pipe)
113 target text, -- link target for links
114 -- device file dev numbers, should probably be a separate table
117 hash text, -- null if no actual content, i.e. anything but a regular file
130 mode user group hash mtime csvtags path
131 following order by path