amprolla

devuan's apt repo merger
git clone git://parazyd.org/amprolla.git
Log | Files | Refs | README | LICENSE

commit 7071810df54ff41c2604850ab23fd6d61bbe1128
parent 4268288f669be5e023be2a53477caa81a95d4244
Author: parazyd <parazyd@dyne.org>
Date:   Sun, 24 Jun 2018 15:34:33 +0200

Apply linting.

This commit does not change any functionality, just improves
readability.

Diffstat:
Mcontrib/populate_aliases.sh | 10++++++----
Mlib/config.def.py | 26+++++++++++++-------------
Mlib/parse.py | 17+++++++++--------
Mlib/release.py | 6++++--
Morchestrate.sh | 8++++----
5 files changed, 36 insertions(+), 31 deletions(-)

diff --git a/contrib/populate_aliases.sh b/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 diff --git a/lib/config.def.py b/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 = [ diff --git a/lib/parse.py b/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) diff --git a/lib/release.py b/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 diff --git a/orchestrate.sh b/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/