Date: Fri, 8 Jun 2018 09:26:41 +0000 (UTC) From: Mathieu Arnold <mat@FreeBSD.org> To: ports-committers@freebsd.org, svn-ports-all@freebsd.org, svn-ports-head@freebsd.org Subject: svn commit: r471994 - head/Mk/Scripts Message-ID: <201806080926.w589Qf8o044793@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: mat Date: Fri Jun 8 09:26:41 2018 New Revision: 471994 URL: https://svnweb.freebsd.org/changeset/ports/471994 Log: SC1004: This backslash+linefeed is literal. Break outside single quotes if you just want to break the line. You have a single quoted string containing a backslash followed by a linefeed (newline). Unlike double quotes or unquoted strings, this has no special meaning. The string will contain a literal backslash and a linefeed. If you wanted to break the line but not add a linefeed to the string, stop the single quote, break the line, and reopen it. PR: 227109 Submitted by: mat Sponsored by: Absolight Modified: head/Mk/Scripts/qa.sh (contents, props changed) head/Mk/Scripts/smart_makepatch.sh (contents, props changed) Modified: head/Mk/Scripts/qa.sh ============================================================================== --- head/Mk/Scripts/qa.sh Fri Jun 8 09:26:38 2018 (r471993) +++ head/Mk/Scripts/qa.sh Fri Jun 8 09:26:41 2018 (r471994) @@ -208,8 +208,8 @@ stripped() { # files with spaces are kept intact. # Using readelf -h ... /ELF Header:/ will match on all ELF files. find ${STAGEDIR} -type f ! -name '*.a' ! -name '*.o' \ - -exec readelf -S {} + 2>/dev/null | awk '\ - /File:/ {sub(/File: /, "", $0); file=$0} \ + -exec readelf -S {} + 2>/dev/null | awk ' + /File:/ {sub(/File: /, "", $0); file=$0} /[[:space:]]\.debug_info[[:space:]]*PROGBITS/ {print file}' | while read -r f; do warn "'${f#${STAGEDIR}${PREFIX}/}' is not stripped consider trying INSTALL_TARGET=install-strip or using \${STRIP_CMD}" @@ -688,9 +688,9 @@ proxydeps() { already="${already} ${dep_file}" done <<-EOT $(env LD_LIBMAP_DISABLE=1 ldd -a "${STAGEDIR}${file}" | \ - awk '\ - BEGIN {section=0}\ - /^\// {section++}\ + awk ' + BEGIN {section=0} + /^\// {section++} !/^\// && section<=1 && ($3 ~ "^'${PREFIX}'" || $3 ~ "^'${LOCALBASE}'") {print $3}') EOT done <<-EOT Modified: head/Mk/Scripts/smart_makepatch.sh ============================================================================== --- head/Mk/Scripts/smart_makepatch.sh Fri Jun 8 09:26:38 2018 (r471993) +++ head/Mk/Scripts/smart_makepatch.sh Fri Jun 8 09:26:41 2018 (r471994) @@ -51,9 +51,9 @@ strip_path() { echo ${raw_name} else echo ${raw_name} | awk -v sc=${STRIP_COMPONENTS} -F "/" \ - '{ for (x = sc + 1; x <= NF; x++) { \ - slash = (x>sc+1) ? "/" : ""; \ - printf ("%s%s", slash, $x); \ + '{ for (x = sc + 1; x <= NF; x++) { + slash = (x>sc+1) ? "/" : ""; + printf ("%s%s", slash, $x); }}' fi } @@ -135,33 +135,33 @@ extract_comment_from_patch() { rawname=$(grep "^+++ " ${existing_patch} | \ awk -v num=${num} '{x++; if (x==num) print $2}') fname=$(std_patch_filename $rawname) - awk -v num=${num} '\ - BEGIN { done=0; x=0; hunk=0; looking=(num==1) } \ - { \ - if (!done) { \ - if ($1 == "@@") { \ - split ($2,a,","); \ - split ($3,b,","); \ + awk -v num=${num} ' + BEGIN { done=0; x=0; hunk=0; looking=(num==1) } + { + if (!done) { + if ($1 == "@@") { + split ($2,a,","); + split ($3,b,","); hca = a[2]; hcb = a[3]; hunk = 1; - } else if (hunk) { \ - first=substr($1,1,1); \ - if (first == "-") { hca-- } \ - else if (first == "+") { hcb-- } \ - else {hca--; hcb--} \ - if (hca == 0 && hcb == 0) {hunk = 0} \ - } \ - if ($1 == "---") { \ - x++; \ - if (x == num) { done = 1 } \ - if (x + 1 == num) { looking = 1 } \ - } else if (!hunk && looking) { \ - if ($1!="diff" && $1!="index" && $1!="+++") {\ - print $0 \ - } \ - } \ - } \ + } else if (hunk) { + first=substr($1,1,1); + if (first == "-") { hca-- } + else if (first == "+") { hcb-- } + else {hca--; hcb--} + if (hca == 0 && hcb == 0) {hunk = 0} + } + if ($1 == "---") { + x++; + if (x == num) { done = 1 } + if (x + 1 == num) { looking = 1 } + } else if (!hunk && looking) { + if ($1!="diff" && $1!="index" && $1!="+++") { + print $0 + } + } + } }' ${existing_patch} > ${COMMENTS}/${fname} done } @@ -200,13 +200,13 @@ regenerate_patches() { } get_patch_name() { - awk -v name=$1 '\ - { if ($2 == name) \ - { \ - if (!done) { print $1 }; \ - done = 1; \ - } \ - } \ + awk -v name=$1 ' + { if ($2 == name) + { + if (!done) { print $1 }; + done = 1; + } + } END { if (!done) print name }' ${PATCHMAP} }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201806080926.w589Qf8o044793>