source: projects/vine-notify-update/data/vine-notify-update.lua @ 9642

Revision 9642, 652 bytes checked in by daisuke, 9 years ago (diff)

add initial version of vine-notify-update

Line 
1local count_upgrade = 0
2local require_reboot = 0
3
4file = io.open("/var/run/upgrade-list.txt","w")
5if not file then
6    print("error: can't open output file.")
7    return
8end
9
10markupgrade()
11
12for i, pkg in pairs(pkglist()) do 
13        if statupgrade(pkg) then
14                count_upgrade = count_upgrade + 1;
15                file:write(pkgname(pkg).."\n")
16        end
17end
18file:close()
19
20file = io.open("/var/run/reboot-required", "r")
21if file then
22        file:close()
23        require_reboot = 1
24end
25
26os.execute("/bin/dbus-send --system --dest=org.vinelinux.NotifyUpdate --type=method_call /org/vinelinux/NotifyUpdate org.vinelinux.NotifyUpdate.showMessage string:'"..count_upgrade.." "..require_reboot.."'")
Note: See TracBrowser for help on using the repository browser.