Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
tree: bd104008bb
Fetching contributors…

Cannot retrieve contributors at this time

executable file 189 lines (165 sloc) 5.603 kb
#!/bin/bash
# Common script for setting variables
if [ -z "${SFX}" ]; then
export SFX="-1"
fi
export MAIN_DIR="${HOME}/WorkDir/Devel/deb_packages"
export PKG_DIR="${MAIN_DIR}/Debian/${PACKAGE}"
export TEMP_DIR="${PKG_DIR}/TEMP"
export TEST_DIR="${TEMP_DIR}/TEST"
cd "${PKG_DIR}/${PACKAGE}-debian" || exit 1
#git checkout master 2> /dev/null || exit 1
# Situation is now much complicated.
mkdir -p "${TEMP_DIR}"
cd "${TEMP_DIR}" || exit 1
# Get old version
GetOldVersion()
{
if [ -z "${EPOCH}" ]; then
export OLD_VER_FULL=$(head -n 1 "${PKG_DIR}/${PACKAGE}-debian/debian/changelog" | sed -e "s/.* (\(.*\)) .*/\1/")
else
export OLD_VER_FULL=$(head -n 1 "${PKG_DIR}/${PACKAGE}-debian/debian/changelog" | sed -e "s/.* (${EPOCH}\(.*\)) .*/\1/")
fi
export OLD_VER=$(echo ${OLD_VER_FULL} | sed -e "s/^\(.*\)-[0-9]*$/\1/")
export OLD_SFX=$(echo ${OLD_VER_FULL} | sed -e "s/^.*\(-[0-9]*\)$/\1/")
}
# Display versions
DisplayVersions()
{
echo ;
echo "${1}"
echo ;
echo "On $(echo \"${1}\" | cut -f 3 -d /) now available such versions:"
echo "${VER_LIST}" | sort -r -V | head -n10
echo ;
echo "OLD_VER = ${OLD_VER}"
echo "NEW_VER = ${NEW_VER}"
echo "OLD_VER_FULL = ${EPOCH}${OLD_VER_FULL}"
echo "NEW_VER_FULL = ${EPOCH}${NEW_VER_FULL}"
echo ;
}
# Display versions for unstable packages
DisplayVersionsUnstable()
{
echo "Old commit: ${OLD_COMMIT}"
echo "Last commit: ${LAST_COMMIT}"
echo "OLD_VER_FULL = ${EPOCH}${OLD_VER_FULL}"
echo "NEW_VER_FULL = ${EPOCH}${NEW_VER_FULL}"
}
# Print versions
PrintVersions()
{
if [ "${1}" = "print-versions" ]; then
if [ -z "${2}" ]; then
echo "File name must be not empty!"
exit 1
else
HTML_FILE="${2}"
echo "<td style=\"font-weight: bold;\">" >> "${HTML_FILE}"
echo "${PACKAGE}" >> "${HTML_FILE}"
echo "</td>" >> "${HTML_FILE}"
echo "<td>" >> "${HTML_FILE}"
echo "${EPOCH}${OLD_VER_FULL}" >> "${HTML_FILE}"
echo "</td>" >> "${HTML_FILE}"
if [ "${NEW_VER}" != "${OLD_VER}" ]; then
if ( dpkg --compare-versions "${NEW_VER}" gt "${OLD_VER}" ); then
echo "<td class=\"color-outdated\">" >> "${HTML_FILE}"
else
echo "<td class=\"color-newer\">" >> "${HTML_FILE}"
fi
else
echo "<td class=\"color-actual\">" >> "${HTML_FILE}"
fi
echo "${EPOCH}${NEW_VER_FULL}" >> "${HTML_FILE}"
echo "</td>" >> "${HTML_FILE}"
echo "<td>" >> "${HTML_FILE}"
echo "<a href=\"http://packages.qa.debian.org/${PACKAGE}\">PTS</a>" >> "${HTML_FILE}"
echo "<a href=\"https://launchpad.net/ubuntu/+source/${PACKAGE}\">LP</a>" >> "${HTML_FILE}"
echo "</td>" >> "${HTML_FILE}"
exit 0
fi
fi
}
# Print versions for unstable packages
PrintVersionsUnstable()
{
if [ "${1}" = "print-versions" ]; then
if [ -z "${2}" ]; then
echo "File name must be not empty!"
exit 1
else
HTML_FILE="${2}"
echo "<td style=\"font-weight: bold;\">" >> "${HTML_FILE}"
echo "${PACKAGE}" >> "${HTML_FILE}"
echo "</td>" >> "${HTML_FILE}"
echo "<td>" >> "${HTML_FILE}"
echo "${EPOCH}${OLD_VER_FULL}" >> "${HTML_FILE}"
echo "</td>" >> "${HTML_FILE}"
if [ "${LAST_COMMIT}" != "${OLD_COMMIT}" ]; then
echo "<td class=\"color-outdated\">" >> "${HTML_FILE}"
else
echo "<td class=\"color-actual\">" >> "${HTML_FILE}"
fi
echo "${EPOCH}${NEW_VER_FULL}" >> "${HTML_FILE}"
echo "</td>" >> "${HTML_FILE}"
echo "<td>" >> "${HTML_FILE}"
echo "<a href=\"http://packages.qa.debian.org/${PACKAGE}\">PTS</a>" >> "${HTML_FILE}"
echo "<a href=\"https://launchpad.net/ubuntu/+source/${PACKAGE}\">LP</a>" >> "${HTML_FILE}"
echo "</td>" >> "${HTML_FILE}"
exit 0
fi
fi
}
# Check versions
CheckVersions()
{
if [ -z "${NEW_VER}" ]; then
echo "NEW_VER is empty!";
exit 1;
elif [ -z "${EPOCH}${OLD_VER_FULL}" ]; then
echo "OLD_VER_FULL is empty!";
exit 1;
elif [ "${EPOCH}${NEW_VER_FULL}" = "${EPOCH}${OLD_VER_FULL}" ]; then
echo "Upgrading is not required.";
exit 0;
else
if [ "${NEW_VER}" != "${OLD_VER}" ]; then
if [ "${SFX}" != "-1" ]; then
echo "Now SFX = ${SFX} but must be '-1' for a new release!";
exit 0;
fi
else
if [ "${SFX}" = "-1" ]; then
echo "Now SFX = ${SFX} but OLD_SFX = ${OLD_SFX}.";
echo "Upgrading is not required.";
exit 0;
fi
fi
fi
}
# Check versions for unstable packages
CheckVersionsUnstable()
{
if [ -z "${OLD_COMMIT}" ]; then
echo "OLD_COMMIT is empty!";
exit 1;
elif [ -z "${LAST_COMMIT}" ]; then
echo "LAST_COMMIT is empty!";
exit 1;
elif [ -z ${CUR_VER} ]; then
echo "CUR_VER is empty!";
exit 1;
else
if [ "${LAST_COMMIT}" != "${OLD_COMMIT}" ]; then
if [ "${SFX}" != "-1" ]; then
echo "Now SFX = ${SFX} but must be '-1' for a new release!";
exit 0;
fi
else
if [ "${SFX}" = "-1" ]; then
echo "Upgrading is not required.";
exit 0;
fi
fi
fi
}
Jump to Line
Something went wrong with that request. Please try again.