Bug 255626 - net/samba413: Orphaned files in STAGEDIR
Summary: net/samba413: Orphaned files in STAGEDIR
Status: Open
Alias: None
Product: Ports & Packages
Classification: Unclassified
Component: Individual Port(s) (show other bugs)
Version: Latest
Hardware: Any Any
: --- Affects Only Me
Assignee: Timur I. Bakeyev
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-05-05 18:09 UTC by Mark Felder
Modified: 2021-05-05 22:38 UTC (History)
1 user (show)

See Also:
bugzilla: maintainer-feedback? (timur)


Attachments
remove empty files (512 bytes, patch)
2021-05-05 18:10 UTC, Mark Felder
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Felder freebsd_committer 2021-05-05 18:09:33 UTC
===> Checking for items in STAGEDIR missing from pkg-plist
Error: Orphaned: bin/ecp.QnDgKzC3
Error: Orphaned: bin/ecp.RwhbsIDr
Error: Orphaned: bin/ecp.zkCfXZGw
Error: Orphaned: sbin/ecp.13yuHIqY
Error: Orphaned: sbin/ecp.Q31ZkEo6
Error: Orphaned: sbin/ecp.RQ651qO3
Error: Orphaned: sbin/ecp.iRqOwgUD
Error: Orphaned: sbin/ecp.uuZYIUTL
Error: Orphaned: sbin/ecp.xsOn7p5F


I've looked everywhere trying to figure out how these empty files are being created, but coming up empty handed. Very very strange.
Comment 1 Mark Felder freebsd_committer 2021-05-05 18:10:10 UTC
Created attachment 224699 [details]
remove empty files
Comment 2 Timur I. Bakeyev freebsd_committer 2021-05-05 22:38:38 UTC
Thanks, Mark, your fix, seems, pretty trivial to apply :)

I was trying to translate to `make` this shell construction:

```
find /usr/local/bin /usr/local/sbin /usr/local/libexec -type f -print0 | \
        ${XARGS} -0 -I % -S 1024 -n 1 ${SH} -c "case \"\`${FILE} --brief --mime-type '%'\`\" in 'application/'*) ${ECHO_CMD} '%' && ${STRIP_CMD} '%';; esac" STRIP
```

But got lost in additional escapes...

As Dmitry pointed me privately before all the problem exposes itself in FreeBSD 13 environment due clash of two issues:

1. `strip` creates temporary file before it actually starts the processing of the file and, in case it is not strippable(shell script, for example) just leave this temporary file around, without proper cleanup.

2. Before 13 it used to create that temporary file in /tmp, which was excluded from poudriere monitoring, but now the file is created in the same directory where original file is, hence leaving those orphaned temporary files around.


I guess it's worth a separate PR against the bin*, really.