Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions etc/sudoers.d/mintupdate
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Allow any user to check for new system updates without
# requiring user authentication.

Cmnd_Alias UPDATE = /usr/lib/linuxmint/mintUpdate/checkAPT.py

ALL ALL = NOPASSWD:UPDATE
7 changes: 3 additions & 4 deletions usr/lib/linuxmint/mintUpdate/checkAPT.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
# return changes

try:
cache = None
cache = apt.Cache()

if os.getuid() == 0 :
use_synaptic = False
Expand All @@ -44,7 +44,6 @@
returnCode = comnd.wait()
#sts = os.waitpid(comnd.pid, 0)
else:
cache = apt.Cache()
cache.update()

sys.path.append('/usr/lib/linuxmint/common')
Expand All @@ -58,8 +57,8 @@
except:
dist_upgrade = True

if cache is None:
cache = apt.Cache()
# Reopen the cache to reflect any updates
cache.open(None)
cache.upgrade(dist_upgrade)
changes = cache.get_changes()

Expand Down
4 changes: 2 additions & 2 deletions usr/lib/linuxmint/mintUpdate/mintUpdate.py
Original file line number Diff line number Diff line change
Expand Up @@ -463,9 +463,9 @@ def run(self):
wTree.get_widget("vpaned1").set_position(vpaned_position)
gtk.gdk.threads_leave()
if app_hidden:
updates = commands.getoutput("/usr/lib/linuxmint/mintUpdate/checkAPT.py | grep \"###\"")
updates = commands.getoutput("sudo /usr/lib/linuxmint/mintUpdate/checkAPT.py | grep \"###\"")
else:
updates = commands.getoutput("/usr/lib/linuxmint/mintUpdate/checkAPT.py --use-synaptic %s | grep \"###\"" % self.wTree.get_widget("window1").window.xid)
updates = commands.getoutput("sudo /usr/lib/linuxmint/mintUpdate/checkAPT.py --use-synaptic %s | grep \"###\"" % self.wTree.get_widget("window1").window.xid)

# Look for mintupdate
if ("UPDATE###mintupdate###" in updates):
Expand Down