Revision 9642,
652 bytes
checked in by daisuke, 9 years ago
(diff) |
add initial version of vine-notify-update
|
Rev | Line | |
---|
[9642] | 1 | local count_upgrade = 0 |
---|
| 2 | local require_reboot = 0 |
---|
| 3 | |
---|
| 4 | file = io.open("/var/run/upgrade-list.txt","w") |
---|
| 5 | if not file then |
---|
| 6 | print("error: can't open output file.") |
---|
| 7 | return |
---|
| 8 | end |
---|
| 9 | |
---|
| 10 | markupgrade() |
---|
| 11 | |
---|
| 12 | for 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 |
---|
| 17 | end |
---|
| 18 | file:close() |
---|
| 19 | |
---|
| 20 | file = io.open("/var/run/reboot-required", "r") |
---|
| 21 | if file then |
---|
| 22 | file:close() |
---|
| 23 | require_reboot = 1 |
---|
| 24 | end |
---|
| 25 | |
---|
| 26 | os.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.