FreeBSD Bugzilla – Attachment 210786 Details for
Bug 242212
usr.sbin/mergemaster/mergemaster.sh: There is no logic to handle symbolic links
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch file
usr.sbin_mergemaster.patch (text/plain), 3.67 KB, created by
Yasuhiro Kimura
on 2020-01-16 07:55:21 UTC
(
hide
)
Description:
Patch file
Filename:
MIME Type:
Creator:
Yasuhiro Kimura
Created:
2020-01-16 07:55:21 UTC
Size:
3.67 KB
patch
obsolete
>Index: usr.sbin/mergemaster/mergemaster.sh >=================================================================== >--- usr.sbin/mergemaster/mergemaster.sh (revision 356613) >+++ usr.sbin/mergemaster/mergemaster.sh (working copy) >@@ -1093,6 +1093,7 @@ > fi > done > >+# Compare regular files > for COMPFILE in `find . -type f | sort`; do > > # First, check to see if the file exists in DESTDIR. If not, the >@@ -1182,6 +1183,116 @@ > fi # Yes, the file still remains to be checked > done # This is for the for way up there at the beginning of the comparison > >+ask_answer_for_symbolic_link () { >+ HANDLE_COMPSYMLINK='' >+ while true; do >+ echo " Use 'd' to delete the temporary ${COMPSYMLINK}" >+ echo " Use 'i' to install the temporary ${COMPSYMLINK}" >+ echo '' >+ echo " Default is to leave the temporary symbolic link to deal with by hand" >+ echo '' >+ echo -n "How should I deal with this? [Leave it for later] " >+ read HANDLE_COMPSYMLINK >+ case ${HANDLE_COMPSYMLINK} in >+ ''|[dDiI]) >+ break >+ ;; >+ *) >+ echo "invalid choice: ${HANDLE_COMPSYMLINK}" >+ echo '' >+ HANDLE_COMPSYMLINK='' >+ ;; >+ esac >+ done >+} >+ >+install_symbolic_link () { >+ rm -f ${DESTDIR}${COMPSYMLINK#.} > /dev/null 2>&1 >+ if [ -L ${DESTDIR}${COMPSYMLINK#.} ]; then >+ return 1 >+ fi >+ cp -a ${COMPSYMLINK} ${DESTDIR}${COMPSYMLINK#.} > /dev/null 2>&1 >+ if [ ! -L ${DESTDIR}${COMPSYMLINK#.} ]; then >+ return 1 >+ fi >+ return 0 >+} >+ >+handle_symbolic_link () { >+ case ${HANDLE_COMPSYMLINK} in >+ [dD]) >+ rm ${COMPSYMLINK} >+ echo '' >+ echo " *** Deleting ${COMPSYMLINK}" >+ return 1 >+ ;; >+ [iI]) >+ if install_symbolic_link; then >+ echo " *** ${COMPSYMLINK} installed successfully" >+ echo '' >+ return 2 >+ else >+ echo " *** Problem installing ${COMPSYMLINK}, it will remain to merge by hand" >+ echo '' >+ return 3 >+ fi >+ ;; >+ '') >+ echo '' >+ echo " *** ${COMPFILE} will remain for your consideration" >+ return 0 >+ ;; >+ esac >+} >+ >+# Compare symblic links >+for COMPSYMLINK in `find . -type l | sort`; do >+ if [ ! -L "${DESTDIR}${COMPSYMLINK#.}" ]; then >+ if [ -n "${AUTO_RUN}" -a -z "${AUTO_INSTALL}" ]; then >+ echo " *** ${COMPSYMLINK} will remain for your consideration" >+ continue >+ else >+ echo '' >+ echo " *** There is no installed version of ${COMPSYMLINK}" >+ echo '' >+ if [ -n "${AUTO_INSTALL}" ]; then >+ HANDLE_COMPSYMLINK="i" >+ else >+ ask_answer_for_symbolic_link >+ fi >+ handle_symbolic_link >+ if [ -n "${AUTO_INSTALL}" -a $? -eq 2 ]; then >+ AUTO_INSTALLED_FILES="${AUTO_INSTALLED_FILES} ${DESTDIR}${COMPSYMLINK#.} >+" >+ fi >+ fi >+ elif [ $(readlink ${COMPSYMLINK}) = $(readlink ${DESTDIR}${COMPSYMLINK#.}) ]; then >+ echo " *** Temp ${COMPSYMLINK} and installed are the same, deleting" >+ rm ${COMPSYMLINK} >+ else >+ if [ -n "${AUTO_RUN}" -a -z "${AUTO_UPGRADE}" ]; then >+ echo " *** ${COMPSYMLINK} will remain for your consideration" >+ continue >+ else >+ echo '' >+ echo " *** Target of temp ${COMPSYMLINK} is differnt from that of installed" >+ echo " Temp:$(readlink ${COMPSYMLINK})" >+ echo " Installed: $(readlink ${DESTDIR}${COMPSYMLINK#.})" >+ echo '' >+ if [ -n "${AUTO_UPGRADE}" ]; then >+ HANDLE_COMPSYMLINK="i" >+ else >+ ask_answer_for_symbolic_link >+ fi >+ handle_symbolic_link >+ if [ -n "${AUTO_UPGRADE}" -a $? -eq 2 ]; then >+ AUTO_UPGRADED_FILES="${AUTO_UPGRADED_FILES} ${DESTDIR}${COMPSYMLINK#.} >+" >+ fi >+ fi >+ fi >+done >+ > echo '' > echo "*** Comparison complete" >
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 242212
:
210786
|
210946