~alexzak/software-properties/fixes

« back to all changes in this revision

Viewing changes to softwareproperties/SoftwareProperties.py

  • Committer: Michael Vogt
  • Date: 2009-07-14 08:40:29 UTC
  • Revision ID: michael.vogt@ubuntu.com-20090714084029-d9602ixccqgf1hbi
* softwareproperties/SoftwareProperties.py:
  - check/ensure apt daily cron job is executable (LP: #390319)

Show diffs side-by-side

added added

removed removed

Lines of Context:
33
33
import threading
34
34
import atexit
35
35
import tempfile
 
36
import string
 
37
import stat
 
38
 
36
39
from tempfile import NamedTemporaryFile
37
 
import string
38
40
from xml.sax.saxutils import escape
39
41
from ConfigParser import ConfigParser
40
42
from gettext import gettext as _
548
550
      print "No config found, creating one"
549
551
      open(conffiles[0], "w")
550
552
 
 
553
    # ensure /etc/cron.daily/apt is executable
 
554
    ac = "/etc/cron.daily/apt"
 
555
    if os.path.exists(ac):
 
556
      perm = os.stat(ac)[stat.ST_MODE]
 
557
      if not (perm & stat.S_IXUSR):
 
558
        print "file '%s' not executable, fixing" % ac
 
559
        os.chmod(ac, 0755)
 
560
 
551
561
    # now update them
552
562
    for periodic in conffiles:
553
563
      # read the old content first