home *** CD-ROM | disk | FTP | other *** search
- #!/bin/bash -e
-
- merge_two_directories () {
- link_name="$1"
- link_target="$2"
- if ! test -L "$link_name" && test -d "$link_name" && \
- ! test -L "$link_target" && test -d "$link_target" ; then
- for f in `
- find "$link_name"/. ! -type d -printf '%P\n' | grep -xFf <( \
- find "$link_target"/. ! -type d -printf '%P\n' \
- )`; do
- name_inode=` stat --format=%i "$link_name/$f"`
- target_inode=`stat --format=%i "$link_target/$f"`
- if test x$name_inode != x$target_inode; then
- echo >&2 "warning: cannot unify $link_name and $link_target\
- - overlapping contents (eg, .../$f)"
- return
- fi
- done
- cp --remove-destination -al "$link_name"/. "$link_target"/.
- rm -rf "$link_name"
- ln -sf "$link_target" "$link_name"
- fi
- }
-
- #merge_two_directories /usr/lib/mozilla-firefox /usr/lib/firefox
-
- upgrade_conffile() {
- new_file="$1"
- old_file="$2"
- old_md5sum="$3"
-
- if [ -f "$old_file" ]; then
- md5sum="`md5sum \"$old_file\" | sed -e \"s/ .*//\"`"
-
- if [ $md5sum != $old_md5sum ]; then
- if [ ! -d `dirname $new_file` ]; then
- mkdir -p `dirname $new_file` > /dev/null 2>&1 || true
- fi
-
- cp -fa "$old_file" "$new_file"
- fi
- fi
- }
-
- # Upgrade conffiles for mozilla-firefox -> firefox transition
- if [ "$1" = 'install' ]; then
- if [ ! -d /etc/firefox ]; then
- upgrade_conffile /etc/firefox/firefoxrc \
- /etc/mozilla-firefox/mozilla-firefoxrc \
- 'fa562ca63014f5e9dd470a37766376d6'
- upgrade_conffile /etc/firefox/pref/firefox.js \
- /etc/mozilla-firefox/pref/firefox.js \
- '9b21e21aa3f8a0ab8f134ba04b8846ff'
- upgrade_conffile /etc/firefox/profile/bookmarks.html \
- /etc/mozilla-firefox/profile/bookmarks.html \
- '44e419e6fc9b2a2a954b73708d5223cc'
- upgrade_conffile /etc/firefox/profile/localstore.rdf \
- /etc/mozilla-firefox/profile/localstore.rdf \
- 'ea03cc19c2a3f622fa557cd8ea9da6eb'
- upgrade_conffile /etc/firefox/profile/search.rdf \
- /etc/mozilla-firefox/profile/search.rdf \
- '26d13f5d96ad118b5de5d234f9d052fa'
- upgrade_conffile /etc/firefox/profile/mimeTypes.rdf \
- /etc/mozilla-firefox/profile/mimeTypes.rdf \
- '69cdcb7e0209f2e9d29000ee1c0ee2f0'
- upgrade_conffile /etc/firefox/profile/chrome/userChrome-example.css \
- /etc/mozilla-firefox/profile/chrome/userChrome-example.css \
- '4788fdaa51b0a238cb21f5c2877ef06d'
- upgrade_conffile /etc/firefox/profile/chrome/userContent-example.css \
- /etc/mozilla-firefox/profile/chrome/userContent-example.css \
- 'd3765c7d2de5626529195007f4b7144a'
- fi
- fi
-
- # Remove some directories that are now symlinks
-
- for dir in /usr/lib/firefox/icons /usr/lib/firefox/searchplugins \
- /usr/lib/firefox/res /usr/lib/firefox/chrome /usr/lib/firefox/defaults \
- /usr/lib/firefox/greprefs ; do
- if [ -d "$dir" ]; then
- rm -rf "$dir"
- fi
- done
-
-
-