diff --git a/mythtv/programs/mythfrontend/themechooser.cpp b/mythtv/programs/mythfrontend/themechooser.cpp
index 0dd292c..56d6d66 100644
|
a
|
b
|
void ThemeChooser::Load(void)
|
| 151 | 151 | { |
| 152 | 152 | SetBusyPopupMessage(tr("Loading Installed Themes")); |
| 153 | 153 | |
| 154 | | QString MythVersion = MYTH_SOURCE_PATH; |
| 155 | | |
| 156 | | // Treat devel branches as master |
| 157 | | if (!MythVersion.isEmpty() && !MythVersion.startsWith("fixes/")) |
| 158 | | // FIXME: For now, treat git master the same as svn trunk |
| 159 | | MythVersion = "trunk"; |
| 160 | | |
| 161 | 154 | QStringList themesSeen; |
| 162 | 155 | QDir themes(m_userThemeDir); |
| 163 | 156 | themes.setFilter(QDir::Dirs | QDir::NoDotAndDotDot); |
| … |
… |
void ThemeChooser::Load(void)
|
| 191 | 184 | } |
| 192 | 185 | } |
| 193 | 186 | |
| | 187 | // MYTH_SOURCE_VERSION - examples v29-pre-574-g92517f5, v29-Pre, v29.1-21-ge26a33c |
| | 188 | QString MythVersion(MYTH_SOURCE_VERSION); |
| | 189 | QRegExp trunkver("v[0-9]+-pre.*",Qt::CaseInsensitive); |
| | 190 | QRegExp validver("v[0-9]+.*",Qt::CaseInsensitive); |
| | 191 | |
| | 192 | if (!validver.exactMatch(MythVersion)) |
| | 193 | { |
| | 194 | LOG(VB_GENERAL, LOG_ERR, QString("Invalid MythTV version %1, will use themes from trunk").arg(MythVersion)); |
| | 195 | MythVersion = "trunk"; |
| | 196 | } |
| | 197 | if (trunkver.exactMatch(MythVersion)) |
| | 198 | MythVersion = "trunk"; |
| | 199 | |
| 194 | 200 | if (MythVersion == "trunk") |
| 195 | 201 | { |
| 196 | 202 | LoadVersion(MythVersion, themesSeen, true); |
| … |
… |
void ThemeChooser::Load(void)
|
| 200 | 206 | { |
| 201 | 207 | |
| 202 | 208 | MythVersion = MYTH_BINARY_VERSION; // Example: 29.20161017-1 |
| | 209 | // Remove the date part and the rest, eg 29.20161017-1 -> 29 |
| 203 | 210 | MythVersion.replace(QRegExp("\\.[0-9]{8,}.*"), ""); |
| 204 | 211 | LOG(VB_GUI, LOG_INFO, QString("Loading themes for %1").arg(MythVersion)); |
| 205 | 212 | LoadVersion(MythVersion, themesSeen, true); |
| 206 | 213 | |
| 207 | 214 | // If a version of the theme for this tag exists, use it... |
| | 215 | // MYTH_SOURCE_VERSION - examples v29-pre-574-g92517f5, v29-Pre, v29.1-21-ge26a33c |
| 208 | 216 | QRegExp subexp("v[0-9]+\\.([0-9]+)-*"); |
| | 217 | // This captures the subversion, i.e. the number after a dot |
| 209 | 218 | int pos = subexp.indexIn(MYTH_SOURCE_VERSION); |
| 210 | 219 | if (pos > -1) |
| 211 | 220 | { |
diff --git a/mythtv/version.sh b/mythtv/version.sh
index 37e42f1..3ffd4ee 100755
|
a
|
b
|
|
| 3 | 3 | # small shell script to generate version.h |
| 4 | 4 | # it expects one parameter |
| 5 | 5 | # first parameter is the root of the source directory |
| 6 | | |
| 7 | 6 | if test $# -ne 1; then |
| 8 | 7 | echo "Usage: version.sh GIT_TREE_DIR" |
| 9 | 8 | exit 1 |
| … |
… |
case "${SOURCE_VERSION}" in
|
| 29 | 28 | exported|Unknown) |
| 30 | 29 | if ! grep -q Format $GITTREEDIR/EXPORTED_VERSION; then |
| 31 | 30 | . $GITTREEDIR/EXPORTED_VERSION |
| | 31 | # This file has SOURCE_VERSION and BRANCH |
| | 32 | # example SOURCE_VERSION="30d8a96" |
| | 33 | # BRANCH examples from github |
| | 34 | # BRANCH=" (HEAD -> master)" |
| | 35 | # BRANCH=" (fixes/0.28)" |
| | 36 | # BRANCH=" (tag: v0.28.1)" |
| | 37 | # From a checkout they can be as follows: |
| | 38 | # " (origin/fixes/0.28, fixes/0.28)" |
| | 39 | # " (HEAD -> master, origin/master, origin/HEAD)" |
| | 40 | # " (tag: v0.28.1)" |
| | 41 | hash="$SOURCE_VERSION" |
| | 42 | # This extracts after the last comma inside the parens: |
| 32 | 43 | BRANCH=$(echo "${BRANCH}" | sed 's/ (\(.*, \)\{0,1\}\(.*\))/\2/') |
| | 44 | # Create a suitable version (hash is no good) |
| | 45 | SOURCE_VERSION="$BRANCH" |
| | 46 | SOURCE_VERSION=`echo "$SOURCE_VERSION" | sed "s/tag: *//"` |
| | 47 | if ! echo "$SOURCE_VERSION" | grep "^v[0-9]" ; then |
| | 48 | . $GITTREEDIR/VERSION |
| | 49 | fi |
| | 50 | SOURCE_VERSION="${SOURCE_VERSION}-${hash}" |
| | 51 | echo "Source Version created as $SOURCE_VERSION" |
| 33 | 52 | elif test -e $GITTREEDIR/VERSION ; then |
| 34 | 53 | . $GITTREEDIR/VERSION |
| 35 | 54 | fi |
| … |
… |
case "${SOURCE_VERSION}" in
|
| 41 | 60 | ;; |
| 42 | 61 | esac |
| 43 | 62 | |
| | 63 | if ! echo "${SOURCE_VERSION}" | egrep -i "v[0-9]+.*" ; then |
| | 64 | # Invalid version - use VERSION file |
| | 65 | echo "WARNING: Invalid source version ${SOURCE_VERSION}, must start with v and a number, will use VERSION file instead" |
| | 66 | . $GITTREEDIR/VERSION |
| | 67 | fi |
| | 68 | |
| | 69 | src_vn=`echo "${SOURCE_VERSION}" | sed "s/^[Vv]// ; s/-.*// ; s/\..*//"` |
| | 70 | MYTH_BINARY_VERSION=`grep "#define *MYTH_BINARY_VERSION" libs/libmythbase/mythversion.h \ |
| | 71 | | sed 's/#define// ; s/MYTH_BINARY_VERSION// ; s/ //g ; s/"//g'` |
| | 72 | |
| | 73 | bin_vn=`echo $MYTH_BINARY_VERSION | sed 's/\..*//'` |
| | 74 | |
| | 75 | if ! test $src_vn -eq $bin_vn ; then |
| | 76 | echo "ERROR: High level of source version ${SOURCE_VERSION}, does not match high level of binary version $MYTH_BINARY_VERSION" |
| | 77 | exit 2 |
| | 78 | fi |
| | 79 | |
| 44 | 80 | cat > .vers.new <<EOF |
| 45 | 81 | #ifndef MYTH_SOURCE_VERSION |
| 46 | 82 | #define MYTH_SOURCE_VERSION "${SOURCE_VERSION}" |