Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Sep 2019 20:26:20 +0000 (UTC)
From:      Bryan Drewery <bdrewery@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-12@freebsd.org
Subject:   svn commit: r351890 - stable/12/lib/libsysdecode
Message-ID:  <201909052026.x85KQK7W030498@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: bdrewery
Date: Thu Sep  5 20:26:20 2019
New Revision: 351890
URL: https://svnweb.freebsd.org/changeset/base/351890

Log:
  MFC r339635,r350301,r350327,r351151:
  
    r339635:
      Fix regex for extracting SHM_* values for libsysdecode
    r350301:
      libsysdecode: add explicit dependencies on recently changed headers
    r350327:
      libsysdecode: use the proper include directory
    r351151:
      Rework r339635 to fix .depend.tables.h handling.

Modified:
  stable/12/lib/libsysdecode/Makefile
  stable/12/lib/libsysdecode/mktables
Directory Properties:
  stable/12/   (props changed)

Modified: stable/12/lib/libsysdecode/Makefile
==============================================================================
--- stable/12/lib/libsysdecode/Makefile	Thu Sep  5 19:35:30 2019	(r351889)
+++ stable/12/lib/libsysdecode/Makefile	Thu Sep  5 20:26:20 2019	(r351890)
@@ -107,7 +107,7 @@ MLINKS+=sysdecode_mask.3 sysdecode_accessmode.3 \
 	sysdecode_mask.3 sysdecode_wait4_options.3 \
 	sysdecode_mask.3 sysdecode_wait6_options.3
 
-CLEANFILES= ioctl.c tables.h
+CLEANFILES= ioctl.c ioctl.c.tmp tables.h
 
 .if defined(COMPAT_32BIT)
 CPP+=	-m32

Modified: stable/12/lib/libsysdecode/mktables
==============================================================================
--- stable/12/lib/libsysdecode/mktables	Thu Sep  5 19:35:30 2019	(r351889)
+++ stable/12/lib/libsysdecode/mktables	Thu Sep  5 20:26:20 2019	(r351890)
@@ -43,7 +43,8 @@ fi
 include_dir=$1
 if [ -n "$2" ]; then
 	output_file="$2"
-	exec > "$output_file"
+	output_tmp=$(mktemp -u)
+	exec > "$output_tmp"
 fi
 
 all_headers=
@@ -123,7 +124,7 @@ gen_table "rlimit"          "RLIMIT_[A-Z]+[[:space:]]+
 gen_table "rusage"          "RUSAGE_[A-Z]+[[:space:]]+[-0-9]+"             "sys/resource.h"
 gen_table "schedpolicy"     "SCHED_[A-Z]+[[:space:]]+[0-9]+"               "sched.h"
 gen_table "sendfileflags"   "SF_[A-Z]+[[:space:]]+[0-9]+"                  "sys/socket.h"
-gen_table "shmatflags"      "SHM_[A-Z]+[[:space:]]+[0-9]{6}+"              "sys/shm.h"
+gen_table "shmatflags"      "SHM_[A-Z]+[[:space:]]+[0-9]{6}"               "sys/shm.h"
 gen_table "shutdownhow"     "SHUT_[A-Z]+[[:space:]]+[0-9]+"                "sys/socket.h"
 gen_table "sigbuscode"      "BUS_[A-Z]+[[:space:]]+[0-9]+"                 "sys/signal.h"
 gen_table "sigchldcode"     "CLD_[A-Z]+[[:space:]]+[0-9]+"                 "sys/signal.h"
@@ -167,9 +168,17 @@ fi
 
 # Generate a .depend file for our output file
 if [ -n "$output_file" ]; then
-	echo "$output_file: \\" > ".depend.$output_file"
-	echo "$all_headers" | tr ' ' '\n' | sort -u |
-	    sed -e "s,^,	$include_dir/," -e 's,$, \\,' >> \
-	    ".depend.$output_file"
-	echo >> ".depend.$output_file"
+	depend_tmp=$(mktemp -u)
+	{
+		echo "$output_file: \\"
+		echo "$all_headers" | tr ' ' '\n' | sort -u |
+		    sed -e "s,^,	$include_dir/," -e 's,$, \\,'
+		echo
+	} > "$depend_tmp"
+	if cmp -s "$output_tmp" "$output_file"; then
+		rm -f "$output_tmp" "$depend_tmp"
+	else
+		mv -f "$depend_tmp" ".depend.${output_file}"
+		mv -f "$output_tmp" "$output_file"
+	fi
 fi



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