]> pd.if.org Git - zpackage/blobdiff - zpm-pkginfo
let newpackage set additional fields
[zpackage] / zpm-pkginfo
index bf735c7801d19a300d502a21adcf8425aed16c69..ff55481c27e4022e66cd80caaabe6d1e9189c7b9 100755 (executable)
@@ -34,11 +34,11 @@ if [ -z "$pkgfile" ]; then
 fi
 
 zpm-test -v $pkgfile
-pkg=$(zpm-findpkg $pkgfile)
+pkg=$(zpm-findpkg -f $pkgfile)
 
 #.mode line
 {
-sqlite3 $pkgfile <<-EOS
+zpm shell $pkgfile <<-EOS
 select 
        printf('Package: %s
        Version: %s
@@ -62,24 +62,26 @@ EOS
 
 #mode user group hash mtime csvtags path
 
-sqlite3 $pkgfile <<-EOS
-.header on
+zpm shell $pkgfile <<-EOS
+.header off
 select
-       printf('%s %s %s %s %s %s',
+       printf('%s %s %s %s %s %s %s',
        F.mode, F.username, F.groupname,
        case when F.filetype = 'c' then
                F.devmajor || ',' || F.devminor
+       when F.filetype = 'd' then
+               'directory'
        else
                F.hash
        end 
        ,strftime('%Y-%m-%dT%H:%M:%S', F.mtime, 'unixepoch')
-       , T.tags
+       , coalesce(T.tags, '-')
        ,F.path)
 from packagefiles as F
 left join (
        select TG.package, TG.version, TG.release, TG.path
-       ,coalesce(group_concat(tag), '-') as tags
-       from packagefiletags TG
+       ,group_concat(tag) as tags
+       from pathtags TG
        group by package, version, release, path
 ) T
 on T.package = F.package and T.version = F.version and T.release = F.release