From 66999915b78ac05671fbadae5acd7be710cf2773 Mon Sep 17 00:00:00 2001 From: Gerfried Fuchs Date: Wed, 3 Oct 2007 19:46:07 +0200 Subject: [PATCH] Imported Debian patch 1.2.2-20 --- Makefile | 2 +- beep.c | 94 +++-------------- debian/changelog | 15 +++ debian/control | 5 +- debian/copyright | 19 ++-- debian/patches/01_makefile-fixup | 11 ++ debian/patches/02_verbose-option | 76 ++++++++++++++ debian/patches/03_multiple-freq | 44 ++++++++ debian/patches/04_serial-console-fix | 15 +++ debian/patches/05_devfs-fix | 21 ++++ debian/patches/06_event-option | 151 +++++++++++++++++++++++++++ debian/patches/series | 6 ++ debian/po/ca.po | 2 +- debian/po/cs.po | 2 +- debian/po/de.po | 2 +- debian/po/es.po | 2 +- debian/po/fr.po | 2 +- debian/po/it.po | 7 +- debian/po/ja.po | 7 +- debian/po/nl.po | 8 +- debian/po/pt.po | 2 +- debian/po/pt_BR.po | 2 +- debian/po/ru.po | 8 +- debian/po/sv.po | 2 +- debian/po/templates.pot | 6 +- debian/po/vi.po | 2 +- debian/rules | 8 +- 27 files changed, 392 insertions(+), 129 deletions(-) create mode 100644 debian/patches/01_makefile-fixup create mode 100644 debian/patches/02_verbose-option create mode 100644 debian/patches/03_multiple-freq create mode 100644 debian/patches/04_serial-console-fix create mode 100644 debian/patches/05_devfs-fix create mode 100644 debian/patches/06_event-option create mode 100644 debian/patches/series diff --git a/Makefile b/Makefile index cc359c4..5856f9f 100644 --- a/Makefile +++ b/Makefile @@ -15,5 +15,5 @@ beep : beep.c install : cp ${EXEC_NAME} ${INSTALL_DIR} - # rm -f /usr/man/man1/beep.1.bz2 + rm -f /usr/man/man1/beep.1.bz2 cp ${MAN_FILE} ${MAN_DIR} diff --git a/beep.c b/beep.c index e421e8f..f774b56 100644 --- a/beep.c +++ b/beep.c @@ -26,7 +26,6 @@ #include #include #include -#include /* I don't know where this number comes from, I admit that freely. A wonderful human named Raine M. Ekman used it in a program that played @@ -84,52 +83,21 @@ typedef struct beep_parms_t { so that beep can be tucked appropriately into a text- processing pipe. */ - int verbose; /* verbose output? */ struct beep_parms_t *next; /* in case -n/--new is used. */ } beep_parms_t; -enum { BEEP_TYPE_CONSOLE, BEEP_TYPE_EVDEV }; - /* Momma taught me never to use globals, but we need something the signal handlers can get at.*/ int console_fd = -1; -int console_type = BEEP_TYPE_CONSOLE; -char *console_device = NULL; - - -void do_beep(int freq) { - if (console_type == BEEP_TYPE_CONSOLE) { - if(ioctl(console_fd, KIOCSOUND, freq != 0 - ? (int)(CLOCK_TICK_RATE/freq) - : freq) < 0) { - printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ - perror("ioctl"); - } - } else { - /* BEEP_TYPE_EVDEV */ - struct input_event e; - - e.type = EV_SND; - e.code = SND_TONE; - e.value = freq; - - write(console_fd, &e, sizeof(struct input_event)); - } -} - /* If we get interrupted, it would be nice to not leave the speaker beeping in perpetuity. */ void handle_signal(int signum) { - - if(console_device) - free(console_device); - switch(signum) { case SIGINT: if(console_fd >= 0) { /* Kill the sound, quit gracefully */ - do_beep(0); + ioctl(console_fd, KIOCSOUND, 0); close(console_fd); exit(signum); } else { @@ -142,7 +110,7 @@ void handle_signal(int signum) { /* print usage and exit */ void usage_bail(const char *executable_name) { printf("Usage:\n%s [-f freq] [-l length] [-r reps] [-d delay] " - "[-D delay] [-s] [-c] [-e device]\n", + "[-D delay] [-s] [-c]\n", executable_name); printf("%s [Options...] [-n] [--new] [Options...] ... \n", executable_name); printf("%s [-h] [--help]\n", executable_name); @@ -163,7 +131,6 @@ void usage_bail(const char *executable_name) { * "-D " (similar to -d, but delay after last repetition as well) * "-s" (beep after each line of input from stdin, echo line to stdout) * "-c" (beep after each char of input from stdin, echo char to stdout) - * "--verbose/--debug" * "-h/--help" * "-v/-V/--version" * "-n/--new" @@ -174,14 +141,11 @@ void usage_bail(const char *executable_name) { void parse_command_line(int argc, char **argv, beep_parms_t *result) { int c; - struct option opt_list[7] = {{"help", 0, NULL, 'h'}, + struct option opt_list[4] = {{"help", 0, NULL, 'h'}, {"version", 0, NULL, 'V'}, {"new", 0, NULL, 'n'}, - {"verbose", 0, NULL, 'X'}, - {"debug", 0, NULL, 'X'}, - {"device", 1, NULL, 'e'}, {0,0,0,0}}; - while((c = getopt_long(argc, argv, "f:l:r:d:D:schvVne:", opt_list, NULL)) + while((c = getopt_long(argc, argv, "f:l:r:d:D:schvVn", opt_list, NULL)) != EOF) { int argval = -1; /* handle parsed numbers for various arguments */ float argfreq = -1; @@ -191,9 +155,6 @@ void parse_command_line(int argc, char **argv, beep_parms_t *result) { (argfreq <= 0)) usage_bail(argv[0]); else - if (result->freq != 0) - fprintf(stderr, "WARNING: multiple -f values given, only last " - "one is used.\n"); result->freq = argfreq; break; case 'l' : /* length */ @@ -236,68 +197,43 @@ void parse_command_line(int argc, char **argv, beep_parms_t *result) { exit(0); break; case 'n' : /* also --new - create another beep */ - if (result->freq == 0) - result->freq = DEFAULT_FREQ; result->next = (beep_parms_t *)malloc(sizeof(beep_parms_t)); - result->next->freq = 0; + result->next->freq = DEFAULT_FREQ; result->next->length = DEFAULT_LENGTH; result->next->reps = DEFAULT_REPS; result->next->delay = DEFAULT_DELAY; result->next->end_delay = DEFAULT_END_DELAY; result->next->stdin_beep = DEFAULT_STDIN_BEEP; - result->next->verbose = result->verbose; result->next->next = NULL; result = result->next; /* yes, I meant to do that. */ break; - case 'X' : /* --debug / --verbose */ - result->verbose = 1; - break; - case 'e' : /* also --device */ - console_device = strdup(optarg); - break; case 'h' : /* notice that this is also --help */ default : usage_bail(argv[0]); } } - if (result->freq == 0) - result->freq = DEFAULT_FREQ; } void play_beep(beep_parms_t parms) { int i; /* loop counter */ - if(parms.verbose == 1) - fprintf(stderr, "[DEBUG] %d times %d ms beeps (%d delay between, " - "%d delay after) @ %.2f Hz\n", - parms.reps, parms.length, parms.delay, parms.end_delay, parms.freq); - /* try to snag the console */ - if(console_device) - console_fd = open(console_device, O_WRONLY); - else - if((console_fd = open("/dev/tty0", O_WRONLY)) == -1) - console_fd = open("/dev/vc/0", O_WRONLY); - - if(console_fd == -1) { - fprintf(stderr, "Could not open %s for writing\n", - console_device != NULL ? console_device : "/dev/tty0 or /dev/vc/0"); + if((console_fd = open("/dev/console", O_WRONLY)) == -1) { + fprintf(stderr, "Could not open /dev/console for writing.\n"); printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ perror("open"); exit(1); } - - if (ioctl(console_fd, EVIOCGSND(0)) != -1) - console_type = BEEP_TYPE_EVDEV; - else - console_type = BEEP_TYPE_CONSOLE; /* Beep */ for (i = 0; i < parms.reps; i++) { /* start beep */ - do_beep(parms.freq); + if(ioctl(console_fd, KIOCSOUND, (int)(CLOCK_TICK_RATE/parms.freq)) < 0) { + printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ + perror("ioctl"); + } /* Look ma, I'm not ansi C compatible! */ usleep(1000*parms.length); /* wait... */ - do_beep(0); + ioctl(console_fd, KIOCSOUND, 0); /* stop beep */ if(parms.end_delay || (i+1 < parms.reps)) usleep(1000*parms.delay); /* wait... */ } /* repeat. */ @@ -311,13 +247,12 @@ int main(int argc, char **argv) { char sin[4096], *ptr; beep_parms_t *parms = (beep_parms_t *)malloc(sizeof(beep_parms_t)); - parms->freq = 0; + parms->freq = DEFAULT_FREQ; parms->length = DEFAULT_LENGTH; parms->reps = DEFAULT_REPS; parms->delay = DEFAULT_DELAY; parms->end_delay = DEFAULT_END_DELAY; parms->stdin_beep = DEFAULT_STDIN_BEEP; - parms->verbose = 0; parms->next = NULL; signal(SIGINT, handle_signal); @@ -360,8 +295,5 @@ int main(int argc, char **argv) { parms = next; } - if(console_device) - free(console_device); - return EXIT_SUCCESS; } diff --git a/debian/changelog b/debian/changelog index ebe6cd6..1a1e84c 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,18 @@ +beep (1.2.2-20) unstable; urgency=low + + * Added Homepage: control field. + * Moved patches to quilt, split them into: + - makefile-fixup: don't try to remove something outside the build place + - verbose-option: enable --verbose/--debug for getting info on what's + getting done + - multiple-freq: produce a warning on multiple frequency parameters + - serial-console-fix: use /dev/tty0 instead of /dev/console + - devfs-fix: try /dev/vc/0 too + - event-option: enable --event switch for specifying a special device + * Updated copyright file with the actual header from the code. + + -- Gerfried Fuchs Wed, 03 Oct 2007 19:46:07 +0200 + beep (1.2.2-19) unstable; urgency=low * Translation update: Japanese (Hideki Yamane, closes: #392171) diff --git a/debian/control b/debian/control index c7f0ba8..694a7ff 100644 --- a/debian/control +++ b/debian/control @@ -1,9 +1,10 @@ Source: beep Section: sound Priority: optional -Maintainer: Gerfried Fuchs -Build-Depends: po-debconf, patch +Maintainer: Gerfried Fuchs +Build-Depends: po-debconf, patch, quilt Standards-Version: 3.7.2 +Homepage: http://johnath.com/beep/ Package: beep Architecture: any diff --git a/debian/copyright b/debian/copyright index 407c4d1..c51ed8b 100644 --- a/debian/copyright +++ b/debian/copyright @@ -1,4 +1,4 @@ -This package was debianized by Gerfried Fuchs on +This package was debianized by Gerfried Fuchs on Thu, 18 Oct 2001 09:26:50 +0200. It was downloaded from http://www.johnath.com/beep/ @@ -9,14 +9,15 @@ Copyright: ========== This software is copyright (C) 2000 by Johnathan Nightingale. - This package is free software; you can redistribute it and/or modify - it under the terms of the GNU General Public License as published by - the Free Software Foundation; version 2 dated June, 1991. + This code may distributed only under the terms of the GNU Public + License which can be found at http://www.gnu.org/copyleft or in + the file COPYING supplied with this code. - This package is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU General Public License for more details. + This code is not distributed with warranties of any kind, including + implied warranties of merchantability or fitness for a particular use + or ability to breed pandas in captivity, it just can't be done. On Debian GNU/Linux systems, the complete text of the GNU General -Public License can be found in `/usr/share/common-licenses/GPL'. +Public License version 2 can be found in `/usr/share/common-licenses/GPL-2'. +Later versions which the GNU project publishes on the above mentioned URL can +be found in the same directory. diff --git a/debian/patches/01_makefile-fixup b/debian/patches/01_makefile-fixup new file mode 100644 index 0000000..76e67ee --- /dev/null +++ b/debian/patches/01_makefile-fixup @@ -0,0 +1,11 @@ +Index: beep-1.2.2/Makefile +=================================================================== +--- beep-1.2.2.orig/Makefile ++++ beep-1.2.2/Makefile +@@ -15,5 +15,5 @@ beep : beep.c + + install : + cp ${EXEC_NAME} ${INSTALL_DIR} +- rm -f /usr/man/man1/beep.1.bz2 ++ # rm -f /usr/man/man1/beep.1.bz2 + cp ${MAN_FILE} ${MAN_DIR} diff --git a/debian/patches/02_verbose-option b/debian/patches/02_verbose-option new file mode 100644 index 0000000..7a3cb89 --- /dev/null +++ b/debian/patches/02_verbose-option @@ -0,0 +1,76 @@ +Index: beep-1.2.2/beep.c +=================================================================== +--- beep-1.2.2.orig/beep.c ++++ beep-1.2.2/beep.c +@@ -83,6 +83,7 @@ typedef struct beep_parms_t { + so that beep can be tucked appropriately into a text- + processing pipe. + */ ++ int verbose; /* verbose output? */ + struct beep_parms_t *next; /* in case -n/--new is used. */ + } beep_parms_t; + +@@ -110,7 +111,7 @@ void handle_signal(int signum) { + /* print usage and exit */ + void usage_bail(const char *executable_name) { + printf("Usage:\n%s [-f freq] [-l length] [-r reps] [-d delay] " +- "[-D delay] [-s] [-c]\n", ++ "[-D delay] [-s] [-c] [--verbose | --debug]\n", + executable_name); + printf("%s [Options...] [-n] [--new] [Options...] ... \n", executable_name); + printf("%s [-h] [--help]\n", executable_name); +@@ -131,6 +132,7 @@ void usage_bail(const char *executable_n + * "-D " (similar to -d, but delay after last repetition as well) + * "-s" (beep after each line of input from stdin, echo line to stdout) + * "-c" (beep after each char of input from stdin, echo char to stdout) ++ * "--verbose/--debug" + * "-h/--help" + * "-v/-V/--version" + * "-n/--new" +@@ -141,9 +143,11 @@ void usage_bail(const char *executable_n + void parse_command_line(int argc, char **argv, beep_parms_t *result) { + int c; + +- struct option opt_list[4] = {{"help", 0, NULL, 'h'}, ++ struct option opt_list[6] = {{"help", 0, NULL, 'h'}, + {"version", 0, NULL, 'V'}, + {"new", 0, NULL, 'n'}, ++ {"verbose", 0, NULL, 'X'}, ++ {"debug", 0, NULL, 'X'}, + {0,0,0,0}}; + while((c = getopt_long(argc, argv, "f:l:r:d:D:schvVn", opt_list, NULL)) + != EOF) { +@@ -204,9 +208,13 @@ void parse_command_line(int argc, char * + result->next->delay = DEFAULT_DELAY; + result->next->end_delay = DEFAULT_END_DELAY; + result->next->stdin_beep = DEFAULT_STDIN_BEEP; ++ result->next->verbose = result->verbose; + result->next->next = NULL; + result = result->next; /* yes, I meant to do that. */ + break; ++ case 'X' : /* --debug / --verbose */ ++ result->verbose = 1; ++ break; + case 'h' : /* notice that this is also --help */ + default : + usage_bail(argv[0]); +@@ -217,6 +225,11 @@ void parse_command_line(int argc, char * + void play_beep(beep_parms_t parms) { + int i; /* loop counter */ + ++ if(parms.verbose == 1) ++ fprintf(stderr, "[DEBUG] %d times %d ms beeps (%d delay between, " ++ "%d delay after) @ %.2f Hz\n", ++ parms.reps, parms.length, parms.delay, parms.end_delay, parms.freq); ++ + /* try to snag the console */ + if((console_fd = open("/dev/console", O_WRONLY)) == -1) { + fprintf(stderr, "Could not open /dev/console for writing.\n"); +@@ -253,6 +266,7 @@ int main(int argc, char **argv) { + parms->delay = DEFAULT_DELAY; + parms->end_delay = DEFAULT_END_DELAY; + parms->stdin_beep = DEFAULT_STDIN_BEEP; ++ parms->verbose = 0; + parms->next = NULL; + + signal(SIGINT, handle_signal); diff --git a/debian/patches/03_multiple-freq b/debian/patches/03_multiple-freq new file mode 100644 index 0000000..2be1dc0 --- /dev/null +++ b/debian/patches/03_multiple-freq @@ -0,0 +1,44 @@ +Index: beep-1.2.2/beep.c +=================================================================== +--- beep-1.2.2.orig/beep.c ++++ beep-1.2.2/beep.c +@@ -159,6 +159,9 @@ void parse_command_line(int argc, char * + (argfreq <= 0)) + usage_bail(argv[0]); + else ++ if (result->freq != 0) ++ fprintf(stderr, "WARNING: multiple -f values given, only last " ++ "one is used.\n"); + result->freq = argfreq; + break; + case 'l' : /* length */ +@@ -201,8 +204,10 @@ void parse_command_line(int argc, char * + exit(0); + break; + case 'n' : /* also --new - create another beep */ ++ if (result->freq == 0) ++ result->freq = DEFAULT_FREQ; + result->next = (beep_parms_t *)malloc(sizeof(beep_parms_t)); +- result->next->freq = DEFAULT_FREQ; ++ result->next->freq = 0; + result->next->length = DEFAULT_LENGTH; + result->next->reps = DEFAULT_REPS; + result->next->delay = DEFAULT_DELAY; +@@ -220,6 +225,8 @@ void parse_command_line(int argc, char * + usage_bail(argv[0]); + } + } ++ if (result->freq == 0) ++ result->freq = DEFAULT_FREQ; + } + + void play_beep(beep_parms_t parms) { +@@ -260,7 +267,7 @@ int main(int argc, char **argv) { + char sin[4096], *ptr; + + beep_parms_t *parms = (beep_parms_t *)malloc(sizeof(beep_parms_t)); +- parms->freq = DEFAULT_FREQ; ++ parms->freq = 0; + parms->length = DEFAULT_LENGTH; + parms->reps = DEFAULT_REPS; + parms->delay = DEFAULT_DELAY; diff --git a/debian/patches/04_serial-console-fix b/debian/patches/04_serial-console-fix new file mode 100644 index 0000000..f07856b --- /dev/null +++ b/debian/patches/04_serial-console-fix @@ -0,0 +1,15 @@ +Index: beep-1.2.2/beep.c +=================================================================== +--- beep-1.2.2.orig/beep.c ++++ beep-1.2.2/beep.c +@@ -238,8 +238,8 @@ void play_beep(beep_parms_t parms) { + parms.reps, parms.length, parms.delay, parms.end_delay, parms.freq); + + /* try to snag the console */ +- if((console_fd = open("/dev/console", O_WRONLY)) == -1) { +- fprintf(stderr, "Could not open /dev/console for writing.\n"); ++ if((console_fd = open("/dev/tty0", O_WRONLY)) == -1) { ++ fprintf(stderr, "Could not open /dev/tty0 for writing.\n"); + printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ + perror("open"); + exit(1); diff --git a/debian/patches/05_devfs-fix b/debian/patches/05_devfs-fix new file mode 100644 index 0000000..e82858a --- /dev/null +++ b/debian/patches/05_devfs-fix @@ -0,0 +1,21 @@ +Index: beep-1.2.2/beep.c +=================================================================== +--- beep-1.2.2.orig/beep.c ++++ beep-1.2.2/beep.c +@@ -239,10 +239,12 @@ void play_beep(beep_parms_t parms) { + + /* try to snag the console */ + if((console_fd = open("/dev/tty0", O_WRONLY)) == -1) { +- fprintf(stderr, "Could not open /dev/tty0 for writing.\n"); +- printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ +- perror("open"); +- exit(1); ++ if((console_fd = open("/dev/vc/0", O_WRONLY)) == -1) { ++ fprintf(stderr, "Could not open /dev/tty0 or /dev/vc/0 for writing.\n"); ++ printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ ++ perror("open"); ++ exit(1); ++ } + } + + /* Beep */ diff --git a/debian/patches/06_event-option b/debian/patches/06_event-option new file mode 100644 index 0000000..e96c093 --- /dev/null +++ b/debian/patches/06_event-option @@ -0,0 +1,151 @@ +Index: beep-1.2.2/beep.c +=================================================================== +--- beep-1.2.2.orig/beep.c ++++ beep-1.2.2/beep.c +@@ -26,6 +26,7 @@ + #include + #include + #include ++#include + + /* I don't know where this number comes from, I admit that freely. A + wonderful human named Raine M. Ekman used it in a program that played +@@ -87,18 +88,48 @@ typedef struct beep_parms_t { + struct beep_parms_t *next; /* in case -n/--new is used. */ + } beep_parms_t; + ++enum { BEEP_TYPE_CONSOLE, BEEP_TYPE_EVDEV }; ++ + /* Momma taught me never to use globals, but we need something the signal + handlers can get at.*/ + int console_fd = -1; ++int console_type = BEEP_TYPE_CONSOLE; ++char *console_device = NULL; ++ ++ ++void do_beep(int freq) { ++ if (console_type == BEEP_TYPE_CONSOLE) { ++ if(ioctl(console_fd, KIOCSOUND, freq != 0 ++ ? (int)(CLOCK_TICK_RATE/freq) ++ : freq) < 0) { ++ printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ ++ perror("ioctl"); ++ } ++ } else { ++ /* BEEP_TYPE_EVDEV */ ++ struct input_event e; ++ ++ e.type = EV_SND; ++ e.code = SND_TONE; ++ e.value = freq; ++ ++ write(console_fd, &e, sizeof(struct input_event)); ++ } ++} ++ + + /* If we get interrupted, it would be nice to not leave the speaker beeping in + perpetuity. */ + void handle_signal(int signum) { ++ ++ if(console_device) ++ free(console_device); ++ + switch(signum) { + case SIGINT: + if(console_fd >= 0) { + /* Kill the sound, quit gracefully */ +- ioctl(console_fd, KIOCSOUND, 0); ++ do_beep(0); + close(console_fd); + exit(signum); + } else { +@@ -111,7 +142,7 @@ void handle_signal(int signum) { + /* print usage and exit */ + void usage_bail(const char *executable_name) { + printf("Usage:\n%s [-f freq] [-l length] [-r reps] [-d delay] " +- "[-D delay] [-s] [-c] [--verbose | --debug]\n", ++ "[-D delay] [-s] [-c] [--verbose | --debug] [-e device]\n", + executable_name); + printf("%s [Options...] [-n] [--new] [Options...] ... \n", executable_name); + printf("%s [-h] [--help]\n", executable_name); +@@ -143,13 +174,14 @@ void usage_bail(const char *executable_n + void parse_command_line(int argc, char **argv, beep_parms_t *result) { + int c; + +- struct option opt_list[6] = {{"help", 0, NULL, 'h'}, ++ struct option opt_list[7] = {{"help", 0, NULL, 'h'}, + {"version", 0, NULL, 'V'}, + {"new", 0, NULL, 'n'}, + {"verbose", 0, NULL, 'X'}, + {"debug", 0, NULL, 'X'}, ++ {"device", 1, NULL, 'e'}, + {0,0,0,0}}; +- while((c = getopt_long(argc, argv, "f:l:r:d:D:schvVn", opt_list, NULL)) ++ while((c = getopt_long(argc, argv, "f:l:r:d:D:schvVne:", opt_list, NULL)) + != EOF) { + int argval = -1; /* handle parsed numbers for various arguments */ + float argfreq = -1; +@@ -220,6 +252,9 @@ void parse_command_line(int argc, char * + case 'X' : /* --debug / --verbose */ + result->verbose = 1; + break; ++ case 'e' : /* also --device */ ++ console_device = strdup(optarg); ++ break; + case 'h' : /* notice that this is also --help */ + default : + usage_bail(argv[0]); +@@ -238,24 +273,31 @@ void play_beep(beep_parms_t parms) { + parms.reps, parms.length, parms.delay, parms.end_delay, parms.freq); + + /* try to snag the console */ +- if((console_fd = open("/dev/tty0", O_WRONLY)) == -1) { +- if((console_fd = open("/dev/vc/0", O_WRONLY)) == -1) { +- fprintf(stderr, "Could not open /dev/tty0 or /dev/vc/0 for writing.\n"); +- printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ +- perror("open"); +- exit(1); +- } ++ if(console_device) ++ console_fd = open(console_device, O_WRONLY); ++ else ++ if((console_fd = open("/dev/tty0", O_WRONLY)) == -1) ++ console_fd = open("/dev/vc/0", O_WRONLY); ++ ++ if(console_fd == -1) { ++ fprintf(stderr, "Could not open %s for writing\n", ++ console_device != NULL ? console_device : "/dev/tty0 or /dev/vc/0"); ++ printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ ++ perror("open"); ++ exit(1); + } ++ ++ if (ioctl(console_fd, EVIOCGSND(0)) != -1) ++ console_type = BEEP_TYPE_EVDEV; ++ else ++ console_type = BEEP_TYPE_CONSOLE; + + /* Beep */ + for (i = 0; i < parms.reps; i++) { /* start beep */ +- if(ioctl(console_fd, KIOCSOUND, (int)(CLOCK_TICK_RATE/parms.freq)) < 0) { +- printf("\a"); /* Output the only beep we can, in an effort to fall back on usefulness */ +- perror("ioctl"); +- } ++ do_beep(parms.freq); + /* Look ma, I'm not ansi C compatible! */ + usleep(1000*parms.length); /* wait... */ +- ioctl(console_fd, KIOCSOUND, 0); /* stop beep */ ++ do_beep(0); /* stop beep */ + if(parms.end_delay || (i+1 < parms.reps)) + usleep(1000*parms.delay); /* wait... */ + } /* repeat. */ +@@ -318,5 +360,8 @@ int main(int argc, char **argv) { + parms = next; + } + ++ if(console_device) ++ free(console_device); ++ + return EXIT_SUCCESS; + } diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000..d9cc348 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1,6 @@ +01_makefile-fixup +02_verbose-option +03_multiple-freq +04_serial-console-fix +05_devfs-fix +06_event-option diff --git a/debian/po/ca.po b/debian/po/ca.po index 8f938bc..0352823 100644 --- a/debian/po/ca.po +++ b/debian/po/ca.po @@ -15,7 +15,7 @@ msgid "" msgstr "" "Project-Id-Version: ca\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" "PO-Revision-Date: 2006-06-21 08:40-0500\n" "Last-Translator: Miguel Gea Milvaques \n" diff --git a/debian/po/cs.po b/debian/po/cs.po index 9168c9b..6db6b70 100644 --- a/debian/po/cs.po +++ b/debian/po/cs.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: beep\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" "PO-Revision-Date: 2006-06-21 14:23+0200\n" "Last-Translator: Miroslav Kure \n" diff --git a/debian/po/de.po b/debian/po/de.po index e2303f1..eb05036 100644 --- a/debian/po/de.po +++ b/debian/po/de.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: beep 1.2.2-18\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" "PO-Revision-Date: 2006-06-21 05:07-0500\n" "Last-Translator: Gerfried Fuchs \n" diff --git a/debian/po/es.po b/debian/po/es.po index 9f84654..97f1182 100644 --- a/debian/po/es.po +++ b/debian/po/es.po @@ -28,7 +28,7 @@ msgid "" msgstr "" "Project-Id-Version: beep\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" "PO-Revision-Date: 2006-06-28 02:06-0500\n" "Last-Translator: David Martínez Moreno \n" diff --git a/debian/po/fr.po b/debian/po/fr.po index 35fca39..7598bf5 100644 --- a/debian/po/fr.po +++ b/debian/po/fr.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: beep 1.2.2-10\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" "PO-Revision-Date: 2006-06-28 02:06-0500\n" "Last-Translator: Daniel Déchelotte \n" diff --git a/debian/po/it.po b/debian/po/it.po index 9fcb1e4..09ee8ff 100644 --- a/debian/po/it.po +++ b/debian/po/it.po @@ -1,9 +1,9 @@ msgid "" msgstr "" "Project-Id-Version: beep 1.2.2-12\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" -"PO-Revision-Date: 2005-10-15 12:08+0100\n" +"PO-Revision-Date: 2007-10-03 19:01+0200\n" "Last-Translator: Stefano Melchior \n" "Language-Team: Italian \n" "MIME-Version: 1.0\n" @@ -54,6 +54,3 @@ msgstr "" "programma risulta abbastanza piccolo (circa 150 linee di codice) e semplice " "da permettere di verificare da soli la sicurezza del codice, qualora non ci " "si fidasse del giudizio dell'autore." - -#~ msgid "How do you want to handle suid root for the beep program?" -#~ msgstr "Come si vuole gestire suid root per il programma beep?" diff --git a/debian/po/ja.po b/debian/po/ja.po index 2fd31da..1f8ceae 100644 --- a/debian/po/ja.po +++ b/debian/po/ja.po @@ -15,9 +15,9 @@ msgid "" msgstr "" "Project-Id-Version: beep 1.2.2-18\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" -"PO-Revision-Date: 2006-10-11 00:08+0900\n" +"PO-Revision-Date: 2007-10-03 19:01+0200\n" "Last-Translator: Hideki Yamane (Debian-JP) \n" "Language-Team: Japanese \n" "MIME-Version: 1.0\n" @@ -67,6 +67,3 @@ msgstr "" "ではこの方法は採りません。しかしながら、このプログラムは非常に小さいので (150" "行程度のコードです)、私の判断を信じられない場合、あなた自身でコードの安全性" "を”確認するのはとても簡単です。" - -#~ msgid "How do you want to handle suid root for the beep program?" -#~ msgstr "beep プログラムへの suid root 設定をどうしますか?" diff --git a/debian/po/nl.po b/debian/po/nl.po index c154270..3516bfd 100644 --- a/debian/po/nl.po +++ b/debian/po/nl.po @@ -14,9 +14,9 @@ msgid "" msgstr "" "Project-Id-Version: beep 1.2.2-11\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" -"PO-Revision-Date: 2003-09-07 20:58+0100\n" +"PO-Revision-Date: 2007-10-03 19:02+0200\n" "Last-Translator: Tim Vandermeersch \n" "Language-Team: dutch \n" "MIME-Version: 1.0\n" @@ -66,7 +66,3 @@ msgstr "" "Omdat elk suid root programma een veiligheids risico is wordt dit niet " "standaard gedaan. Het programma is vrij klein (~150 regels code) en is " "redelijk makkelijk om zelf te verifiëren, als u mijn oordeel niet vertrouwd." - -#, fuzzy -#~ msgid "How do you want to handle suid root for the beep program?" -#~ msgstr "Hoe suid root af te handelen voor beep programma?" diff --git a/debian/po/pt.po b/debian/po/pt.po index a72aac8..932375c 100644 --- a/debian/po/pt.po +++ b/debian/po/pt.po @@ -4,7 +4,7 @@ msgid "" msgstr "" "Project-Id-Version: beep 1.2.2-16\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" "PO-Revision-Date: 2006-06-28 02:07-0500\n" "Last-Translator: Miguel Figueiredo \n" diff --git a/debian/po/pt_BR.po b/debian/po/pt_BR.po index 382b928..c81eda9 100644 --- a/debian/po/pt_BR.po +++ b/debian/po/pt_BR.po @@ -18,7 +18,7 @@ msgid "" msgstr "" "Project-Id-Version: beep-1.2.2-10\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" "PO-Revision-Date: 2006-06-28 02:06-0500\n" "Last-Translator: Felipe Augusto van de Wiel (faw) \n" "Language-Team: Russian \n" "MIME-Version: 1.0\n" @@ -66,7 +66,3 @@ msgstr "" "ÐÏÜÔÏÍÕ suid-ÂÉÔ ÐÏ ÕÍÏÌÞÁÎÉÀ ÎÅ ÕÓÔÁÎÁ×ÌÉ×ÁÅÔÓÑ. ïÄÎÁËÏ, ÐÒÏÇÒÁÍÍÁ " "ÉÓËÌÀÞÉÔÅÌØÎÏ ÍÁÌÁ (~150 ÓÔÒÏË ËÏÄÁ), É ÷Ù ÏÞÅÎØ ÌÅÇËÏ ÍÏÖÅÔÅ ÐÒÏ×ÅÒÉÔØ " "ÂÅÚÏÐÁÓÎÏÓÔØ ÅÅ ËÏÄÁ ÓÁÍÉ, ÅÓÌÉ ÎÅ ÄÏ×ÅÒÑÅÔÅ ÍÎÅ." - -#, fuzzy -#~ msgid "How do you want to handle suid root for the beep program?" -#~ msgstr "ëÁË ÏÂÒÁÂÏÔÁÔØ suid root ÄÌÑ ÐÒÏÇÒÁÍÍÙ beep?" diff --git a/debian/po/sv.po b/debian/po/sv.po index 96e1b37..3b11aa7 100644 --- a/debian/po/sv.po +++ b/debian/po/sv.po @@ -14,7 +14,7 @@ msgid "" msgstr "" "Project-Id-Version: beep\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" "PO-Revision-Date: 2006-06-21 12:49-0500\n" "Last-Translator: Daniel Nylander \n" diff --git a/debian/po/templates.pot b/debian/po/templates.pot index 9869bc1..46954c7 100644 --- a/debian/po/templates.pot +++ b/debian/po/templates.pot @@ -1,13 +1,13 @@ # SOME DESCRIPTIVE TITLE. # Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER -# This file is distributed under the same license as the PACKAGE package. +# This file is distributed under the same license as the beep package. # FIRST AUTHOR , YEAR. # #, fuzzy msgid "" msgstr "" -"Project-Id-Version: PACKAGE VERSION\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Project-Id-Version: beep 1.2.2-18\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" diff --git a/debian/po/vi.po b/debian/po/vi.po index b6ab358..d3e544b 100644 --- a/debian/po/vi.po +++ b/debian/po/vi.po @@ -5,7 +5,7 @@ msgid "" msgstr "" "Project-Id-Version: beep 1.2.2-18\n" -"Report-Msgid-Bugs-To: alfie@debian.org\n" +"Report-Msgid-Bugs-To: beep@packages.debian.org\n" "POT-Creation-Date: 2007-02-20 23:46+0100\n" "PO-Revision-Date: 2006-06-23 03:49-0500\n" "Last-Translator: Clytie Siddall \n" diff --git a/debian/rules b/debian/rules index 56cae22..ba09d0a 100755 --- a/debian/rules +++ b/debian/rules @@ -1,5 +1,7 @@ #!/usr/bin/make -f # debian/rules file for beep +# copyright 2002++ by Gerfried Fuchs +# Licenced the same way as beep itself PKG1 = beep TMP1 = $(CURDIR)/debian/$(PKG1) @@ -26,7 +28,9 @@ ifeq (,$(findstring nostrip,$(DEB_BUILD_OPTIONS))) endif -clean: +include /usr/share/quilt/quilt.make + +clean: unpatch $(checkdir) $(checkroot) -rm -rf $(TMP1) $(TMP2) debian/substvars debian/files build-stamp @@ -34,7 +38,7 @@ clean: build: build-stamp -build-stamp: +build-stamp: patch $(checkdir) $(MAKE) FLAGS="$(FLAGS)" touch build-stamp -- 2.39.2