~ubuntu-branches/ubuntu/trusty/libxfont/trusty-proposed

« back to all changes in this revision

Viewing changes to debian/xsfbs/xsfbs.sh

  • Committer: Bazaar Package Importer
  • Author(s): Stefan Potyra
  • Date: 2009-05-09 12:11:53 UTC
  • mfrom: (1.1.10 upstream) (10.1.2 squeeze)
  • Revision ID: james.westby@ubuntu.com-20090509121153-nwte290k1e9gew62
Tags: 1:1.4.0-1ubuntu1
* Rebase to unstable, remaining change:
  + debian/rules: unset LDFLAGS to not be hit by -Bsymbolic-functions,
    as libxfont contains weak symbols which are meant to be overriden
    (cf. LP #226156).

Show diffs side-by-side

added added

removed removed

Lines of Context:
719
719
  fi
720
720
}
721
721
 
722
 
register_x_lib_dir_with_ld_so () {
723
 
  # syntax: register_x_lib_dir_with_ld_so
724
 
  #
725
 
  # Configure the dynamic loader ld.so to search /usr/X11R6/lib for shared
726
 
  # libraries.
727
 
  #
728
 
  # Call this function from the postinst script of a package that places a
729
 
  # shared library in /usr/X11R6/lib, before invoking ldconfig.
730
 
 
731
 
  local dir ldsoconf
732
 
 
733
 
  dir="/usr/X11R6/lib"
734
 
  ldsoconf="/etc/ld.so.conf"
735
 
 
736
 
  # is the line not already present?
737
 
  if ! fgrep -qsx "$dir" "$ldsoconf"; then
738
 
    observe "adding $dir directory to $ldsoconf"
739
 
    echo "$dir" >> "$ldsoconf"
740
 
  fi
741
 
}
742
 
 
743
 
deregister_x_lib_dir_with_ld_so () {
744
 
  # syntax: deregister_x_lib_dir_with_ld_so
745
 
  #
746
 
  # Configure dynamic loader ld.so to not search /usr/X11R6/lib for shared
747
 
  # libraries, if and only if no shared libaries remain there.
748
 
  #
749
 
  # Call this function from the postrm script of a package that places a shared
750
 
  # library in /usr/X11R6/lib, in the event "$1" is "remove", and before
751
 
  # invoking ldconfig.
752
 
 
753
 
  local dir ldsoconf fgrep_status cmp_status
754
 
 
755
 
  dir="/usr/X11R6/lib"
756
 
  ldsoconf="/etc/ld.so.conf"
757
 
 
758
 
  # is the line present?
759
 
  if fgrep -qsx "$dir" "$ldsoconf"; then
760
 
    # are there any shared objects in the directory?
761
 
    if [ "$(echo "$dir"/lib*.so.*.*)" = "$dir/lib*.so.*.*" ]; then
762
 
      # glob expansion produced nothing, so no shared libraries are present
763
 
      observe "removing $dir directory from $ldsoconf"
764
 
      # rewrite the file (very carefully)
765
 
      set +e
766
 
      fgrep -svx "$dir" "$ldsoconf" > "$ldsoconf.dpkg-tmp"
767
 
      fgrep_status=$?
768
 
      set -e
769
 
      case $fgrep_status in
770
 
        0|1) ;; # we don't actually care if any lines matched or not
771
 
        *) die "error reading \"$ldsoconf\"; fgrep exited with status" \
772
 
          "$fgrep_status" ;;
773
 
      esac
774
 
      set +e
775
 
      cmp -s "$ldsoconf.dpkg-tmp" "$ldsoconf"
776
 
      cmp_status=$?
777
 
      set -e
778
 
      case $cmp_status in
779
 
        0) rm "$ldsoconf.dpkg-tmp" ;; # files are identical
780
 
        1) mv "$ldsoconf.dpkg-tmp" "$ldsoconf" ;; # files differ
781
 
        *) die "error comparing \"$ldsoconf.dpkg-tmp\" to \"$ldsoconf\";" \
782
 
          "cmp exited with status $cmp_status" ;;
783
 
      esac
784
 
    fi
785
 
  fi
786
 
}
787
 
 
788
722
make_symlink_sane () {
789
723
  # syntax: make_symlink_sane symlink target
790
724
  #