Announcement

Collapse
No announcement yet.

ubuntu-distro-info

Collapse
This topic is closed.
X
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    ubuntu-distro-info

    There's an OPTION for this command: --date=DATE

    But the Help doesn't prescribe how you provide DATE. There are no examples.
    Using Kubuntu Linux since March 23, 2007
    "It is a capital mistake to theorize before one has data." - Sherlock Holmes

    #2
    It has to be YYYY-MM-DD, except that leading zeros may be omitted.

    In case anyone wants to know why I say that...
    Code:
    $ apt-file find ubuntu-distro-info
    distro-info: /usr/bin/ubuntu-distro-info  
    distro-info: /usr/share/man/man1/ubuntu-distro-info.1.gz
    $ apt-get source distro-info
    ....
    $ cd distro-info-1.0
    I saw that it's a C programme, so I looked for main and found it in distro-info-util.c, and in its option processing:
    Code:
            case 'D':
                ...
                i = sscanf(optarg, "%u-%u-%u", &date->year, &date->month, &date->day);
    so it has to be year-month-day, all numbers. At another point I found it subtracts 1900 from the year, so the year must include the century. If you leave it out, the year is in the first century CE and says its data is "outdated".

    A weird consequence of that sscanf format is that month and day don't need leading zeros, so 2022-1-1 is accepted.
    Regards, John Little

    Comment


      #3
      Thank you!
      Using Kubuntu Linux since March 23, 2007
      "It is a capital mistake to theorize before one has data." - Sherlock Holmes

      Comment

      Working...
      X