Your message dated Sun, 15 Dec 2013 12:41:30 +0000
with message-id <[email protected]>
and subject line Bug#671342: Removed package(s) from unstable
has caused the Debian Bug report #455074,
regarding Utility to determine currently active vt
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact [email protected]
immediately.)


-- 
455074: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=455074
Debian Bug Tracking System
Contact [email protected] with problems
--- Begin Message ---
Package: console-tools
Version: 1:0.2.3dbs-65
Severity: wishlist

The `chvt' utility takes a numeric argument and activates the
specified virtual terminal.

Suppose I want to temporarily activate a specific vt for a special
purpose, and then switch back to the previously active one when I've
finished. In order to do this, I first need to find out what the
_currently_ active vt is, then chvt to the new one, and finally chvt
back to the original one. So I need a program which will tell me
what the currently active vt is.

A quick search with `apropos' was unable to find such a program, and
console-tools in particular doesn't seem to contain one, which seems
odd because it struck me as an obvious thing to want (it is to
`read' as chvt is to `write') and because it's trivially implemented
by an existing ioctl.

Accordingly, I've written it, by hacking on a copy of chvt.c. I
attach the resulting source file, `whichvt.c', which ought to be
easy to slot into the existing console-tools source framework (in
the vttools subdirectory, alongside chvt.c). I'm afraid I didn't get
sufficiently to grips with the Debian packaging mechanism to be able
to prepare a full update to the source package.

I hope you'll consider incorporating this utility into a future
version of the console-tools package. (Of course, feel free to pass
it upstream if you think that's more sensible.)

Cheers,
Simon
-- 
Simon Tatham         "My heart bleeds.
<[email protected]>    (That's how it works.)"   -- Gareth Taylor
/*
 * whichvt.c - sgt - 2007-12-08 - detect current virtual terminal
 */
#include <stdio.h>
#include <stdlib.h>
#include <fcntl.h>
#include <sys/types.h>
#include <sys/ioctl.h>
#include <linux/vt.h>
#include <getopt.h>

#include <lct/local.h>
#include <lct/utils.h>
#include <lct/console.h>

static void usage(char *progname)
{
  printf(_("Usage: %s\n"
	   "Find number of current virtual terminal\n"), progname);
  OPTIONS_ARE();
  OPT("-h --help         ", HELPDESC);
  OPT("-V --version      ", VERSIONDESC);
}

void parse_args (int argc,char **argv) 
{
  char * progname = strip_path(argv[0]);
  const struct option long_opts[] = {
    {"help"  , no_argument, NULL, 'h' },
    {"version", no_argument, NULL, 'V' },
    { NULL, 0, NULL, 0}
  };
  int c, cons = -1;
  while ( (c = getopt_long (argc, argv, "Vht:", long_opts, NULL)) != EOF) {
    switch (c) {
    case 'h':
      usage(progname);
      exit(0);
    case 'V':
      version(progname);
      exit(0);
    case '?':
    default:
      usage(progname);
      exit(1);            
    }
  }
  if (argc != optind) {
    fprintf(stderr,_("%s: Wrong number of args\n"), progname);
    exit(1);
  }
}

int main(int argc, char *argv[]) 
{
  int fd, num;
  struct vt_stat stat;

  setuplocale();
  
  parse_args (argc, argv);

  if (-1 == (fd = get_console_fd(NULL))) exit (1);
  
  if (ioctl(fd, VT_GETSTATE, &stat)) {
    perror("chvt: VT_GETSTATE");
    exit(1);
  }
  printf("%d\n", stat.v_active);
  exit(0);
}

--- End Message ---
--- Begin Message ---
Version: 2:0.2.3-73+rm

Dear submitter,

as the package console-tools has just been removed from the Debian archive
unstable we hereby close the associated bug reports.  We are sorry
that we couldn't deal with your issue properly.

For details on the removal, please see http://bugs.debian.org/671342

The version of this package that was in Debian prior to this removal
can still be found using http://snapshot.debian.org/.

This message was generated automatically; if you believe that there is
a problem with it please contact the archive administrators by mailing
[email protected].

Debian distribution maintenance software
pp.
Joerg Jaspert (the ftpmaster behind the curtain)

--- End Message ---

Reply via email to