diff options
-rw-r--r-- | Mk/Scripts/qa.sh | 10 | ||||
-rw-r--r-- | Mk/Uses/charsetfix.mk | 2 | ||||
-rw-r--r-- | Mk/Uses/gnome.mk | 6 | ||||
-rw-r--r-- | Mk/Uses/pathfix.mk | 4 | ||||
-rw-r--r-- | Mk/bsd.port.mk | 7 | ||||
-rwxr-xr-x | Tools/scripts/sed_checked.sh | 13 |
6 files changed, 35 insertions, 7 deletions
diff --git a/Mk/Scripts/qa.sh b/Mk/Scripts/qa.sh index bf589e404248..2e6c2579b1fa 100644 --- a/Mk/Scripts/qa.sh +++ b/Mk/Scripts/qa.sh @@ -1004,10 +1004,18 @@ pkgmessage() return 0 } +reinplace() +{ + if [ -f ${REWARNFILE} ]; then + warn "Possible REINPLACE_CMD issues" + cat ${REWARNFILE} + fi +} + checks="shebang symlinks paths stripped desktopfileutils sharedmimeinfo" checks="$checks suidfiles libtool libperl prefixvar baselibs terminfo" checks="$checks proxydeps sonames perlcore no_arch gemdeps gemfiledeps flavors" -checks="$checks license depends_blacklist pkgmessage" +checks="$checks license depends_blacklist pkgmessage reinplace" ret=0 cd ${STAGEDIR} || exit 1 diff --git a/Mk/Uses/charsetfix.mk b/Mk/Uses/charsetfix.mk index 7f99da0e6c3d..735bc83dd993 100644 --- a/Mk/Uses/charsetfix.mk +++ b/Mk/Uses/charsetfix.mk @@ -19,7 +19,7 @@ CHARSETFIX_MAKEFILEIN?= Makefile.in _USES_patch+= 600:charsetfix-post-patch charsetfix-post-patch: - @${FIND} ${WRKSRC} -name "${CHARSETFIX_MAKEFILEIN}" -type f | ${XARGS} ${REINPLACE_CMD} \ + @${FIND} ${WRKSRC} -name "${CHARSETFIX_MAKEFILEIN}" -type f | ${XARGS} ${FRAMEWORK_REINPLACE_CMD} \ -e 's|need_charset_alias=true|need_charset_alias=false|g ; \ s|test -f $$(charset_alias)|false|g ;\ s|test -f $$(DESTDIR)$$(libdir)/charset.alias|false|g' diff --git a/Mk/Uses/gnome.mk b/Mk/Uses/gnome.mk index 3d6603e64675..bd39c8719451 100644 --- a/Mk/Uses/gnome.mk +++ b/Mk/Uses/gnome.mk @@ -104,7 +104,7 @@ USE_LOCALE?= en_US.UTF-8 GNOME_MAKEFILEIN?= Makefile.in SCROLLKEEPER_DIR= /var/db/rarian -referencehack_PRE_PATCH= ${FIND} ${WRKSRC} -name "Makefile.in" -type f | ${XARGS} ${REINPLACE_CMD} -e \ +referencehack_PRE_PATCH= ${FIND} ${WRKSRC} -name "Makefile.in" -type f | ${XARGS} ${FRAMEWORK_REINPLACE_CMD} -e \ "s|test \"\$$\$$installfiles\" = '\$$(srcdir)/html/\*'|:|" GNOME_HTML_DIR?= ${PREFIX}/share/doc @@ -313,12 +313,12 @@ pygnome2_USE_GNOME_IMPL=libgnomeui pygtk2 intltool_BUILD_DEPENDS= ${LOCALBASE}/bin/intltool-extract:textproc/intltool -intlhack_PRE_PATCH= ${FIND} ${WRKSRC} -name "intltool-merge.in" | ${XARGS} ${REINPLACE_CMD} \ +intlhack_PRE_PATCH= ${FIND} ${WRKSRC} -name "intltool-merge.in" | ${XARGS} ${FRAMEWORK_REINPLACE_CMD} \ 's|mkdir $$lang or|mkdir $$lang, 0777 or| ; \ s|^push @INC, "/.*|push @INC, "${LOCALBASE}/share/intltool";| ; \ s|/usr/bin/iconv|${ICONV_CMD}|g ; \ s|unpack *[(]'"'"'U\*'"'"'|unpack ('"'"'C*'"'"'|' ; \ - ${FIND} ${WRKSRC} -name configure | ${XARGS} ${REINPLACE_CMD} \ + ${FIND} ${WRKSRC} -name configure | ${XARGS} ${FRAMEWORK_REINPLACE_CMD} \ 's/DATADIRNAME=lib/DATADIRNAME=share/' intlhack_USE_GNOME_IMPL=intltool diff --git a/Mk/Uses/pathfix.mk b/Mk/Uses/pathfix.mk index 2fd91ab34022..6e06dfc110e2 100644 --- a/Mk/Uses/pathfix.mk +++ b/Mk/Uses/pathfix.mk @@ -28,7 +28,7 @@ _USES_patch+= 190:pathfix pathfix: .if ${USES:Mcmake*} .for file in ${PATHFIX_CMAKELISTSTXT} - @${FIND} ${PATHFIX_WRKSRC} -name "${file}" -type f | ${XARGS} ${REINPLACE_CMD} -e \ + @${FIND} ${PATHFIX_WRKSRC} -name "${file}" -type f | ${XARGS} ${FRAMEWORK_REINPLACE_CMD} -e \ 's|[{]CMAKE_INSTALL_LIBDIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \ s|[{]CMAKE_INSTALL_DATAROOTDIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \ s|[{]INSTALL_LIB_DIR[}]/pkgconfig|{CMAKE_INSTALL_PREFIX}/libdata/pkgconfig|g ; \ @@ -43,7 +43,7 @@ pathfix: .endfor .else .for file in ${PATHFIX_MAKEFILEIN} - @${FIND} ${PATHFIX_WRKSRC} -name "${file}" -type f | ${XARGS} ${REINPLACE_CMD} -e \ + @${FIND} ${PATHFIX_WRKSRC} -name "${file}" -type f | ${XARGS} ${FRAMEWORK_REINPLACE_CMD} -e \ 's|[(]libdir[)]/locale|(prefix)/share/locale|g ; \ s|[(]libdir[)]/pkgconfig|(prefix)/libdata/pkgconfig|g ; \ s|[(]LIBDIR[)]/pkgconfig|(PREFIX)/libdata/pkgconfig|g ; \ diff --git a/Mk/bsd.port.mk b/Mk/bsd.port.mk index 4888cec28fc5..7872f35592a5 100644 --- a/Mk/bsd.port.mk +++ b/Mk/bsd.port.mk @@ -1032,6 +1032,7 @@ NOTPHONY?= FLAVORS?= FLAVOR?= OVERLAYS?= +REWARNFILE?= ${WRKDIR}/reinplace_warnings.txt # Disallow forced FLAVOR as make argument since we cannot change it to the # proper default. .if empty(FLAVOR) && !empty(.MAKEOVERRIDES:MFLAVOR) @@ -1622,6 +1623,7 @@ QA_ENV+= STAGEDIR=${STAGEDIR} \ PREFIX=${PREFIX} \ LINUXBASE=${LINUXBASE} \ LOCALBASE=${LOCALBASE} \ + REWARNFILE=${REWARNFILE} \ "STRIP=${STRIP}" \ TMPPLIST=${TMPPLIST} \ CURDIR='${.CURDIR}' \ @@ -2010,7 +2012,12 @@ MAKE_ENV+= LANG=${USE_LOCALE} LC_ALL=${USE_LOCALE} # Macro for doing in-place file editing using regexps REINPLACE_ARGS?= -i.bak +.if defined(DEVELOPER) +REINPLACE_CMD?= ${SETENV} WRKSRC=${WRKSRC} REWARNFILE=${REWARNFILE} ${PORTSDIR}/Tools/scripts/sed_checked.sh +.else REINPLACE_CMD?= ${SED} ${REINPLACE_ARGS} +.endif +FRAMEWORK_REINPLACE_CMD?= ${SED} -i.bak # Names of cookies used to skip already completed stages EXTRACT_COOKIE?= ${WRKDIR}/.extract_done.${PORTNAME}.${PREFIX:S/\//_/g} diff --git a/Tools/scripts/sed_checked.sh b/Tools/scripts/sed_checked.sh new file mode 100755 index 000000000000..1592062c4bf3 --- /dev/null +++ b/Tools/scripts/sed_checked.sh @@ -0,0 +1,13 @@ +#!/bin/sh + +set -e +/usr/bin/sed -i.bak "$@" +for x in "${@}" ; do + if [ -f "${x}" ]; then + if cmp -s "${x}" "${x}".bak ; then + if [ ! -z "${REWARNFILE}" ]; then + echo sed failed: backup file same as original: ${x#${WRKSRC}/} >> ${REWARNFILE} + fi + fi + fi +done |