diff options
author | Timo Teräs <timo.teras@iki.fi> | 2012-09-20 15:12:15 +0300 |
---|---|---|
committer | Timo Teräs <timo.teras@iki.fi> | 2012-09-20 15:12:15 +0300 |
commit | 43850a126b94690302bc2564905141b077b490e7 (patch) | |
tree | 475d66e99a446a9b4d82ff10104e6858722c6ba8 /src/apk.c | |
parent | 8a4371ccd73e8f8672466881bd3b782de919cd93 (diff) | |
download | apk-tools-43850a126b94690302bc2564905141b077b490e7.tar.gz apk-tools-43850a126b94690302bc2564905141b077b490e7.tar.bz2 apk-tools-43850a126b94690302bc2564905141b077b490e7.tar.xz apk-tools-43850a126b94690302bc2564905141b077b490e7.zip |
apk: implement --progress-fd to write progress to a specified fd
Diffstat (limited to 'src/apk.c')
-rw-r--r-- | src/apk.c | 5 |
1 files changed, 5 insertions, 0 deletions
@@ -48,6 +48,7 @@ static struct apk_option generic_options[] = { { 'f', "force", "Do what was asked even if it looks dangerous" }, { 'U', "update-cache", "Update the repository cache" }, { 0x101, "progress", "Show a progress bar" }, + { 0x10f, "progress-fd", "Write progress to fd", required_argument, "FD" }, { 0x110, "no-progress", "Disable progress bar even for TTYs" }, { 0x102, "clean-protected", "Do not create .apk-new files to " "configuration dirs" }, @@ -265,6 +266,7 @@ static void setup_terminal(void) { setvbuf(stderr, NULL, _IOLBF, BUFSIZ); signal(SIGWINCH, on_sigwinch); + signal(SIGPIPE, SIG_IGN); } static void setup_automatic_flags(void) @@ -383,6 +385,9 @@ int main(int argc, char **argv) case 0x110: apk_flags &= ~APK_PROGRESS; break; + case 0x10f: + dbopts.progress_fd = atoi(optarg); + break; case 0x102: apk_flags |= APK_CLEAN_PROTECTED; break; |