Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
agetpkg
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
archlinux
agetpkg
Commits
2de2538c
Commit
2de2538c
authored
Oct 16, 2015
by
Seblu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Shortcut to select all package in once
parent
6da44cf0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
1 deletion
+8
-1
agetpkg
agetpkg
+8
-1
No files found.
agetpkg
View file @
2de2538c
...
...
@@ -282,6 +282,7 @@ def list_packages(packages, long=False):
def
select_packages
(
packages
):
"""select a package in a list"""
# shortcut to one package
if
len
(
packages
)
==
1
:
yield
packages
[
0
]
else
:
...
...
@@ -292,9 +293,15 @@ def select_packages(packages):
print
(
"{:{pad}} {}"
.
format
(
i
,
pkg
,
pad
=
pad
))
selection
=
""
while
not
match
(
"^(
\
d+ ){0,}
\
d+$"
,
selection
):
selection
=
input
(
"Select packages: "
)
.
strip
()
selection
=
input
(
"Select packages
(* for all)
: "
)
.
strip
()
if
selection
==
""
:
return
# shortcut to select all packages
if
selection
==
"*"
:
for
pkg
in
packages
:
yield
pkg
return
# parse selection
numbers
=
[
int
(
x
)
for
x
in
selection
.
split
(
" "
)
]
for
num
in
numbers
:
if
num
in
index
.
keys
():
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment