# Last edited on 2003-10-23 21:03:01 by stolfi

UNIFORMIZING THE SOURCES

  The goal is to make the source files as uniform as possible.
  First place in the parent directory the authoritative version 
  of all files.  We will try to have as few .pov files as possible
  and these will contain only includes other files such as "fgstyle-N.inc"
  etc.
  
    dcc-logo-only.pov    - just the abacus (with some base)
    dcc-logo-ring.pov    - the abacus and the ring (with some base)
    dcc-logo-sltest.pov  - tests of slider shape
    dcc-logo-txtest.pov  - tests of textures

  Rename dcc-logo-{fancy,stark,white,luxury} to dcc-logo-only.pov
  
    find ./ -type f \
      \(  -name 'dcc-logo-fancy*' -o \
          -name 'dcc-logo-stark*' -o \
          -name 'dcc-logo-white*' -o \
          -name 'dcc-logo-luxury*' \
      \) -print > .fff
      
  Edited ".fff" manually into a set of "mv" commands that 
  renamed all those files to "dcc-logo-simple*".

  Now try to split all old ".pov" files in the dated directories 
  into one of these ".pov" files and an "extra.pov" file: 
    
    find ./ -type f \
      \( -name 'dcc-logo-simple.pov' -o -name 'dcc-logo-ring.pov' \) \
      -print \
      | sed -e 's/[.]pov$//' \
      > .oldpovs
      
  Checked and cleaned manually this list, then renamed all those
  files to "dcc-logo-{simple,ring}-OLD.pov".
  Then tried to modularize them, by splitting into 
  "dcc-logo-{simple,ring}-NEW.pov" and a bunch of files
  called "xxx-NEW.inc".
 
    /bin/rm -f .log
    foreach dn ( `cat .oldpovs` )
      echo '==============================' >> .log
      set dir = "${dn:h}"; set name = "${dn:t}"
      set old = "${dir}/${name}-OLD.pov"; 
      set new = "${dir}/${name}-NEW.pov"; 
      /bin/rm -f ${dir}/*-NEW.{pov,inc}
      echo ${dn} >>& .log; echo "${old} -> ${new}"
      cat ${old} \
        | split-pov-file \
            -v dir="${dir}" -v topName="${name}" \
        >>& .log
      wc ${old} >> .log
      echo ' ' >> .log
      wc ${dir}/*-NEW.{pov,inc} >> .log
    end

  Locate those directories that seem to use pose 0:
  
    foreach dn ( `cat .oldpovs` )
      echo '=============================='
      echo ${dn}
      set dir = "${dn:h}"; set name = "${dn:t}"
      /bin/rm -f ${dir}/.pose-diff
      if ( -r ${prefix}-dcc-pose-x.inc ) then
        /usr/bin/diff ${dir}/dcc-pose-x-NEW.inc dcc-pose-0.inc \
          | /bin/sed \
              -e '/^[<>] *[\/][\/]/d' \
              -e '/^--- *$/d' \
              -e '/^[0-9][0-9]*[a-z][0-9][0-9]*[,][0-9][0-9]* *$/d' \
          > ${dir}/.pose-diff
        /bin/ls -ld ${dir}/.pose-diff
        if ( -z ${dir}/.pose-diff ) echo ${dn} >> .pose-0
      else
        echo ${dn} >> .pose-0
      endif
    end

    foreach dir ( `cat .pose-0 | sed -e 's:/.*::'` )
      echo ${dir}
      egrep -e '^ *object *{ *abacus([ {}]|$)' ${dir}/*-NEW.{inc,pov}
    end
    
    sed-files -f sed/sh.sed `cat .pose-0 | sed -e 's:$:-OLD.pov:'`

GIVING UP 

  This was getting out of hand, so I decided to start from (almost)
  scratch in the directory "posters/ic-logo-new".
