Browse Source

Apply linting.

This commit does not change any functionality, just improves
readability.
debianarchive-update
parazyd 5 years ago
parent
commit
7071810df5
Signed by untrusted user: parazyd GPG Key ID: F0CB28FCF78637DE
  1. 10
      contrib/populate_aliases.sh
  2. 26
      lib/config.def.py
  3. 17
      lib/parse.py
  4. 6
      lib/release.py
  5. 8
      orchestrate.sh

10
contrib/populate_aliases.sh

@ -37,8 +37,10 @@ PAIRS="
$dryrun cd "$REPO_ROOT" || exit 1
echo "$PAIRS" | while read codename suite; do
[ -n "$codename" ] && [ -n "$suite" ] && [ $(echo "$codename" | grep -v '^#') ] && {
$dryrun ln -snfv "$codename" "$suite"
} || continue
echo "$PAIRS" | while read -r codename suite; do
if [ -n "$codename" ] && [ -n "$suite" ]; then
if echo "$codename" | grep -qv '^#'; then
$dryrun ln -snfv "$codename" "$suite"
fi
fi
done

26
lib/config.def.py

@ -73,7 +73,7 @@ suites = {
],
'beowulf': [
'beowulf',
#'beowulf-backports',
# 'beowulf-backports',
'beowulf-proposed-updates',
'beowulf-security',
'beowulf-updates',
@ -192,24 +192,24 @@ categories = ['main', 'contrib', 'non-free']
arches = [
'source',
'binary-all',
#'binary-alpha',
# 'binary-alpha',
'binary-amd64',
'binary-arm64',
'binary-armel',
'binary-armhf',
#'binary-hppa',
#'binary-hurd-i386',
# 'binary-hppa',
# 'binary-hurd-i386',
'binary-i386',
#'binary-ia64',
#'binary-kfreebsd-amd64',
#'binary-kfreebsd-i386',
#'binary-mips',
#'binary-mips64el',
#'binary-mipsel',
#'binary-powerpc',
# 'binary-ia64',
# 'binary-kfreebsd-amd64',
# 'binary-kfreebsd-i386',
# 'binary-mips',
# 'binary-mips64el',
# 'binary-mipsel',
# 'binary-powerpc',
'binary-ppc64el',
#'binary-s390x',
#'binary-sparc',
# 'binary-s390x',
# 'binary-sparc',
]
mainrepofiles = [

17
lib/parse.py

@ -187,8 +187,9 @@ def get_upstream(rest):
def get_non_digit(s):
"""
Get a string and return the longest leading substring consisting exclusively
of non-digits (or an empty string), and the remaining substring.
Get a string and return the longest leading substring consisting
exclusively of non-digits (or an empty string), and the remaining
substring.
"""
if not s:
return "", ""
@ -224,8 +225,8 @@ def get_digit(s):
def char_val(c):
"""
Returns an integer value of a given unicode character. Returns 0 on ~ (since
this is in Debian's policy)
Returns an integer value of a given unicode character. Returns 0 on ~
(since this is in Debian's policy)
"""
if c == '~':
return 0
@ -281,10 +282,10 @@ def compare_non_epoch(s1, s2):
def cmppkgver(ver1, ver2):
"""
Main function to compare two package versions. Wraps around other functions
to provide a result. It returns an integer < 0 if ver1 is earlier than ver2,
0 if ver1 is the same as ver2, and an integer > 0 if ver2 is earlier than
ver2.
Main function to compare two package versions. Wraps around other
functions to provide a result. It returns an integer < 0 if ver1 is
earlier than ver2, 0 if ver1 is the same as ver2, and an integer > 0
if ver2 is earlier than ver2.
WARNING: The function does not induce a total order (i.e., return values
MUST NOT be added or subtracted)

6
lib/release.py

@ -64,8 +64,10 @@ def write_release(oldrel, newrel, filelist, rmstr, rewrite=True):
_archlist = ''
for i in arches:
if i == 'source': continue
if i == 'binary-all': continue
if i == 'source':
continue
if i == 'binary-all':
continue
i = i.replace('binary-', ' ')
_archlist += i
rel_cont['Architectures'] = _archlist

8
orchestrate.sh

@ -16,19 +16,19 @@ python3 "$AMPROLLA_UPDATE" || {
printf "rsyncing volatile to production... "
rsync --delete -raX "$REPO_ROOT"/merged-volatile/* "$REPO_ROOT"/merged-production
printf "done!\n"
echo "done!"
ln -snf "$REPO_ROOT"/merged-production "$REPO_ROOT"/merged
printf "rsyncing volatile to staging... "
rsync --delete -raX "$REPO_ROOT"/merged-volatile/* "$REPO_ROOT"/merged-staging
printf "done!\n"
echo "done!"
printf "rsyncing production to pkgmaster... "
rsync --delete -raX \
"$REPO_ROOT"/merged-production/ \
mirror@pkgmaster.devuan.org:/home/mirror/devuan/merged
printf "done!\n"
echo "done!"
# handle obsolete package logs
cat "$REPO_ROOT"/log/*-oldpackages.txt | sort | uniq > "$REPO_ROOT"/log/oldpackages.txt
@ -36,7 +36,7 @@ cat "$REPO_ROOT"/log/*-oldpackages.txt | sort | uniq > "$REPO_ROOT"/log/oldpacka
_logfiles="libsystemd bannedpackages"
mkdir -p "$REPO_ROOT"/log/t
for i in $_logfiles; do
sort "$REPO_ROOT"/log/${i}.txt | uniq > "$REPO_ROOT"/log/t/${i}.txt
sort "$REPO_ROOT/log/${i}.txt" | uniq > "$REPO_ROOT/log/t/${i}.txt"
done
cp -f "$REPO_ROOT"/log/t/*.txt "$REPO_ROOT"/log/

Loading…
Cancel
Save