From owner-svn-src-all@freebsd.org Thu Sep 5 20:26:21 2019 Return-Path: Delivered-To: svn-src-all@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 56160D27D8; Thu, 5 Sep 2019 20:26:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 46PXJs1g9pz4KX1; Thu, 5 Sep 2019 20:26:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 1D8A09B48; Thu, 5 Sep 2019 20:26:21 +0000 (UTC) (envelope-from bdrewery@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id x85KQLPp030500; Thu, 5 Sep 2019 20:26:21 GMT (envelope-from bdrewery@FreeBSD.org) Received: (from bdrewery@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id x85KQK7W030498; Thu, 5 Sep 2019 20:26:20 GMT (envelope-from bdrewery@FreeBSD.org) Message-Id: <201909052026.x85KQK7W030498@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: bdrewery set sender to bdrewery@FreeBSD.org using -f From: Bryan Drewery Date: Thu, 5 Sep 2019 20:26:20 +0000 (UTC) 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 X-SVN-Group: stable-12 X-SVN-Commit-Author: bdrewery X-SVN-Commit-Paths: stable/12/lib/libsysdecode X-SVN-Commit-Revision: 351890 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Sep 2019 20:26:21 -0000 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