Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
I
installsystems
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Seblu
installsystems
Commits
2234f620
Commit
2234f620
authored
13 years ago
by
Seblu
Browse files
Options
Downloads
Patches
Plain Diff
move repo filter inside repomanager
parent
67515a89
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/is
+4
-10
4 additions, 10 deletions
bin/is
installsystems/repository.py
+7
-1
7 additions, 1 deletion
installsystems/repository.py
with
11 additions
and
11 deletions
bin/is
+
4
−
10
View file @
2234f620
...
...
@@ -9,7 +9,6 @@ InstallSystems Command line Tool
import
os
import
time
import
fnmatch
import
datetime
import
argparse
import
re
...
...
@@ -30,21 +29,16 @@ def load_repositories(args):
if
args
.
no_cache
:
args
.
cache
=
None
# init repo cache object
repoman
=
RepositoryManager
(
args
.
cache
,
timeout
=
args
.
timeout
)
repoman
=
RepositoryManager
(
args
.
cache
,
timeout
=
args
.
timeout
,
filter
=
args
.
repo_filter
)
# register repositories (order matter)
# load repo configs
# load repo configs
from command line
if
args
.
repo_path
is
not
None
:
# from command line
repoman
.
register
(
RepositoryConfig
(
istools
.
smd5sum
(
args
.
repo_path
)[:
8
],
path
=
args
.
repo_path
))
# from config
#
load repo configs
from config
for
repoconf
in
RepoConfigFile
(
args
.
repo_config
).
repos
:
if
args
.
repo_filter
is
None
:
repoman
.
register
(
repoconf
)
else
:
if
len
(
fnmatch
.
filter
([
repoconf
.
name
],
args
.
repo_filter
))
>
0
:
repoman
.
register
(
repoconf
)
repoman
.
register
(
repoconf
)
return
repoman
def
select_image
(
name
,
repoman
):
...
...
This diff is collapsed.
Click to expand it.
installsystems/repository.py
+
7
−
1
View file @
2234f620
...
...
@@ -12,6 +12,7 @@ import shutil
import
pwd
import
grp
import
tempfile
import
fnmatch
import
installsystems
import
installsystems.tools
as
istools
from
installsystems.printer
import
*
...
...
@@ -470,10 +471,11 @@ class RepositoryManager(object):
This call implement a cache and a manager for multiple repositories
'''
def
__init__
(
self
,
cache_path
=
None
,
timeout
=
None
):
def
__init__
(
self
,
cache_path
=
None
,
timeout
=
None
,
filter
=
None
):
self
.
timeout
=
3
if
timeout
is
None
else
timeout
self
.
repos
=
[]
self
.
tempfiles
=
[]
self
.
filter
=
filter
if
cache_path
is
None
:
self
.
cache_path
=
None
debug
(
"
No repository cache
"
)
...
...
@@ -533,6 +535,10 @@ class RepositoryManager(object):
'''
Register a repository from its config
'''
# check filter on name
if
self
.
filter
is
not
None
:
if
not
fnmatch
.
fnmatch
(
config
.
name
,
self
.
filter
):
return
# if path is local, no needs to create a cache
if
istools
.
isfile
(
config
.
path
):
debug
(
"
Registering direct repository %s (%s)
"
%
(
config
.
path
,
config
.
name
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment