generalized mergemaster(8)

Michael Ranner mranner at inode.at
Mon Apr 7 12:08:55 PDT 2003


Am Sonntag, 6. April 2003 22:51 schrieb David O'Brien:
 On Sun, Mar 23, 2003 at 12:06:06PM +0100, Michael Ranner wrote:
> > Am Freitag, 21. M?rz 2003 20:27 schrieb Garance A Drosihn:
> > > >  /var/tmp/temproot/etc/rc.d/ and /etc/rc.d/ have 17 differing files.
> > > >  (I)nstall, (D)elete, or (R)ecursively examine? [R]
> > > >
> > > >Then I could hit 'I' and update all of /etc/rc.d at once.
> > >
> > > At times I've asked Doug about some kind of pattern-support in
> > > ~/.mergemasterrc, where the user could specify filename-patterns
> > > of files where they want the default action to be "install"
> > > instead of "leave for later".  There are pros and cons with that
> > > idea, but that's what I was thinking of for the directories you
> > > describe.
> > >
> > > Doug has suggested that people could maybe do things with the
> > > MM_PRE_COMPARE_SCRIPT, for special processing like this.
> >
> > I have a small patch for pattern-support in ~/.mergemasterrc and
> > already sent my ideas to Doug, but he said "It could/should
> > be done with MM_PRE_COMPARE_SCRIPT" to me.
>
> Could you post them??
>
> Dougb says that all the time, but has never created an example that will
> do what 90% of us want.  Every time the desire for this comes up, dougb
> says it is outside of the envisioned purpose of mergemaster.  Seems to me
> that if the tool isn't meeting the desires of 90% of your user base, maybe
> it could grow the functionality desired....

example mergemaster.rc:

AUTO_INSTALL_FILES="/etc/periodic/.*"

my patch:

*** mergemaster.orig	Wed Mar  5 16:35:54 2003
--- mergemaster	Thu Mar  6 15:47:38 2003
***************
*** 106,115 ****
  diff_loop () {
  
    HANDLE_COMPFILE=v
  
    while [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" -o \
      "${HANDLE_COMPFILE}" = "NOT V" ]; do
!     if [ -f "${DESTDIR}${COMPFILE#.}" -a -f "${COMPFILE}" ]; then
        if [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" ]; then
  	echo ''
  	echo '   
======================================================================   '
--- 106,133 ----
  diff_loop () {
  
    HANDLE_COMPFILE=v
+   AUTO_INSTALL_FILE=n
+ 
+   case "${AUTO_INSTALL}" in
+   [Yy][Ee][Ss])
+     set -f
+     for each in $AUTO_INSTALL_FILES
+     do
+       if expr "$COMPFILE" : ".$each\$" >/dev/null; then
+         AUTO_INSTALL_FILE=y
+         break
+       fi
+     done
+     set +f
+     ;;
+   *)
+     ;;
+   esac
  
    while [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" -o \
      "${HANDLE_COMPFILE}" = "NOT V" ]; do
!     if [ -f "${DESTDIR}${COMPFILE#.}" -a -f "${COMPFILE}" -a \
!       "$AUTO_INSTALL_FILE" = "n" ]; then
        if [ "${HANDLE_COMPFILE}" = "v" -o "${HANDLE_COMPFILE}" = "V" ]; then
  	echo ''
  	echo '   
======================================================================   '
***************
*** 124,130 ****
        fi
      else
        echo ''
!       echo "  *** There is no installed version of ${COMPFILE}"
        echo ''
        case "${AUTO_INSTALL}" in
        [Yy][Ee][Ss])
--- 142,152 ----
        fi
      else
        echo ''
!       if [ "$AUTO_INSTALL_FILE" = "y" ]; then
!         echo "  *** Automatic installation of ${COMPFILE}"
!       else
!         echo "  *** There is no installed version of ${COMPFILE}"
!       fi
        echo ''
        case "${AUTO_INSTALL}" in
        [Yy][Ee][Ss])


-- 
/\/\ichael Ranner

mranner at jawa.at - mranner at bitonline.cc - webmaster at mariazell.at
----------------------------------------------------------------------
JAWA Management Software GmbH - http://www.jawa.at/
  Liebenauer Hauptstrasse 2oo - A-8041 Graz
        Tel +43 316 403274 21 - Fax +43 316 403274 10
----------------------------------------------------------------------
             Mariazell Online - http://www.mariazell.at/
----------------------------------------------------------------------

-----BEGIN GEEK CODE BLOCK-----
GIT/CS/AT dx(-) s+:(++:) a- C++ UBLVS++++$ P++>+++$ L-(+)$ E---
W+++$ N+(++) o-- K- w--()$ O-(--) M@ V-(--) PS+>++ PE(-) Y+ PGP(-)
t+ 5+ X+++(++++) R* tv++ b+(++) DI++ D-(--) G- e h--(*) r++ y?
------END GEEK CODE BLOCK------



More information about the freebsd-hackers mailing list