Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 04d66438eb
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

executable file 194 lines (170 sloc) 5.769 kb
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
#!/bin/bash


# Common script for setting variables

export MAIN_DIST="quantal"
export UBUNTU_SFX="~${MAIN_DIST}1"

if [ -z "${SFX}" ]; then
export SFX="-0ppa1"
fi

export PKG_DIR="${MAIN_DIR}/Launchpad/${PACKAGE}"
export TEMP_DIR="${PKG_DIR}/TEMP"
export TEST_DIR="${TEMP_DIR}/TEST"

cd "${PKG_DIR}/${PACKAGE}-debian" || exit 1
git checkout launchpad 2> /dev/null || exit 1

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
if [ -z "$(echo ${OLD_VER_FULL} | grep ppa)" ]; then
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/")
    else
export OLD_VER=$(echo ${OLD_VER_FULL} | sed -e "s/^\(.*\)-[0-9]*ppa.*$/\1/")
        export OLD_SFX=$(echo ${OLD_VER_FULL} | sed -e "s/^.*\(-[0-9]*ppa[0-9]*\).*$/\1/")
    fi
}


# 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}" != "-0ppa1" ]; then
echo "Now SFX = ${SFX} but must be '-0ppa1' for a new release!";
                exit 0;
            fi
else
if [ "${SFX}" = "-0ppa1" ]; 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}" != "-0ppa1" ]; then
echo "Now SFX = ${SFX} but must be '-0ppa1' for a new release!";
                exit 0;
            fi
else
if [ "${SFX}" = "-0ppa1" ]; then
echo "Upgrading is not required.";
                exit 0;
            fi
fi
fi
}

Something went wrong with that request. Please try again.