Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
D
dpkg
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
Packages
Packages
Container Registry
Wiki
Wiki
External Wiki
External Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Jobs
Commits
Open sidebar
Dpkg Developers
dpkg
Commits
47d2aef6
Commit
47d2aef6
authored
Jun 22, 2012
by
Guillem Jover
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
libdpkg: Add new command_get_pager() function
parent
30571124
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
24 additions
and
0 deletions
+24
-0
lib/dpkg/command.c
lib/dpkg/command.c
+21
-0
lib/dpkg/command.h
lib/dpkg/command.h
+1
-0
lib/dpkg/dpkg.h
lib/dpkg/dpkg.h
+1
-0
lib/dpkg/libdpkg.map
lib/dpkg/libdpkg.map
+1
-0
No files found.
lib/dpkg/command.c
View file @
47d2aef6
...
...
@@ -179,6 +179,27 @@ command_exec(struct command *cmd)
ohshite
(
_
(
"unable to execute %s (%s)"
),
cmd
->
name
,
cmd
->
filename
);
}
/**
* Get a suitable pager.
*
* @return A string representing a pager.
*/
const
char
*
command_get_pager
(
void
)
{
const
char
*
pager
;
if
(
!
isatty
(
1
))
return
CAT
;
pager
=
getenv
(
"PAGER"
);
if
(
str_is_unset
(
pager
))
pager
=
DEFAULTPAGER
;
return
pager
;
}
/**
* Execute a shell with a possible command.
*
...
...
lib/dpkg/command.h
View file @
47d2aef6
...
...
@@ -54,6 +54,7 @@ void command_add_args(struct command *cmd, ...) DPKG_ATTR_SENTINEL;
void
command_exec
(
struct
command
*
cmd
)
DPKG_ATTR_NORET
;
const
char
*
command_get_pager
(
void
);
void
command_shell
(
const
char
*
cmd
,
const
char
*
name
);
/** @} */
...
...
lib/dpkg/dpkg.h
View file @
47d2aef6
...
...
@@ -110,6 +110,7 @@ DPKG_BEGIN_DECLS
#define TAR "tar"
#define RM "rm"
#define CAT "cat"
#define FIND "find"
#define DIFF "diff"
...
...
lib/dpkg/libdpkg.map
View file @
47d2aef6
...
...
@@ -128,6 +128,7 @@ LIBDPKG_PRIVATE {
command_add_argv;
command_add_args;
command_exec;
command_get_pager;
command_shell;
command_destroy;
...
...
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