UPD zipdepot script to increment version

This commit is contained in:
Thomas Kuschel 2024-05-26 01:26:13 +02:00
parent 82cec820d3
commit b31d6faa46
3 changed files with 46 additions and 28 deletions

View File

@ -7,7 +7,7 @@
<license>GPL v2 +; see LICENSE.md</license> <license>GPL v2 +; see LICENSE.md</license>
<authorEmail>thomas@kuschel.at</authorEmail> <authorEmail>thomas@kuschel.at</authorEmail>
<authorUrl>https://kuschel.at</authorUrl> <authorUrl>https://kuschel.at</authorUrl>
<version>0.9.14</version> <version>0.9.35</version>
<description>COM_DEPOT_XML_DESCRIPTION</description> <description>COM_DEPOT_XML_DESCRIPTION</description>
<namespace path="src/">KW4NZ\Component\Depot</namespace> <namespace path="src/">KW4NZ\Component\Depot</namespace>
<install> <!-- Runs on install --> <install> <!-- Runs on install -->
@ -44,36 +44,16 @@
--> -->
<menu img="class:barcode">COM_DEPOT_MENU</menu> <menu img="class:barcode">COM_DEPOT_MENU</menu>
<submenu> <submenu>
<menu <menu link="option=com_depot" view="parts" img="class:depot" alt="Depot/Parts">
link="option=com_depot"
view="parts"
img="class:depot"
alt="Depot/Parts"
>
COM_DEPOT_MENU COM_DEPOT_MENU
</menu> </menu>
<menu <menu link="option=com_depot&amp;view=stocks" view="stocks" img="class:depot-stock" alt="Depot/Stocks">
link="option=com_depot&amp;view=stocks"
view="stocks"
img="class:depot-stock"
alt="Depot/Stocks"
>
COM_DEPOT_MENU_STOCKS COM_DEPOT_MENU_STOCKS
</menu> </menu>
<menu <menu link="option=com_depot&amp;view=manufacturers" view="manufacturers" img="class:depot-manufacturer" alt="Depot/Manufacturers">
link="option=com_depot&amp;view=manufacturers"
view="manufacturers"
img="class:depot-manufacturer"
alt="Depot/Manufacturers"
>
COM_DEPOT_MENU_MANUFACTURERS COM_DEPOT_MENU_MANUFACTURERS
</menu> </menu>
<menu <menu link="option=com_depot&amp;view=packages" view="packages" img="class:depot-package" alt="Depot/Packages">
link="option=com_depot&amp;view=packages"
view="packages"
img="class:depot-package"
alt="Depot/Packages"
>
COM_DEPOT_MENU_PACKAGES COM_DEPOT_MENU_PACKAGES
</menu> </menu>
</submenu> </submenu>

View File

@ -3,5 +3,43 @@
# this is a script file to generate a zip package from this source: # this is a script file to generate a zip package from this source:
cd "$(dirname "$0")" cd "$(dirname "$0")"
cd .. cd ..
# now we are at the depot directory
# if there is a file named depot.xml, we ask to increase the version with
read -p "Do you want to update/increase the patch (last) version number? (y/N)" -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ ^[YyJj]$ ]]
then
echo "Updating the version"
patch=`xmllint -xpath 'string(//*[local-name()="version"])' depot.xml | rev | cut -f1 -d. | rev`
echo "$patch"
patch=$((patch+1))
echo "$patch"
version=`xmllint -xpath 'string(//*[local-name()="version"])' depot.xml`
major=`echo "$version" | cut -f1 -d.`
minor=`echo "$version" | cut -f2 -d.`
patch=`echo "$version" | cut -f3 -d.`
echo "$version"
patch=$((patch+1))
minor=$((minor))
newversion="$major.$minor.$patch"
echo "$newversion"
#xml=$(xmllint --shell depot.xml << EOF
#-xpath 'string(//*[local-name()="version"]'
#set 1.2.3
#save -
#EOF
#)
xmllint --shell depot.xml << EOF
cd extension/version
set $newversion
save
EOF
else
echo "Keep the version"
fi
mkdir -p zip mkdir -p zip
zip -r zip/depot.zip * -x .git/\* -x script/\* -x zip/\* zip -q -r zip/depot.zip * -x .git/\* -x script/\* -x zip/\*

BIN
zip/depot.zip (Stored with Git LFS)

Binary file not shown.