numix-gtk-theme/scripts/utils.sh

93 lines
1.7 KiB
Bash
Raw Normal View History

#!/bin/bash
do_install() {
local GTKDIR GTK320DIR GTKVER INSTALL_DIR
INSTALL_DIR="$1"
GTKDIR="${INSTALL_DIR}/gtk-3.0"
GTK320DIR="${INSTALL_DIR}/gtk-3.20"
install -dm755 "${INSTALL_DIR}"
cd src
2016-09-18 11:01:08 +00:00
cp index.theme "${INSTALL_DIR}"
cp -rt "${INSTALL_DIR}" \
assets gtk-2.0 metacity-1 openbox-3 xfce-notify-4.0 xfwm4 unity
for _DIR in "${GTKDIR}" "${GTK320DIR}"
do
GTKVER="${_DIR##*/}"
mkdir "${_DIR}"
2016-09-18 11:01:08 +00:00
cp -t "${_DIR}" \
"${GTKVER}/gtk.css" \
"${GTKVER}/gtk-dark.css" \
"${GTKVER}/gtk.gresource" \
2016-09-18 11:01:08 +00:00
"${GTKVER}/thumbnail.png"
cd "${_DIR}"
ln -sr ../assets assets
2016-09-18 11:01:08 +00:00
cd -
done
}
output_changes_file_version_marker() {
line() {
dashes="$(printf '%0.s-' $(seq 1 13))"
echo "${dashes}>>>> $1 <<<<${dashes}"
}
tag_line="$(line $1)"
echo "-${tag_line}${tag_line}${tag_line}-"
}
update_changes_file() {
2016-10-23 00:29:07 +00:00
local LAST_STABLE_RELEASE NEXT_STABLE_RELEASE
LAST_STABLE_RELEASE=$(git describe --tags $(git rev-list --tags --max-count=1))
LAST_MAJOR_MINOR="${LAST_STABLE_RELEASE%.*}"
LAST_PATCH="${LAST_STABLE_RELEASE##*.}"
NEXT_PATCH=$(($LAST_PATCH + 1))
NEXT_STABLE_RELEASE="${LAST_MAJOR_MINOR}.${NEXT_PATCH}"
[[ -f CHANGES ]] && mv CHANGES CHANGES.old
2016-10-23 00:29:07 +00:00
output_changes_file_version_marker "${NEXT_STABLE_RELEASE}" > CHANGES
{ git log \
--pretty=format:"[%ai] %<(69,trunc) %s %><(15) %aN {%h}" \
2016-10-23 00:29:07 +00:00
--cherry-pick "${LAST_STABLE_RELEASE}...HEAD"; } >> CHANGES
[[ -f CHANGES.old ]] && echo "" >> CHANGES && cat CHANGES.old >> CHANGES && rm CHANGES.old
2016-10-23 00:29:07 +00:00
git add CHANGES
git commit -m 'RELEASE PREP :: Update CHANGES file.'
git push
}
case $1 in
changes)
update_changes_file
exit $?
;;
install)
do_install "$2"
;;
*)
exit 0
;;
esac