-select 'remove',
- printf('%s-%s-%s', PFU.package, PFU.version, PFU.release) as pkgid,
- PFU.path,
- PFU.username, PFU.uid, PFU.groupname, PFU.gid, PFU.mode, PFU.filetype,
- PFU.mtime, PFU.hash,
- PFU.configuration + case when PFC.configuration = 1 then 2 else 0 end
+select
+case
+when PFI.filetype is not 'l'
+ and PFI.filetype is PFC.filetype
+ and PFI.mode is PFC.mode and PFI.username is PFC.username
+ and PFI.groupname is PFC.groupname and PFI.hash is PFC.hash
+ then 'noop'
+when PFI.filetype is 'l'
+ and PFI.target is PFC.target
+ and PFI.filetype is PFC.filetype
+ and PFI.mode is PFC.mode and PFI.username is PFC.username
+ and PFI.groupname is PFC.groupname and PFI.hash is PFC.hash
+ then 'noop'
+when PC.status = 'installed' then 'md conflict'
+else 'update'
+end as op,
+ printf('%s-%s-%s', PFI.package, PFI.version, PFI.release) as pkgid,
+ PFI.path, PFI.username, PFI.uid, PFI.groupname, PFI.gid, PFI.mode,
+ PFI.filetype, PFI.mtime, PFI.hash,
+ PFI.configuration + case when PFC.configuration = 1 then 2 else 0 end