- add preserve-conf script to contrib
[apt.git] / contrib / preserve-conf / preserve-conf.lua
1 if confget("RPM::Preserve-Config/b", "false") == "true" then
2         num = 0
3         pkgs = pkglist()
4         for i, pkg in ipairs(pkgs) do
5                 if statinstall(pkg) then
6                         inp = io.popen("LANG=C /bin/rpm -V --nodeps --nodigest --noscripts --nosignature "..pkgname(pkg).." 2> /dev/null")
7                         for line in inp.lines(inp) do
8                                 if string.byte(line, 10) == string.byte("c") then
9                                         num = num + 1
10                                         markkeep(pkg)
11                                 end
12                         end
13                         io.close(inp)
14                 end
15         end
16         if num > 0 then
17                 print("\nHolding back "..num.." packages because of changed configuration")
18         end
19 end
20 -- vim:ts=4