Commit 568f518feb9c48b557d07923432c5fcd5b79b7c4

Authored by Jay Berkenbilt
1 parent a6f206ad

Be more general about environment

* Allow any Ubuntu 14.04, not specifically 14.04.5
* Work properly if not running in Travis CI
Showing 1 changed file with 7 additions and 3 deletions
appimage/build-appimage
@@ -49,7 +49,7 @@ fi @@ -49,7 +49,7 @@ fi
49 _osversion=$(cat /etc/os-release | grep PRETTY_NAME | awk -F'=' '{print $2}' | sed 's#"##g') 49 _osversion=$(cat /etc/os-release | grep PRETTY_NAME | awk -F'=' '{print $2}' | sed 's#"##g')
50 50
51 # Warn users building the AppImage locally: 51 # Warn users building the AppImage locally:
52 -if [ x"$_osversion" != x"Ubuntu 14.04.5 LTS" ] ; then 52 +if [[ ! $_osversion =~ Ubuntu\ 14.04.*\ LTS ]]; then
53 set +x 53 set +x
54 echo "" 54 echo ""
55 # 0 1 2 3 4 5 6 7 55 # 0 1 2 3 4 5 6 7
@@ -160,7 +160,7 @@ unset QTDIR; unset QT_PLUGIN_PATH; unset LD_LIBRARY_PATH @@ -160,7 +160,7 @@ unset QTDIR; unset QT_PLUGIN_PATH; unset LD_LIBRARY_PATH
160 rm appdir/AppRun; cp $top/appimage/AppRun appdir; chmod a+x appdir/AppRun 160 rm appdir/AppRun; cp $top/appimage/AppRun appdir; chmod a+x appdir/AppRun
161 161
162 # If we are not on Ubuntu Trusty, we need to disable 'appstreamcli' validation: 162 # If we are not on Ubuntu Trusty, we need to disable 'appstreamcli' validation:
163 -if [ x"$_osversion" == x"Ubuntu 14.04.5 LTS" ] ; then 163 +if [[ $_osversion =~ Ubuntu\ 14.04.*\ LTS ]]; then
164 appimagetool_param="" 164 appimagetool_param=""
165 else 165 else
166 appimagetool_param="-n" 166 appimagetool_param="-n"
@@ -177,7 +177,11 @@ fi @@ -177,7 +177,11 @@ fi
177 177
178 # Set up a version string to include in the AppImage name 178 # Set up a version string to include in the AppImage name
179 MAJOR_QPDF_VERSION=$( ./appdir/usr/bin/qpdf --version | grep "qpdf version" | awk '{print $3}' ) 179 MAJOR_QPDF_VERSION=$( ./appdir/usr/bin/qpdf --version | grep "qpdf version" | awk '{print $3}' )
180 -VERSION=${MAJOR_QPDF_VERSION}-continuous-${TRAVIS_JOB_NUMBER}-$(date "+%Y-%m-%d")-git.$(git rev-parse --short HEAD)-x86_64 180 +if [ "$TRAVIS_JOB_NUMBER" != "" ]; then
  181 + VERSION=${MAJOR_QPDF_VERSION}-continuous-${TRAVIS_JOB_NUMBER}-$(date "+%Y-%m-%d")-git.$(git rev-parse --short HEAD)
  182 +else
  183 + VERSION=${MAJOR_QPDF_VERSION}
  184 +fi
181 185
182 # Remove the default AppRun/symlink and use our own custom AppRun script 186 # Remove the default AppRun/symlink and use our own custom AppRun script
183 rm appdir/AppRun; cp $top/appimage/AppRun appdir; chmod a+x appdir/AppRun 187 rm appdir/AppRun; cp $top/appimage/AppRun appdir; chmod a+x appdir/AppRun