mirror of
https://github.com/lilydjwg/nvchecker.git
synced 2025-03-10 06:14:02 +00:00
remove old scripts
This commit is contained in:
parent
926e75c075
commit
e080e32c89
2 changed files with 0 additions and 73 deletions
|
@ -1,31 +0,0 @@
|
||||||
#!/bin/bash -e
|
|
||||||
# MIT licensed
|
|
||||||
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
|
|
||||||
|
|
||||||
if [[ $# -ne 2 || ! -r $1 || -z $2 ]]; then
|
|
||||||
echo >&2 "usage: arch_repopkg_unmonitored config.ini pkg_list or repository_name"
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
tmp_configured=$(mktemp)
|
|
||||||
tmp_list=$(mktemp)
|
|
||||||
|
|
||||||
trap 'rm -f "$tmp_configured" "$tmp_list"' INT QUIT TERM EXIT
|
|
||||||
|
|
||||||
config=$1
|
|
||||||
if [[ -r $2 ]]; then
|
|
||||||
sort "$2" > "$tmp_list"
|
|
||||||
else
|
|
||||||
pacman -Sl "$2" | cut -d' ' -f2 | sort > "$tmp_list"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Also take commented-out items into account
|
|
||||||
grep -oP '^(?:[;#]\s*)?\[.*(?=]$)' "$config" | sed 's/^\([;#]\s*\)\?\[//;/^__/d' | sort > "$tmp_configured"
|
|
||||||
|
|
||||||
echo ">>> Un-monitored list:"
|
|
||||||
comm -23 "$tmp_list" "$tmp_configured"
|
|
||||||
echo
|
|
||||||
|
|
||||||
echo ">>> Monitored but not in list:"
|
|
||||||
comm -13 "$tmp_list" "$tmp_configured"
|
|
||||||
echo
|
|
|
@ -1,42 +0,0 @@
|
||||||
#!/usr/bin/env python3
|
|
||||||
# MIT licensed
|
|
||||||
# Copyright (c) 2013-2017 lilydjwg <lilydjwg@gmail.com>, et al.
|
|
||||||
|
|
||||||
import sys
|
|
||||||
import re
|
|
||||||
|
|
||||||
sections = re.compile(r'[-=]{3,}')
|
|
||||||
levels = {
|
|
||||||
'=': 1,
|
|
||||||
'-': 2,
|
|
||||||
}
|
|
||||||
|
|
||||||
def to_id(t):
|
|
||||||
return re.sub(r'[`(),]', '', t).lower().replace(' ', '-')
|
|
||||||
|
|
||||||
def to_text(t):
|
|
||||||
return t.replace('`', '')
|
|
||||||
|
|
||||||
def main(f):
|
|
||||||
L = []
|
|
||||||
last = None
|
|
||||||
for l in f:
|
|
||||||
l = l[:-1]
|
|
||||||
if sections.fullmatch(l):
|
|
||||||
L.append((last, levels[l[0]]))
|
|
||||||
last = l
|
|
||||||
|
|
||||||
last_lvl = 1
|
|
||||||
for title, lvl in L:
|
|
||||||
indent = ' ' * (lvl - 1)
|
|
||||||
if last_lvl != lvl:
|
|
||||||
print()
|
|
||||||
print('{indent}* `{text} <#{id}>`_'.format(
|
|
||||||
indent = indent,
|
|
||||||
text = to_text(title),
|
|
||||||
id = to_id(title),
|
|
||||||
))
|
|
||||||
last_lvl = lvl
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
|
||||||
main(sys.stdin)
|
|
Loading…
Add table
Reference in a new issue