lib/rubber/recipes/rubber/setup.rb
def apt_get_update_script
    <<-ENDSCRIPT
      if [[ ! -f /tmp/apt_sources.md5 ]]; then
        apt-get -q update

        md5sum /etc/apt/sources.list > /tmp/apt_sources.md5
        md5sum /etc/apt/sources.list.d/*.list >> /tmp/apt_sources.md5
      else
        md5sum /etc/apt/sources.list > /tmp/apt_sources_compare.md5
        md5sum /etc/apt/sources.list.d/*.list >> /tmp/apt_sources_compare.md5

        if [[ `diff /tmp/apt_sources.md5 /tmp/apt_sources_compare.md5` ]]; then
          apt-get -q update
        fi

        mv /tmp/apt_sources_compare.md5 /tmp/apt_sources.md5
      fi
    ENDSCRIPT
  end
# Helper script that only issues an apt-get update command if the apt sources list has changed.
Helper script that only issues an apt-get update command if the apt sources list has changed.
Helper script that only issues an apt - get update command if the apt sources list has changed .
def apt_get_update_script
    <<-ENDSCRIPT
      if [[ ! -f /tmp/apt_sources.md5 ]]; then
        apt-get -q update
        md5sum /etc/apt/sources.list > /tmp/apt_sources.md5
        md5sum /etc/apt/sources.list.d/*.list >> /tmp/apt_sources.md5
      else
        md5sum /etc/apt/sources.list > /tmp/apt_sources_compare.md5
        md5sum /etc/apt/sources.list.d/*.list >> /tmp/apt_sources_compare.md5
        if [[ `diff /tmp/apt_sources.md5 /tmp/apt_sources_compare.md5` ]]; then
          apt-get -q update
        fi
        mv /tmp/apt_sources_compare.md5 /tmp/apt_sources.md5
      fi
    ENDSCRIPT
  end
def apt_get_update_script <<-ENDSCRIPT 
      if [[ ! -f /tmp/apt_sources.md5 ]]; then
        apt-get -q update

        md5sum /etc/apt/sources.list > /tmp/apt_sources.md5
        md5sum /etc/apt/sources.list.d/*.list >> /tmp/apt_sources.md5
      else
        md5sum /etc/apt/sources.list > /tmp/apt_sources_compare.md5
        md5sum /etc/apt/sources.list.d/*.list >> /tmp/apt_sources_compare.md5

        if [[ `diff /tmp/apt_sources.md5 /tmp/apt_sources_compare.md5` ]]; then
          apt-get -q update
        fi

        mv /tmp/apt_sources_compare.md5 /tmp/apt_sources.md5
      fi
     ENDSCRIPT end
Helper script that only issues an apt-get update command if the apt sources list has changed.
Helper script that only issues an apt - get update command if the apt sources list has changed .