~ubuntu-branches/ubuntu/breezy/koffice/breezy

« back to all changes in this revision

Viewing changes to tools/scripts/check_koffice_install.sh

  • Committer: Bazaar Package Importer
  • Author(s): Ben Burton
  • Date: 2004-05-09 11:33:00 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040509113300-vfrdadqsvjfuhn3b
Tags: 1:1.3.1-1
* New upstream bugfix release.
* Built against newer imagemagick (closes: #246623).
* Made koffice-libs/kformula recommend/depend on latex-xft-fonts, which
  provides mathematical fonts that the formula editor can use.  Also
  patched the kformula part to make these fonts the default.
* Changed kword menu hint from "WordProcessors" to "Word processors"
  (closes: #246209).
* Spellchecker configuration is now fixed (closes: #221256, #227568).

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
if ! kde-config ; then
 
3
  echo 'kde-config not found ! Aborting. You need a more recent KDE, or to fix your $PATH.'
 
4
  exit 1
 
5
fi
 
6
 
 
7
instance=kword
 
8
applnks=`kde-config --path apps`:`kde-config --path xdgdata-apps`
 
9
found=0
 
10
 
 
11
function checkname()
 
12
{
 
13
  f=`echo $1 | sed -e 's,//,/,g'`
 
14
  if [ -f $f ]; then
 
15
    echo -n "Found: $f... "
 
16
    mimetypes=`grep ^MimeType $f|sed -e 's/.*=//;s/;/,/g;'`
 
17
    servicetypes=`grep ^ServiceTypes $f|sed -e 's/.*=//;s/$/,/g'`
 
18
    fulllist="$mimetypes,$servicetypes"
 
19
    if echo $fulllist | grep -q "KOfficePart,"; then
 
20
      echo "ok, this is a KOfficePart"
 
21
    else
 
22
      echo '**** KOfficePart not in list of types !'
 
23
      echo Service Types: $fulllist
 
24
      cat $f
 
25
      exit 1
 
26
    fi
 
27
    nativemime=`grep X-KDE-NativeMimeType $f`
 
28
    echo Native mimetype : $nativemime
 
29
    if echo $nativemime | grep -q "application/x-$instance"; then
 
30
      found=1
 
31
    fi
 
32
  fi
 
33
}
 
34
 
 
35
IFS=:
 
36
for dir in $applnks; do
 
37
  if test -n "$dir"; then
 
38
    echo Looking under applnk dir: $dir
 
39
    f="$dir/Office/$instance.desktop"
 
40
    checkname $f
 
41
  fi
 
42
done
 
43
 
 
44
if [ $found = 0 ]; then
 
45
  echo
 
46
  echo Now looking by filename
 
47
  echo
 
48
 
 
49
  for dir in $applnks; do
 
50
    if test -n "$dir"; then
 
51
      echo Looking under applnk dir: $dir
 
52
      for f in `find $dir -name $instance.desktop`; do
 
53
        checkname $f
 
54
      done
 
55
    fi
 
56
  done
 
57
fi
 
58
 
 
59
if [ $found = 0 ]; then
 
60
  echo "***** No $instance.desktop with X-KDE-NativeMimetype in it was found! Installation problem."
 
61
  echo $applnks
 
62
fi
 
63
 
 
64
echo
 
65
 
 
66
stfound=0
 
67
for dir in `kde-config --path servicetypes`; do
 
68
  echo Service Types dir $dir
 
69
  f=`echo $dir/kofficepart.desktop | sed -e 's,//,/,g'`
 
70
  if [ -f $f ]; then
 
71
    echo Found $f
 
72
    grep Native $f
 
73
    stfound=1
 
74
  fi
 
75
done
 
76
 
 
77
if [ $stfound = 0 ]; then
 
78
  echo '****** kofficepart.desktop not found!'
 
79
  kde-config --path servicetypes
 
80
else
 
81
  echo
 
82
  if [ $found = 1 ]; then
 
83
    echo "Everything looks ok"
 
84
  fi
 
85
fi
 
86