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
20 changes: 10 additions & 10 deletions overlay-debs/mesa-snapshot/mesa-snapshot.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,26 +8,26 @@ COMMIT=${COMMIT:-origin/main}
set -e

DEB_FILE=${DSC_FILE%%.dsc}.debian.tar.xz
ORIG_FILE=$(echo ${DSC_FILE} | sed -e 's/-.*/.orig.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/}
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.

Copy link
Contributor

Choose a reason for hiding this comment

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

Yup, shellcheck doesn't know that, so it asks to quote everything by default, but we can add an override to tell it to ignore this particular line; I think it's cheaper to add the double quotes personally, even if it's a bit more verbose

Copy link
Contributor

Choose a reason for hiding this comment

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

See my general comment on lint tools and CI. The compromise is that even though it's not necessary, it's not wrong, so this is fine as-is. That way we can have a linter and CI, which is better for our culture overall.


date=$(git log -1 --format=%cd --date=format:%Y%m%d ${COMMIT})
subject=$(git log -1 --format="%h (\"%s\")" ${COMMIT})
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}
rm -rf ../mesa-"${version}"
mkdir ../mesa-"${version}"
git archive --format=tar HEAD | tar x -C ../mesa-"${version}"

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

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

cat >> debian/changelog.tmp << EOF
mesa (${version}-0qcom1) experimental; urgency=medium
Expand All @@ -49,4 +49,4 @@ debian/rules gentarball

rm -rf ../mesa

rm ${DSC_FILE} ${DEB_FILE} ${ORIG_FILE}*
rm "${DSC_FILE}" "${DEB_FILE}" "${ORIG_FILE}"*
Loading