summaryrefslogtreecommitdiff
path: root/src/apk.c
diff options
context:
space:
mode:
authorTimo Teras <timo.teras@iki.fi>2009-07-07 10:30:54 +0300
committerTimo Teras <timo.teras@iki.fi>2009-07-07 10:30:54 +0300
commitc84196e0d367d8e82e5a3161394741f86bc32750 (patch)
tree2b6004d8135307451b95f6e1ce0d23aa4cb3b2ad /src/apk.c
parent1531192cb9b697a8fc0042b295109bdf5cb52231 (diff)
downloadapk-tools-c84196e0d367d8e82e5a3161394741f86bc32750.tar.gz
apk-tools-c84196e0d367d8e82e5a3161394741f86bc32750.tar.bz2
apk-tools-c84196e0d367d8e82e5a3161394741f86bc32750.tar.xz
apk-tools-c84196e0d367d8e82e5a3161394741f86bc32750.zip
apk: add --wait option to wait for exclusive lock (fixes #26)
Diffstat (limited to 'src/apk.c')
-rw-r--r--src/apk.c19
1 files changed, 13 insertions, 6 deletions
diff --git a/src/apk.c b/src/apk.c
index 024c11d..84c2d04 100644
--- a/src/apk.c
+++ b/src/apk.c
@@ -24,23 +24,27 @@
const char *apk_root;
struct apk_repository_url apk_repository_list;
-int apk_verbosity = 1, apk_cwd_fd;
+int apk_verbosity = 1, apk_cwd_fd, apk_wait;
unsigned int apk_flags = 0;
static struct apk_option generic_options[] = {
{ 'h', "help", "Show generic help or applet specific help" },
{ 'p', "root", "Install packages to DIR",
- required_argument, "DIR" },
+ required_argument, "DIR" },
{ 'X', "repository", "Use packages from REPO",
- required_argument, "REPO" },
+ required_argument, "REPO" },
{ 'q', "quiet", "Print less information" },
{ 'v', "verbose", "Print more information" },
{ 'V', "version", "Print program version and exit" },
{ 'f', "force", "Do what was asked even if it looks dangerous" },
{ 0x101, "progress", "Show a progress bar" },
- { 0x102, "clean-protected",
- "Do not create .apk-new files to configuration dirs" },
- { 0x104, "simulate", "Show what would be done without actually doing it" },
+ { 0x102, "clean-protected", "Do not create .apk-new files to "
+ "configuration dirs" },
+ { 0x104, "simulate", "Show what would be done without actually "
+ "doing it" },
+ { 0x105, "wait", "Wait for TIME seconds to get an exclusive "
+ "repository lock before failing",
+ required_argument, "TIME" },
};
void apk_log(const char *prefix, const char *format, ...)
@@ -305,6 +309,9 @@ int main(int argc, char **argv)
case 0x104:
apk_flags |= APK_SIMULATE;
break;
+ case 0x105:
+ apk_wait = atoi(optarg);
+ break;
default:
if (applet == NULL || applet->parse == NULL ||
applet->parse(ctx, r,