Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 25 May 2019 15:56:55 +0000 (UTC)
From:      Gordon Tetlow <gordon@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-user@freebsd.org
Subject:   svn commit: r348272 - user/cperciva/freebsd-update-build/scripts
Message-ID:  <201905251556.x4PFut5F024346@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: gordon
Date: Sat May 25 15:56:55 2019
New Revision: 348272
URL: https://svnweb.freebsd.org/changeset/base/348272

Log:
  Switch logic in indexfiles to always remove the uarch flag.
  
  On UFS filesystems, this is unneeded. On ZFS filesystems, the uarch
  flag is automatically set on file creation (and maybe update?). This
  is causing a lot of churn in the freebsd-update cycle where
  discrepancies in the uarch flag makes the system think a lot of metadata
  need to be corrected.

Modified:
  user/cperciva/freebsd-update-build/scripts/build.subr

Modified: user/cperciva/freebsd-update-build/scripts/build.subr
==============================================================================
--- user/cperciva/freebsd-update-build/scripts/build.subr	Sat May 25 11:27:56 2019	(r348271)
+++ user/cperciva/freebsd-update-build/scripts/build.subr	Sat May 25 15:56:55 2019	(r348272)
@@ -580,17 +580,25 @@ indexfiles () {
 	( cd ${WORKDIR}/$1/R && find trees -mindepth 2 |
 		grep -vE '/obj$' |
 		while read F; do
+			eval $(stat -s ${F})
+			# Remove the uarch flag as that is problematic
+			st_flags=$(($st_flags & ~04000))
+			st_mode_mid=$(( ($st_mode & 07000) >> 9))
+			st_mode_low=$(($st_mode & 0777))
 			if [ -L ${F} ]; then
 				echo -n "${F}|L|"
-				stat -n -f '%i|%u|%g|%Mp%Lp|%Of|' ${F};
+				printf "%u|%u|%u|%o%o|%o|" $st_ino $st_uid \
+				    $st_gid $st_mode_mid $st_mode_low $st_flags
 				readlink ${F};
 			elif [ -f ${F} ]; then
 				echo -n "${F}|f|"
-				stat -n -f '%i|%u|%g|%Mp%Lp|%Of|' ${F};
+				printf "%u|%u|%u|%o%o|%o|" $st_ino $st_uid \
+				    $st_gid $st_mode_mid $st_mode_low $st_flags
 				sha256 -q ${F};
 			elif [ -d ${F} ]; then
 				echo -n "${F}|d|"
-				stat -f '%i|%u|%g|%Mp%Lp|%Of|' ${F};
+				printf "%u|%u|%u|%o%o|%o|\n" $st_ino $st_uid \
+				    $st_gid $st_mode_mid $st_mode_low $st_flags
 			else
 				echo "Unknown file type: ${F}"		\
 				    >/dev/stderr



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201905251556.x4PFut5F024346>