FreeBSD Bugzilla – Attachment 145658 Details for
Bug 192577
Allow user of 'mergemaster' to automatically install files that differ only in comments
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
patch
patch-mergemaster.patch (text/plain), 3.97 KB, created by
Yuri Victorovich
on 2014-08-11 11:09:22 UTC
(
hide
)
Description:
patch
Filename:
MIME Type:
Creator:
Yuri Victorovich
Created:
2014-08-11 11:09:22 UTC
Size:
3.97 KB
patch
obsolete
>--- usr.sbin/mergemaster/mergemaster.sh (revision 269778) >+++ usr.sbin/mergemaster/mergemaster.sh (working copy) >@@ -12,6 +12,9 @@ > > PATH=/bin:/usr/bin:/usr/sbin > >+DIFF_TMP=/var/tmp/tmp.mergemaster`date +%m%d.%H.%M.%S` >+DIFF_COMMENTS_PASS=no >+ > display_usage () { > VERSION_NUMBER=`grep "[$]FreeBSD:" $0 | cut -d ' ' -f 4` > echo "mergemaster version ${VERSION_NUMBER}" >@@ -139,15 +142,34 @@ > esac > fi > if [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" ]; then >- echo '' >- echo ' ====================================================================== ' >- echo '' >- ( >- echo " *** Displaying differences between ${COMPFILE} and installed version:" >+ diff ${DIFF_FLAG} ${DIFF_OPTIONS} "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" > ${DIFF_TMP} >+ # See if differences are in comments only >+ DIFF_COMMENTS_ONLY=no >+ if [ ${DIFF_FLAG} == "-u" ]; then >+ if [ "`tail -n+3 ${DIFF_TMP} | grep -E "^(\\+|\\-)"`" == \ >+ "`tail -n+3 ${DIFF_TMP} | grep -E "^(\\+|\\-)#"`" ]; then >+ DIFF_COMMENTS_ONLY=yes >+ fi >+ fi >+ if [ ${DIFF_FLAG} == "-c" ]; then >+ if [ "`tail -n+3 ${DIFF_TMP} | grep -E "^! "`" == \ >+ "`tail -n+3 ${DIFF_TMP} | grep -E "^! #"`" ]; then >+ DIFF_COMMENTS_ONLY=yes >+ fi >+ fi >+ # Display the file if differences are substantial or user wants to see all of them >+ if [ ${DIFF_COMMENTS_ONLY} == "no" -o ${DIFF_COMMENTS_PASS} == "no" ]; then > echo '' >- diff ${DIFF_FLAG} ${DIFF_OPTIONS} "${DESTDIR}${COMPFILE#.}" "${COMPFILE}" >- ) | ${PAGER} >- echo '' >+ echo ' ====================================================================== ' >+ echo '' >+ ( >+ echo " *** Displaying differences between ${COMPFILE} and installed version:" >+ echo '' >+ cat ${DIFF_TMP} >+ ) | ${PAGER} >+ echo '' >+ fi >+ rm -f ${DIFF_TMP} > fi > else > echo '' >@@ -173,19 +195,28 @@ > esac > fi > >- echo " Use 'd' to delete the temporary ${COMPFILE}" >- echo " Use 'i' to install the temporary ${COMPFILE}" >- case "${NO_INSTALLED}" in >- '') >- echo " Use 'm' to merge the temporary and installed versions" >- echo " Use 'v' to view the diff results again" >- ;; >- esac >- echo '' >- echo " Default is to leave the temporary file to deal with by hand" >- echo '' >- echo -n "How should I deal with this? [Leave it for later] " >- read HANDLE_COMPFILE >+ if [ ${DIFF_COMMENTS_ONLY} == "no" -o ${DIFF_COMMENTS_PASS} == "no" ]; then >+ echo " Use 'd' to delete the temporary ${COMPFILE}" >+ echo " Use 'i' to install the temporary ${COMPFILE}" >+ if [ ${DIFF_COMMENTS_ONLY} == "yes" ]; then >+ echo " Use 'a' to install the temporary ${COMPFILE} and other files" >+ echo " that only differ in comments" >+ fi >+ case "${NO_INSTALLED}" in >+ '') >+ echo " Use 'm' to merge the temporary and installed versions" >+ echo " Use 'v' to view the diff results again" >+ ;; >+ esac >+ echo '' >+ echo " Default is to leave the temporary file to deal with by hand" >+ echo '' >+ echo -n "How should I deal with this? [Leave it for later] " >+ read HANDLE_COMPFILE >+ else >+ # Pass automatically >+ HANDLE_COMPFILE="p" >+ fi > > case "${HANDLE_COMPFILE}" in > [dD]) >@@ -193,7 +224,7 @@ > echo '' > echo " *** Deleting ${COMPFILE}" > ;; >- [iI]) >+ [iIaAp]) > echo '' > if mm_install "${COMPFILE}"; then > echo " *** ${COMPFILE} installed successfully" >@@ -200,6 +231,9 @@ > else > echo " *** Problem installing ${COMPFILE}, it will remain to merge by hand" > fi >+ if [ ${HANDLE_COMPFILE} == "a" -o ${HANDLE_COMPFILE} == "A" ]; then >+ DIFF_COMMENTS_PASS=yes >+ fi > ;; > [mM]) > case "${NO_INSTALLED}" in
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 192577
: 145658 |
196193