[projects/pld-ftp-admin] pfa-testmvpkg, pfa-rmpkg: take -nb as pfa-mvpkg does
arekm
arekm at pld-linux.org
Thu Nov 12 00:28:46 CET 2026
commit 173e8e7e4bdbc93a376799c089d8ec526f159162
Author: Arkadiusz Miśkiewicz <arekm at maven.pl>
Date: Wed Nov 11 23:18:39 2026 +0100
pfa-testmvpkg, pfa-rmpkg: take -nb as pfa-mvpkg does
Only pfa-mvpkg could skip the builder queue check. With the queue
unreachable pfa-rmpkg could remove nothing, and pfa-testmvpkg could
not show what pfa-mvpkg -nb would do.
All three now take -nb, also spelled --no-check-build.
bin/pfa-mvpkg | 4 ++--
bin/pfa-rmpkg | 7 +++++--
bin/pfa-testmvpkg | 6 +++++-
modules/ftptree.py | 3 ++-
shell/bash-completion.sh | 3 ++-
5 files changed, 16 insertions(+), 7 deletions(-)
---
diff --git a/bin/pfa-mvpkg b/bin/pfa-mvpkg
index 092863a..e10811a 100755
--- a/bin/pfa-mvpkg
+++ b/bin/pfa-mvpkg
@@ -6,8 +6,8 @@ import os
import sys
parser = argparse.ArgumentParser(description='Move packages between ftp trees and mail a notification.')
-parser.add_argument('-nb', dest='nocheckbuild', action='store_true',
- help='do not check if builds are finished')
+parser.add_argument('-nb', '--no-check-build', dest='nocheckbuild', action='store_true',
+ help='do not ask the builder queue whether the builds are finished')
parser.add_argument('srctree', help='ftp tree to move from, e.g. test')
parser.add_argument('dsttree', help='ftp tree to move to, e.g. ready')
parser.add_argument('packages', nargs='+', metavar='package',
diff --git a/bin/pfa-rmpkg b/bin/pfa-rmpkg
index b307cb2..91d4f5c 100755
--- a/bin/pfa-rmpkg
+++ b/bin/pfa-rmpkg
@@ -6,10 +6,12 @@ import os
import sys
parser = argparse.ArgumentParser(description='Remove packages from an ftp tree.')
+parser.add_argument('-nb', '--no-check-build', dest='nocheckbuild', action='store_true',
+ help='do not ask the builder queue whether the builds are finished')
parser.add_argument('tree', help='ftp tree name, e.g. PLD, test, ready')
parser.add_argument('packages', nargs='+', metavar='package',
help='package to remove, e.g. foo-1.0-1')
-args = parser.parse_args()
+args = parser.parse_intermixed_args()
# config reads ~/.ftpadmrc on import; parse options first so --help works without it
sys.path.insert(0, os.environ['HOME']+'/pld-ftp-admin/modules')
@@ -29,7 +31,8 @@ if not ftpio.lock(treename, True):
try:
tree=ftptree.FtpTree(treename)
- #tree.do_checkbuild=False
+ if args.nocheckbuild:
+ tree.do_checkbuild = False
pkgs = list(set(args.packages))
tree.mark4removal(pkgs)
tree.removepkgs()
diff --git a/bin/pfa-testmvpkg b/bin/pfa-testmvpkg
index 1e77166..1874a5a 100755
--- a/bin/pfa-testmvpkg
+++ b/bin/pfa-testmvpkg
@@ -7,11 +7,13 @@ import sys
parser = argparse.ArgumentParser(
description='Check whether packages can be moved between ftp trees, without moving them.')
+parser.add_argument('-nb', '--no-check-build', dest='nocheckbuild', action='store_true',
+ help='do not ask the builder queue whether the builds are finished')
parser.add_argument('srctree', help='ftp tree to move from, e.g. test')
parser.add_argument('dsttree', help='ftp tree to move to, e.g. ready')
parser.add_argument('packages', nargs='+', metavar='package',
help='package to check, e.g. foo-1.0-1')
-args = parser.parse_args()
+args = parser.parse_intermixed_args()
# config reads ~/.ftpadmrc on import; parse options first so --help works without it
sys.path.insert(0, os.environ['HOME']+'/pld-ftp-admin/modules')
@@ -52,6 +54,8 @@ try:
archivetree = ftptree.FtpTree(archivetreename)
else:
archivetree = None
+ if args.nocheckbuild:
+ srctree.do_checkbuild = False
pkgs = list(set(args.packages))
srctree.mark4moving(pkgs)
srctree.testmove(dsttree, archivetree = archivetree)
diff --git a/modules/ftptree.py b/modules/ftptree.py
index d1e94cf..cc70d81 100644
--- a/modules/ftptree.py
+++ b/modules/ftptree.py
@@ -334,7 +334,8 @@ class FtpTree(BaseFtpTree):
self.__checkarchs(dsttree, self.loadedpkgs.values())
def testmove(self, dsttree, archivetree = None):
- self.__checkbuild(self.marked4moving)
+ if self.do_checkbuild:
+ self.__checkbuild(self.marked4moving)
self.__checkarchs(dsttree, self.marked4moving)
self.__checkduplicates(dsttree, self.marked4moving)
self.__checkfiles(dsttree, archivetree, self.marked4moving)
diff --git a/shell/bash-completion.sh b/shell/bash-completion.sh
index cce9928..f404822 100644
--- a/shell/bash-completion.sh
+++ b/shell/bash-completion.sh
@@ -99,6 +99,7 @@ _pfa-signpkg()
if [[ "$cur" == -* ]]; then
[[ ${1##*/} == pfa-signpkg ]] && opts+=' -f --force'
+ [[ ${1##*/} == pfa-rmpkg ]] && opts+=' -nb --no-check-build'
COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
elif [[ $args == 1 ]]; then
_pfa_tree "$cur"
@@ -121,7 +122,7 @@ _pfa-mvpkg()
_count_args :
if [[ "$cur" == -* ]]; then
- [[ ${1##*/} == pfa-mvpkg ]] && opts+=' -nb'
+ opts+=' -nb --no-check-build'
COMPREPLY=( $( compgen -W "$opts" -- "$cur" ) )
elif [[ $args == 1 ]] || [[ $args == 2 ]]; then
_pfa_tree "$cur"
================================================================
---- gitweb:
http://git.pld-linux.org/gitweb.cgi/projects/pld-ftp-admin.git/commitdiff/f0f51b4f65cdffd92042e4d10e359be0a751e080
More information about the pld-cvs-commit
mailing list