~ubuntu-branches/ubuntu/saucy/apt-xapian-index/saucy

« back to all changes in this revision

Viewing changes to debian/cron.weekly

  • Committer: Bazaar Package Importer
  • Author(s): Enrico Zini
  • Date: 2010-05-16 09:33:58 UTC
  • mfrom: (4.1.5 squeeze)
  • mto: This revision was merged to the branch mainline in revision 12.
  • Revision ID: james.westby@ubuntu.com-20100516093358-xvbshas89apqnvgj
Tags: 0.35
* Tolerate (and if --verbose, report) .desktop file with invalid popcon
  fields
* Added missing import. Closes: #581736
* Run update-python-modules -p before updating the index in postinst.
  Closes: #581811

Show diffs side-by-side

added added

removed removed

Lines of Context:
3
3
CMD=/usr/sbin/update-apt-xapian-index
4
4
IONICE=/usr/bin/ionice
5
5
 
 
6
# Check if we're on battery
 
7
if which on_ac_power >/dev/null 2>&1; then
 
8
    on_ac_power >/dev/null 2>&1
 
9
    ON_BATTERY=$?
 
10
 
 
11
    # Here we use "-eq 1" instead of "-ne 0" because
 
12
    # on_ac_power could also return 255, which means
 
13
    # it can't tell whether we are on AC or not. In
 
14
    # that case, run update-a-x-i nevertheless.
 
15
    [ "$ON_BATTERY" -eq 1 ] && exit 0
 
16
fi
 
17
 
6
18
# Rebuild the index
7
19
if [ -x $CMD ]
8
20
then
9
21
        if [ -x $IONICE ]
10
22
        then
11
 
                nice $IONICE -c3 $CMD --quiet
 
23
                nice -n 19 $IONICE -c 3 $CMD --update --quiet
12
24
        else
13
 
                nice $CMD --quiet
 
25
                nice -n 19 $CMD --update --quiet
14
26
        fi
15
27
fi