+conflicts() {
+ echo conflict check $pkg $pkgfile
+ #newver=$1
+ {
+ zpm shell $pkgfile<<-EOS
+ .separator " "
+ select hash,path from packagefiles
+ where package||'-'||version||'-'||release = '$pkg'
+ and filetype = 'r'
+ ;
+ EOS
+ } | while read hash path; do
+ rpath=$pkgroot$path
+ if [ -f $rpath ]; then
+ ihash=$(zpm hash $rpath)
+ if [ $ihash != $hash ]; then
+ die $path already exists
+ fi
+ elif [ -d $rpath ]; then
+ die $path already exists
+ fi
+ done
+
+ {
+ zpm shell $pkgfile<<-EOS
+ .separator " "
+ select path from packagefiles
+ where package||'-'||version||'-'||release = '$pkg'
+ and filetype = 'd'
+ ;
+ EOS
+ } | while read hash path; do
+ rpath=$pkgroot$path
+ if [ -f $rpath ]; then
+ die $path already exists
+ elif [ -d $rpath ]; then
+ die $path already exists
+ elif [ -e $rpath ]; then
+ die $path already exists
+ fi
+ done
+}
+