Files
LFSPkgBuilds/Updating/UpdateScriptVersion
2021-04-20 13:49:32 +01:00

42 lines
851 B
Bash
Executable File

#!/bin/bash -e
#©keithhedger Tue 10 Mar 20:17:55 GMT 2015 kdhedger68713@gmail.com
if [ -e ./SystemData ];then
. ./SystemData
else
echo "No SystemData file found ..."
exit 0
fi
NAME=${1%-?*}
if [ "X$NAME" = "X" ];then
echo "Need name and version of form xxx-0.0.0 ..."
exit 1
fi
VERS=${1##?*-}
if [ "X$VERS" = "X" ];then
echo "Need name and version of form xxx-0.0.0 ..."
exit 1
fi
if [ "X$VERS" = "X$NAME" ];then
echo "Need name and version of form xxx-0.0.0 ..."
exit 1
fi
FILE=$(find ${LFS}/LFSPkgBuildScripts -iname "$NAME.LFSBuild")
if [ "X$FILE" = "X" ];then
echo "No LFSBuild script with that name ..."
exit 1
fi
if [ X$FILE != "X" ];then
sed -i "s/^VERSION=\".*\"/VERSION=\"$VERS\"/" $FILE
fi
while read
do
sed -r -i "s/\b${NAME}-[0-9\.]+\b/${1}/ig" ${REPLY}
done < <(find ${LFS}/LFSPkgBuildScripts -iname "*.LFSBuild")