Skip to content

Instantly share code, notes, and snippets.

View julian-klode's full-sized avatar

Julian Andres Klode julian-klode

View GitHub Profile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@julian-klode
julian-klode / apt-cli-version.md
Last active July 22, 2025 20:44
APT CLI versioning mechanism

APT 3.1.x introduces a new behavior versioning mechanism, providing primarily stable command-line interfaces for scripting.

Version specification

The CLI version can be specified using --cli-version A[.B][.C].

If the B component is missing, the highest even B currently supported is selected. For example, --cli-version 3 will select 3.2 but not 3.3 in APT 3.3.x, as odd versions are development series.

If the C component is missing, all possible values are allowed.

/*
* APT daemon - Listing packages
*
* SPDX-License-Identifier: GPL-2.0+
*/
#include <memory>
#include <optional>
#include <string>
#include <variant>
using uint16_t = unsigned short;
using uint64_t = unsigned long long;
static_assert(sizeof(uint16_t) == 2);
static_assert(sizeof(uint64_t) == 8);
struct priority {
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
uint16_t padding;
uint16_t dynamic;
#include <cstdint>
#include <tuple>
struct priority {
uint16_t padding;
uint16_t dynamic;
uint16_t staticp;
uint16_t index;
bool operator<(const priority &other) const;
#include <cstdint>
#include <tuple>
struct priority {
uint16_t padding;
uint16_t dynamic;
uint16_t staticp;
uint16_t index;
bool operator<(const priority &other) const;
#include <cstdint>
#include <tuple>
struct priority {
uint16_t padding;
uint16_t dynamic;
uint16_t staticp;
int16_t index;
bool operator<(const priority &other) const;