diff options
author | onefang | 2019-12-04 23:56:17 +1000 |
---|---|---|
committer | onefang | 2019-12-04 23:56:17 +1000 |
commit | bd53e5cdfee93f22e8a0c2e7410985ab61ab37b0 (patch) | |
tree | f6e70106e43cad08855479f2b5e7c0537083d7a9 | |
parent | Not being able to remove a non existing file isn't a failure. (diff) | |
download | apt-panopticon-bd53e5cdfee93f22e8a0c2e7410985ab61ab37b0.zip apt-panopticon-bd53e5cdfee93f22e8a0c2e7410985ab61ab37b0.tar.gz apt-panopticon-bd53e5cdfee93f22e8a0c2e7410985ab61ab37b0.tar.bz2 apt-panopticon-bd53e5cdfee93f22e8a0c2e7410985ab61ab37b0.tar.xz |
Check for existance of Release file before trying to sort it.
Diffstat (limited to '')
-rwxr-xr-x | apt-panopticon.lua | 28 |
1 files changed, 15 insertions, 13 deletions
diff --git a/apt-panopticon.lua b/apt-panopticon.lua index 92a5125..430aa87 100755 --- a/apt-panopticon.lua +++ b/apt-panopticon.lua | |||
@@ -971,22 +971,24 @@ if 0 < #arg then | |||
971 | end | 971 | end |
972 | end | 972 | end |
973 | 973 | ||
974 | os.execute('sort -k 3 results/' .. pu.host .. '/merged/dists/' .. n .. '/Release >results/' .. pu.host .. '/merged/dists/' .. n .. '/Release.SORTED') | 974 | if checkFile('results/' .. pu.host .. '/merged/dists/' .. n .. '/Release') then |
975 | if options.referenceSite.value == pu.host then | 975 | os.execute('sort -k 3 results/' .. pu.host .. '/merged/dists/' .. n .. '/Release >results/' .. pu.host .. '/merged/dists/' .. n .. '/Release.SORTED') |
976 | os.execute('diff -U 0 results_old/pkgmaster.devuan.org/merged/dists/' .. n .. '/Release.SORTED ' .. | 976 | if options.referenceSite.value == pu.host then |
977 | 'results/pkgmaster.devuan.org/merged/dists/' .. n .. '/Release.SORTED ' .. | 977 | os.execute('diff -U 0 results_old/pkgmaster.devuan.org/merged/dists/' .. n .. '/Release.SORTED ' .. |
978 | '| grep -v "@@" | grep "^+" | grep "Packages.xz$" | cut -c 77- >results/NEW_Release_' .. n .. '.txt') | 978 | 'results/pkgmaster.devuan.org/merged/dists/' .. n .. '/Release.SORTED ' .. |
979 | os.execute('rm results/' .. pu.host .. '/merged/dists/' .. n .. '/Release') | 979 | '| grep -v "@@" | grep "^+" | grep "Packages.xz$" | cut -c 77- >results/NEW_Release_' .. n .. '.txt') |
980 | os.execute('rm -f results/' .. pu.host .. '/merged/dists/' .. n .. '/Release 2>/dev/null') | ||
980 | -- TODO - Maybe check the date in Release, though since they are updated daily, is there any point? Perhaps it's for checking amprolla got run? | 981 | -- TODO - Maybe check the date in Release, though since they are updated daily, is there any point? Perhaps it's for checking amprolla got run? |
981 | else | 982 | else |
982 | -- TODO - compare to the pkgmaster copy. | 983 | -- TODO - compare to the pkgmaster copy. |
983 | end | 984 | end |
984 | 985 | ||
985 | local dfile, e = io.open('results/NEW_Release_' .. n .. '.txt', "r") | 986 | local dfile, e = io.open('results/NEW_Release_' .. n .. '.txt', "r") |
986 | if nil == dfile then W("opening results/NEW_Release_" .. n .. " file - " .. e) else | 987 | if nil == dfile then W("opening results/NEW_Release_" .. n .. " file - " .. e) else |
987 | local diff = dfile:read("*a") | 988 | local diff = dfile:read("*a") |
988 | if "" ~= diff then | 989 | if "" ~= diff then |
989 | downloads(pu.host, pu.path, n, diff) | 990 | downloads(pu.host, pu.path, n, diff) |
991 | end | ||
990 | end | 992 | end |
991 | end | 993 | end |
992 | 994 | ||