This is a direct rip from another site. I have not modified this text by choice and hope the original writer wont mind. I found this because I was watching my pile of bsdpan- ports growing and needing updates and didn't really fancy doing it by using the perl package system.
This is a TCSH (CSH) script.
Its very fundamental use is to update all ports on a FreeBSD system as automatically as possible. If it runs into a problem it will stop and wait for user interaction.
Describes how to fix issues with removal of compat5x package.
This happens because the files have the flag schg on them.
schg = system immutabnle flag
This must be removed for a successful removal or re-installation of the compat5x package.
This fix will not work if you have the kernel in security mode 1 or above.
If your system uses kernel security mode 1 or above you need to boot the system into single-user mode and follow the instructions below. I would probably do the actual upgrade in single-user mode as well just to be on the safe side.