xref: /aosp_15_r20/external/crosvm/tools/chromeos/uprev_ebuilds (revision bb4ee6a4ae7042d18b07a98463b9c8b875e44b39)
1#!/bin/sh
2# Copyright 2021 The ChromiumOS Authors
3# Use of this source code is governed by a BSD-style license that can be
4# found in the LICENSE file.
5#
6# Uprev ebuild files of crosvm (and related packages) to the currently checked
7# out commit.
8# This uses the same process that PUpr is using when generating uprev CLs.
9
10cd $(dirname $0)
11
12CHROMITE_DIR=../../../../../chromite
13if ! [ -e "${CHROMITE_DIR}" ]; then
14    echo "Run from ChromeOS checkout."
15    exit 1
16fi
17
18IN=$(mktemp)
19OUT=$(mktemp)
20
21echo '{
22    "package_info": {
23        "category": "chromeos-base",
24        "package_name": "crosvm"
25    },
26    "versions": [
27        {
28            "repository": "dummy",
29            "ref": "dummy",
30            "revision": "dummy"
31        }
32    ]
33}' >> "${IN}"
34
35${CHROMITE_DIR}/bin/build_api \
36    --input-json "${IN}" \
37    --output-json "${OUT}" \
38    chromite.api.PackageService/UprevVersionedPackage
39
40cat "${OUT}"
41
42rm "${IN}"
43rm "${OUT}"
44