Skip to content

Add mesa snapshot overlay #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
57 changes: 57 additions & 0 deletions overlay-debs/mesa-snapshot/mesa-snapshot.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#! /bin/sh
#
# Copyright (c) Qualcomm Technologies, Inc. and/or its subsidiaries.
# SPDX-License-Identifier: BSD-3-Clause

COMMIT=${COMMIT:-origin/main}

set -e

# Reported by shellcheck: SC2153 (info): Possible misspelling: DSC_FILE may not
# be assigned. Did you mean DEB_FILE?
#
# DSC_FILE is guaranteed to be defined as part of the call API from build-deb.py
# shellcheck disable=SC2153
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NAK, don't add extra noise.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just removing it will cause it to fail CI. Please clarify how you want me to fix it instead.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then please fix the CI. Adding 5 lines of comments, including the tools output, just to make it ignore a variable name in the script is definitely an overkill.

DEB_FILE=${DSC_FILE%%.dsc}.debian.tar.xz
ORIG_FILE=$(echo "${DSC_FILE}" | sed -e 's/-.*/.orig.tar.xz/')

rm -rf mesa
git clone --depth 1 https://gitlab.freedesktop.org/mesa/mesa

cd mesa
git fetch --depth 1 origin "${COMMIT##origin/}"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't need to quote all the variables. Only the variables that might have whitespaces or might be empty need to be quoted.


date=$(git log -1 --format=%cd --date=format:%Y%m%d "${COMMIT}")
subject=$(git log -1 --format="%h (\"%s\")" "${COMMIT}")
version=25.2.0~git${date}

rm -rf ../mesa-"${version}"
mkdir ../mesa-"${version}"
git archive --format=tar HEAD | tar x -C ../mesa-"${version}"

cd ../mesa-"${version}"

rm -rf debian
tar xJf "${DEB_FILE}"

cat >> debian/changelog.tmp << EOF
mesa (${version}-0qcom1) experimental; urgency=medium

* Build git version from ${date}, commit ${subject}

-- Dmitry Baryshkov <dmitry.baryshkov@oss.qualcomm.com> Wed, 11 Jun 2025 14:58:50 +0300

EOF
cat debian/changelog >> debian/changelog.tmp
mv debian/changelog.tmp debian/changelog

# orig.tar.xz generation skips all .git* files, drop them from the source dir too.
rm -rf .git*

debian/rules regen_control
debian/rules clean
debian/rules gentarball

rm -rf ../mesa

rm "${DSC_FILE}" "${DEB_FILE}" "${ORIG_FILE}"*
7 changes: 7 additions & 0 deletions overlay-debs/mesa-snapshot/mesa-snapshot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
dsc_url: "https://snapshot.debian.org/archive/debian/20250519T203618Z/pool/main/m/mesa/mesa_25.1.0-1.dsc"
dsc_sha256sum: "d06c1b0ee300f096de2ac59a2e9583349ca79322612f4502baa5e78ff0be4290"
debdiff_file: "mesa_25.2.0.debdiff"
script: mesa-snapshot.sh
suite: trixie
env:
COMMIT: de1ce0f75e98f6fcdc8b7a7b495f54a2060a5896
Loading