If a file is empty then remove it, instead of using a @*exec
Details
Details
Diff Detail
Diff Detail
- Repository
- rP FreeBSD ports repository
- Lint
No Lint Coverage - Unit
No Test Coverage - Build Status
Buildable 33933 Build 31130: arc lint + arc unit
Event Timeline
Comment Actions
I am sure there are examples of ports doing that, but listing a few here would be nice.
Comment Actions
mail/vpopmail/pkg-plist:33:@unexec if [ -f %D/vpopmail/etc/defaultdomain ] && [ ! -s %D/vpopmail/etc/defaultdomain ]; then rm -f %D/vpopmail/etc/defaultdomain; fi mail/mailagent/pkg-plist:38:@unexec [ -s %%ORGFILE%% ] || rm -f %%ORGFILE%% || true games/gnome-nibbles/pkg-plist:12:@unexec [ -s %D/share/games/gnibbles.4.1.scores ] || rm -f %D/share/games/gnibbles.4.1.scores games/bsdtris/pkg-plist:6:@unexec if test ! -s /var/games/bsdtris.scores; then rm -f /var/games/bsdtris.scores; fi games/xboing/pkg-plist:136:@unexec if test ! -s %D/lib/X11/xboing/.xboing.scr ; then rm -f %D/lib/X11/xboing/.xboing.scr ; fi games/tali/pkg-plist:6:@unexec [ -s %D/share/games/gtali.Regular.scores ] || rm -f %D/share/games/gtali.Regular.scores games/gnome-robots/pkg-plist:18:@unexec [ -s %D/share/games/gnobots.robots_with_safe_teleport.scores ] || rm -f %D/share/games/gnobots2.robots_with_safe_teleport.scores games/zangband/pkg-plist:6:@unexec cmp -s %D/%%ANGBANDLIB%%/apex/scores.raw /dev/null && rm %D/%%ANGBANDLIB%%/apex/scores.raw || true games/nighthawk/pkg-plist:203:@unexec if [ ! -s /var/games/nighthawk.scores ]; then rm -f /var/games/nighthawk.scores; fi net-mgmt/arpwatch/pkg-plist:15:@preunexec test -f %D/arpwatch/arp.dat && test -s %D/arpwatch/arp.dat || rm -f %D/arpwatch/arp.dat Mk/bsd.ocaml.mk:188: @${ECHO_CMD} "@postunexec if [ ! -s %D/${OCAML_LDCONF} ]; then ${RM} %D/${OCAML_LDCONF}; fi || true" >> ${TMPPLIST} databases/firebird25-server/pkg-plist:30:@preunexec [ -s /%%LOCALSTATEDIR%%/firebird.log ] || rm -f /%%LOCALSTATEDIR%%/firebird.log lang/php74/pkg-plist:223:@postunexec [ -s %D/include/php/ext/php_config.h ] || rm %D/include/php/ext/php_config.h ....
Comment Actions
I know it’s late now because it’s already been committed, but I think this should be renamed to @empty. @rmdir was renamed to @dir because plists most logically express the contents, not what to do when they’re deleted.
Comment Actions
I disagree @rmdir was renmaed @dir because it also ensures the directory is actually present and creates it.
@rmempty only remove files if they are empty, but do not create empty files.