update module with a twist

I just did an upgrade from the calendar and date module of which calendar needed to move from 6.x-2.x-dev to 6.x-2.4 version which seemed a pitb exercise. I hope I missed some skills :-p

The following command was not working

drush upc calendar-6.x-2.4

So what I did was download the latest version offsite. Then diff the module trees.

cd /tmp
drush dl calendar-6.x-2.4
cd /my-site/sites/all/modules/calendar
cp -r /tmp/calendar/* ./

then compare the latest version with the svn version ... I still think I'm missing something. Anyway we need to remove old files.

diff --recursive --brief . /tmp/calendar/ | grep -v .svn
  557  svn rm ./calendar_ical/translations/calendar_ical.sv.po 
  558  svn rm ./jcalendar/translations/jcalendar.sv.po
  559  diff --recursive --brief . /tmp/calendar/ | grep -v .svn
  560  svn rm ./translations/calendar.sv.po
  561  diff --recursive --brief . /tmp/calendar/ | grep -v .svn
  562  svn st
  563  svn add *
  564  svn add */*
  565  svn st
  566  svn add */*/*
  567  svn add */*/*/*
  568  svn st

I guess now the above could be shortened with some recursive switch for svn.

Now the calendar dir contains too many items which we need to remove. As the correct version is also in the temp dir we can run

drush upc date
  572  drush upc cck
  573  drush cc all
  574  drush cc all
  575  svn st
  576  cd sites/all/modules/contrib/
  577  svn st
  578  cd date/
  579  svn st
  580  svn st | grep "\!"
  581  svn st | grep "\!" | cut -c 2-
  582  svn st | grep "\!" | cut -c 2- | xargs echo {}
  583  svn st | grep "\!" | cut -c 2- | xargs echo 
  584  svn st | grep "\!" | cut -c 2- | xargs svn rm 
  585  history


svn st | grep "\!" | cut -c 2- | xargs svn rm