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
1761d033
Commit
1761d033
authored
13 years ago
by
Aurélien Dunand
Committed by
Seblu
13 years ago
Browse files
Options
Downloads
Patches
Plain Diff
cat command can display several files
files can be a list and/or unix filename pattern
parent
dad43b37
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/is
+4
-4
4 additions, 4 deletions
bin/is
installsystems/image.py
+10
-3
10 additions, 3 deletions
installsystems/image.py
with
14 additions
and
7 deletions
bin/is
+
4
−
4
View file @
1761d033
...
...
@@ -182,7 +182,7 @@ def c_list(parser, args):
def
c_cat
(
parser
,
args
):
'''
Display image
'
s file
Display image
'
s file
(s)
'''
# looks if arguments is a file or image name
if
istools
.
pathtype
(
args
.
image
)
==
"
file
"
and
os
.
path
.
isfile
(
args
.
image
):
...
...
@@ -191,7 +191,8 @@ def c_cat(parser, args):
# get image package
repoman
=
load_repositories
(
args
)
pkg
=
repoman
.
get
(
args
.
image
,
args
.
image_version
)
pkg
.
cat
(
args
.
file
)
for
filename
in
args
.
files
:
pkg
.
cat
(
filename
)
def
c_search
(
parser
,
args
):
'''
...
...
@@ -298,11 +299,10 @@ p_install.set_defaults(func=c_install, subparser=p_install)
# cat command parser
p_cat
=
subparsers
.
add_parser
(
"
cat
"
,
help
=
c_cat
.
__doc__
.
lower
())
p_cat
.
add_argument
(
"
-v
"
,
"
--image-version
"
,
type
=
int
,
default
=
None
,
help
=
"
image version
"
)
p_cat
.
add_argument
(
"
image
"
,
help
=
"
image (path or name)
"
)
p_cat
.
add_argument
(
"
file
"
,
help
=
"
file to cat
"
)
p_cat
.
add_argument
(
"
file
s
"
,
nargs
=
'
+
'
,
help
=
"
file
s
to cat
"
)
p_cat
.
set_defaults
(
func
=
c_cat
)
# get command parser
...
...
This diff is collapsed.
Click to expand it.
installsystems/image.py
+
10
−
3
View file @
1761d033
...
...
@@ -17,6 +17,7 @@ import re
import
cStringIO
import
shutil
import
gzip
import
fnmatch
import
installsystems.template
as
istemplate
import
installsystems.tools
as
istools
from
installsystems.printer
import
*
...
...
@@ -454,9 +455,15 @@ class PackageImage(Image):
arrowlevel
(
-
1
)
def
cat
(
self
,
filename
):
fd
=
self
.
_tarball
.
extractfile
(
filename
)
arrow
(
filename
)
out
(
fd
.
read
())
'''
Display filename in the tarball
'''
for
filename
in
fnmatch
.
filter
(
self
.
_tarball
.
getnames
(),
filename
):
fd
=
self
.
_tarball
.
extractfile
(
filename
)
if
fd
is
not
None
:
arrow
(
filename
)
out
(
fd
.
read
())
fd
.
close
()
def
run_parser
(
self
,
**
kwargs
):
'''
...
...
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