I noticed when adding this port to my builds recently, that the post-install rules throw an error. For example, if I just have portmaster rebuild the port, like this: # portmaster bsd-sort ===>>> Currently installed version: bsd-sort-20120716 ===>>> Port directory: /usr/ports/textproc/bsdsort [...] ===>>> Creating a backup package for old version bsd-sort-20120716 Creating package for bsd-sort-20120716 Updating database digests format: 100% Checking integrity... done (0 conflicting) Deinstallation has been requested for the following 1 packages (of 0 packages in the universe): Installed packages to be REMOVED: bsd-sort-20120716 The operation will free 82 kB. [1/1] Deleting bsd-sort-20120716: 100% ===> Installing for bsd-sort-20120716 ===> Checking if bsd-sort already installed ===> Registering installation for bsd-sort-20120716 ln: /usr/local/bin/bsdsort: File exists ln: /usr/local/bin/gnusort: File exists pkg-static: POST-INSTALL script failed ===>>> Re-installation of bsd-sort-20120716 complete It's the warning about "ln: /usr/local/bin/bsdsort: File exists" and "ln: /usr/local/bin/gnusort: File exists" that concern me. The same errors occur when I manually delete the package first, and do a fresh install. Thanks for your attention.
You're not going to like this answer, but portmaster is not an official FreeBSD tool. This port seems to have the ability to overwrite base (not by default) and I don't see anything that would cause what you are reporting. I'm cc'ing the Bryan who sort of cares about portmaster though.
Oh, that's a fair response, but the problem happens straight from the /usr/ports/textproc/bsdsort directory too. If you take portmaster out of the equation, you still get the same failure: root@stable9-172: cd /usr/ports/textproc/bsdsort root@stable9-173: make reinstall ===> License BSD2CLAUSE accepted by the user ===> Found saved configuration for bsd-sort-20120716 ===> bsd-sort-20120716 depends on file: /usr/local/sbin/pkg - found ===> Fetching all distfiles required by bsd-sort-20120716 for building ===> Extracting for bsd-sort-20120716 => SHA256 Checksum OK for sort-20120716.tar.gz. ===> Patching for bsd-sort-20120716 ===> Applying FreeBSD patches for bsd-sort-20120716 ===> Configuring for bsd-sort-20120716 ===> Building for bsd-sort-20120716 Warning: Object directory not changed from original /usr/ports/textproc/bsdsort/work/sort clang -O2 -pipe -std=c99 -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -DSORT_THREADS -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -c bwstring.c clang -O2 -pipe -std=c99 -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -DSORT_THREADS -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -c coll.c clang -O2 -pipe -std=c99 -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -DSORT_THREADS -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -c file.c clang -O2 -pipe -std=c99 -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -DSORT_THREADS -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -c mem.c clang -O2 -pipe -std=c99 -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -DSORT_THREADS -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -c radixsort.c clang -O2 -pipe -std=c99 -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -DSORT_THREADS -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -c sort.c clang -O2 -pipe -std=c99 -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -DSORT_THREADS -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -c vsort.c /usr/bin/sed -e 's|%%THREADS%%||g' -e 's|%%NLS%%||g' sort.1.in >sort.1 cat /usr/ports/textproc/bsdsort/work/sort/nls/hu_HU.ISO8859-2.msg > hu_HU.ISO8859-2.msg gzip -cn sort.1 > sort.1.gz gencat hu_HU.ISO8859-2.cat hu_HU.ISO8859-2.msg clang -O2 -pipe -std=c99 -fstack-protector -fno-strict-aliasing -fno-omit-frame-pointer -DSORT_THREADS -std=gnu99 -Qunused-arguments -fstack-protector -Wsystem-headers -Werror -Wall -Wno-format-y2k -W -Wno-unused-parameter -Wstrict-prototypes -Wmissing-prototypes -Wpointer-arith -Wreturn-type -Wcast-qual -Wwrite-strings -Wswitch -Wshadow -Wunused-parameter -Wcast-align -Wchar-subscripts -Winline -Wnested-externs -Wredundant-decls -Wold-style-definition -Wno-pointer-sign -Wno-empty-body -Wno-string-plus-int -fstack-protector -lpthread -lmd -o sort bwstring.o coll.o file.o mem.o radixsort.o sort.o vsort.o ===> Staging for bsd-sort-20120716 ===> Generating temporary packing list install -o root -g wheel -m 555 sort /usr/ports/textproc/bsdsort/work/stage/usr/local/bin/sort install -o root -g wheel -m 444 hu_HU.ISO8859-2.cat /usr/ports/textproc/bsdsort/work/stage/usr/local/share/nls/hu_HU.ISO8859-2/sort.cat install -o root -g wheel -m 444 sort.1.gz /usr/ports/textproc/bsdsort/work/stage/usr/local/man/man1 /bin/ln -s /usr/local/bin/sort /usr/ports/textproc/bsdsort/work/stage/usr/local/bin/bsdsort /bin/ln -s /usr/bin/sort /usr/ports/textproc/bsdsort/work/stage/usr/local/bin/gnusort ====> Compressing man pages (compress-man) ===> Installing for bsd-sort-20120716 ===> Registering installation for bsd-sort-20120716 ln: /usr/local/bin/bsdsort: File exists ln: /usr/local/bin/gnusort: File exists pkg-static: POST-INSTALL script failed
i can reproduce it too, and on the first install. I think it's these @exec lines in the pkg-plist doing it. It's done in post-install and then repeated in pkg-plist. I don't think the @exec is needed at all. More-ever, overwriting base is sort of taboo these days, maybe we should just remove that option while we are looking at this.
I guess I'll take this but I won't get to it very soon.
I do think allowing to overwrite base for this port bring nothing
A commit references this bug: Author: marino Date: Sat Nov 22 19:24:06 UTC 2014 New revision: 373093 URL: https://svnweb.freebsd.org/changeset/ports/373093 Log: textproc/bsdsort: Fix install error, remove OVERWRITE_BASE option This port was using pkg-plist tricks to install install symlinks in a post-install phase. These were now needed due to how pkg works. However, between the complication added by overwriting base and the general trend to frown on such days, I just removed the option entirely. I also moved the now much shorter plist into the Makefile. PR: 194814 Submitted by: lidl (pix.net) Fixed by: marino Changes: head/textproc/bsdsort/Makefile head/textproc/bsdsort/pkg-plist
Done!