Add script to update spec files and push them to obs
This commit is contained in:
parent
350923509b
commit
5c188a9b53
|
@ -1,13 +1,33 @@
|
|||
#!/usr/bin/bash
|
||||
#!/bin/bash
|
||||
set -e # abort on first error
|
||||
shopt -s nullglob
|
||||
source versions.sh
|
||||
|
||||
for spec_file in "$OSC_DIR"/*/*/*.spec; do
|
||||
trimmed_path=${pkgbuild_file#$OSC_DIR/}
|
||||
project_name=${trimmed_path%%/*}
|
||||
trimmed_path=${spec_file#$OSC_DIR/*/*/}
|
||||
project_name=${trimmed_path%*.spec}
|
||||
spec_dir=${spec_file%/*}
|
||||
|
||||
# TODO
|
||||
# skip packages with unknown version
|
||||
version=${versions[$project_name]}
|
||||
[[ $version ]] || continue
|
||||
|
||||
echo "$trimmed_path -> $version"
|
||||
echo "NEXT: $project_name -> $version"
|
||||
echo '------------------------------------------------------------------------------------------'
|
||||
|
||||
# apply new version
|
||||
sed -i -e "s/Version: .*/Version: $version/" "$spec_file"
|
||||
chmod 644 "$spec_file"
|
||||
|
||||
# push changes with osc
|
||||
pushd "$spec_dir"
|
||||
if ! [[ -f ../update-osc-repo.sh ]]; then
|
||||
echo "skip updating osc repo for $project_name: update script not present in ${spec_dir%/*}"
|
||||
elif [[ $(osc diff) ]]; then
|
||||
../update-osc-repo.sh "Update to $version"
|
||||
echo "updated $project_name.spec -> $version"
|
||||
else
|
||||
echo "skip updating osc repo for $project_name: no changes made"
|
||||
fi
|
||||
popd
|
||||
done
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/bash
|
||||
#!/bin/bash
|
||||
set -e # abort on first error
|
||||
shopt -s nullglob
|
||||
source versions.sh
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e # fail on error
|
||||
|
||||
for d in c++utilities qtutilities passwordfile passwordmanager tagparser tageditor syncthingtray; do
|
||||
pushd $d
|
||||
tw
|
||||
popd
|
||||
done
|
|
@ -0,0 +1,33 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -e # fail on error
|
||||
|
||||
msg="$1"
|
||||
pkg="$2"
|
||||
|
||||
if [[ ! $msg ]]; then
|
||||
echo 'No commit message specified.'
|
||||
exit -2
|
||||
fi
|
||||
|
||||
[[ $pkg ]] && pushd "$pkg"
|
||||
|
||||
if [[ $(osc status) == "" ]]; then
|
||||
echo 'No local changes to check in.'
|
||||
exit -3
|
||||
fi
|
||||
|
||||
[ ! -f *.changes ] && no_changes_yet=1
|
||||
|
||||
if ! [[ $NO_DOWNLOAD ]]; then
|
||||
osc rm *.tar.gz
|
||||
osc service localrun download_files
|
||||
osc add *.tar.gz
|
||||
fi
|
||||
osc service localrun format_spec_file
|
||||
osc vc -m "$1"
|
||||
[[ $no_changes_yet ]] && osc add *.changes
|
||||
osc ci -m "$1"
|
||||
|
||||
[[ $pkg ]] && popd
|
||||
exit 0
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/bash
|
||||
#!/bin/bash
|
||||
set -e # abort on first error
|
||||
shopt -s nullglob
|
||||
source versions.sh
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/bash
|
||||
#!/bin/bash
|
||||
set -e # abort on first error
|
||||
shopt -s nullglob
|
||||
source versions.sh
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
#!/usr/bin/bash
|
||||
#!/bin/bash
|
||||
declare -A versions=(
|
||||
[c++utilities]=4.13.0
|
||||
[qtutilities]=5.9.0
|
||||
|
|
Loading…
Reference in New Issue