tmpnew = "/tmp/newpkg.log" tmpold = "/tmp/oldpkg.log" print("Changelog summaries:\n") for i, pkg in ipairs(files_install) do print("Changes in "..pkgname(pkgs_install[i])..":") os.execute("rpm -qp --changelog "..pkg.." > "..tmpnew) os.execute("rpm -q --changelog "..pkgname(pkgs_install[i]).." > "..tmpold) changes = io.popen("diff -u "..tmpold.." "..tmpnew) c = 0 for line in changes:lines() do -- strip out cruft from diff -u output if c > 2 and string.find(line, "+") then print(string.sub(line, 2)) end c = c + 1 end os.remove(tmpold) os.remove(tmpnew) print("----------") end