File get-from-git.sh of Package imx93-devicetree

#!/bin/bash

LINUX_BRANCH=v6.14-rc4

# this is a huge hunk of stuff, so reuse the local repo if possible
if [ -d linux/.git ]; then
	set -e
	cd linux
	git remote update
	# Check we are on the right branch, otherwise clone the right one
	git checkout $LINUX_BRANCH || (cd .. && (echo "ERROR: Please remove the linux folder as we cannot switch to $LINUX_BRANCH branch"; exit 1) )
	cd ..
	set +e
else
	set -e
	git clone -b $LINUX_BRANCH --depth 1 --no-single-branch https://github.com/torvalds/linux.git
	set +e
fi

TOPDIR=$(pwd)

# Copy device tree files
SOURCES="COPYING arch/arm64/boot/dts/freescale/imx93* scripts/dtc/include-prefixes/ include"
cd linux
LINE=$(git log --format=format:"%h %ci" -- ${SOURCES}|head -n 1)
set -- $LINE
REV=$1
DATE=$2
VER=${DATE//-/.}
set -e
git archive --prefix=imx93-devicetree-$VER/ -o $TOPDIR/imx93-devicetree-${VER}.tar HEAD -- ${SOURCES}
cd ..
osc rm -f imx93-devicetree-*.tar.xz || true
xz --force imx93-devicetree-${VER}.tar
osc add imx93-devicetree-${VER}.tar.xz

sed -i "s/^Version:.*/Version:        $VER/" imx93-devicetree.spec
osc vc imx93-devicetree -m "Update to $REV ($DATE)"
sh pre_checkin.sh
openSUSE Build Service is sponsored by