Merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-export-script-improvement into lp:ubuntu-ui-toolkit/staging

Proposed by Loïc Molinari
Status: Work in progress
Proposed branch: lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-export-script-improvement
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 130 lines (+63/-16)
5 files modified
README (+11/-9)
export_modules_dir.sh (+1/-5)
gallery.sh (+4/-1)
run_tests.sh (+3/-1)
uitk_shell.sh (+44/-0)
To merge this branch: bzr merge lp:~loic.molinari/ubuntu-ui-toolkit/ubuntu-ui-toolkit-export-script-improvement
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
PS Jenkins bot continuous-integration Needs Fixing
Benjamin Zeller Approve
Zsombor Egri Pending
Review via email: mp+278028@code.launchpad.net

Commit message

Added a script to spawn a dedicated UITK shell.

The script exports all the needed environment variables for developers working on the toolkit by reusing the existing export_modules_dir.sh script.

Description of the change

Added a script to spawn a dedicated UITK shell.

The script exports all the needed environment variables for developers working on the toolkit by reusing the existing export_modules_dir.sh script.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)
Revision history for this message
Benjamin Zeller (zeller-benjamin) wrote :

LGTM

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :

FAILED: Autolanding.
Approved revid is not set in launchpad. This is most likely a launchpad issue and re-approve should fix it. There is also a chance (although a very small one) this is a permission problem of the ps-jenkins bot.
https://jenkins.ubuntu.com/ubuntu-sdk/job/ubuntu-ui-toolkit-autolanding/9/
Executed test runs:
    None: https://jenkins.ubuntu.com/ubuntu-sdk/job/generic-land-mp/9/console

review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :

FAILED: Autolanding.
Approved revid is not set in launchpad. This is most likely a launchpad issue and re-approve should fix it. There is also a chance (although a very small one) this is a permission problem of the ps-jenkins bot.
https://jenkins.ubuntu.com/ubuntu-sdk/job/ubuntu-ui-toolkit-autolanding/24/
Executed test runs:
    None: https://jenkins.ubuntu.com/ubuntu-sdk/job/generic-land-mp/24/console

review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) :
review: Approve (continuous-integration)

Unmerged revisions

1725. By Loïc Molinari

Fixed typo in the README.

1724. By Loïc Molinari

Updated README.

1723. By Loïc Molinari

Do not override LD_LIBRARY_PATH.

1722. By Loïc Molinari

Made uitk shell and env var export scripts compatible.

1721. By Loïc Molinari

Added script spawning a new shell with all the needed env vars.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'README'
2--- README 2015-01-14 15:18:05 +0000
3+++ README 2015-11-23 11:20:56 +0000
4@@ -27,21 +27,23 @@
5 ----------------
6
7 You need Qt5 installed to proceed. To build this repository, run
8-$ qmake
9-$ make
10+ $ qmake
11+ $ make
12
13 View the components gallery by running
14-$ ./gallery.sh
15+ $ ./gallery.sh
16
17 To install these components, run
18-$ make install
19+ $ make install
20 You may need to be root for this command to succeed.
21
22-To use these components in QML without installing them, you need to set the
23-QML2_IMPORT_PATH environment variable. This is done by running
24-$ source export_modules_dir.sh
25-from the root directory of this repository, but is lost when you close your
26-shell.
27+To use these components uninstalled, you need to have some environment
28+variables correctly set. This is done by either running a dedicated
29+(recursive) shell with
30+ $ ./uitk_shell.sh
31+or by exporting the variables in the current shell session with
32+ $ source export_modules_dir.sh
33+Note that qmake must be run before.
34
35
36 Documentation
37
38=== modified file 'export_modules_dir.sh'
39--- export_modules_dir.sh 2015-11-06 08:09:05 +0000
40+++ export_modules_dir.sh 2015-11-23 11:20:56 +0000
41@@ -19,8 +19,4 @@
42 export QML_IMPORT_PATH=$BUILD_DIR/qml
43 export QML2_IMPORT_PATH=$BUILD_DIR/qml
44 export UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml
45-export LD_LIBRARY_PATH=$BUILD_DIR/lib
46-/sbin/initctl set-env --global QML_IMPORT_PATH=$BUILD_DIR/qml
47-/sbin/initctl set-env --global QML2_IMPORT_PATH=$BUILD_DIR/qml
48-/sbin/initctl set-env --global UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml
49-/sbin/initctl set-env --global LD_LIBRARY_PATH=$BUILD_DIR/lib
50+export LD_LIBRARY_PATH=$BUILD_DIR/lib${LD_LIBRARY_PATH:+:$LD_LIBRARY_PATH}
51
52=== modified file 'gallery.sh'
53--- gallery.sh 2015-08-11 15:42:46 +0000
54+++ gallery.sh 2015-11-23 11:20:56 +0000
55@@ -15,7 +15,10 @@
56 # along with this program. If not, see <http://www.gnu.org/licenses/>.
57 #
58
59-source export_modules_dir.sh
60+if [ -z ${UITK_SHELL+x} ]
61+then
62+ source export_modules_dir.sh
63+fi
64
65 if [ "$1" == "--autopilot" ]
66 then
67
68=== modified file 'run_tests.sh'
69--- run_tests.sh 2015-01-30 11:58:40 +0000
70+++ run_tests.sh 2015-11-23 11:20:56 +0000
71@@ -15,7 +15,9 @@
72 # along with this program. If not, see <http://www.gnu.org/licenses/>.
73 #
74
75-source $PWD/export_modules_dir.sh
76+if [ -z ${UITK_SHELL+x} ]; then
77+ source $PWD/export_modules_dir.sh
78+fi
79
80 if [ ! -e $QML2_IMPORT_PATH/Ubuntu/Layouts/libUbuntuLayouts.so ]; then
81 echo You need to build UITK before you can run Autopilot test cases!
82
83=== added file 'uitk_shell.sh'
84--- uitk_shell.sh 1970-01-01 00:00:00 +0000
85+++ uitk_shell.sh 2015-11-23 11:20:56 +0000
86@@ -0,0 +1,44 @@
87+#!/bin/bash -i
88+#
89+# Copyright (C) 2015 Canonical Ltd.
90+#
91+# This program is free software; you can redistribute it and/or modify
92+# it under the terms of the GNU Lesser General Public License as published by
93+# the Free Software Foundation; version 3.
94+#
95+# This program is distributed in the hope that it will be useful,
96+# but WITHOUT ANY WARRANTY; without even the implied warranty of
97+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
98+# GNU Lesser General Public License for more details.
99+#
100+# You should have received a copy of the GNU Lesser General Public License
101+# along with this program. If not, see <http://www.gnu.org/licenses/>.
102+
103+# This script spawns a new Bash shell with all the environment variables needed
104+# to run apps based on the local source tree uninstalled. Note that qmake must
105+# be run before in order to have the build_paths.inc file generated:
106+#
107+# $ qmake
108+# $ ./uitk_shell.sh
109+# $ make
110+# $ qmlscene uitk_based_file.qml
111+
112+NAME='uitk'
113+
114+source `dirname $0`/export_modules_dir.sh
115+
116+export UITK_SHELL=1
117+
118+TEMP_FILE=`mktemp -t bashrc.XXXXXXXX`
119+echo source $HOME/.bashrc >> $TEMP_FILE
120+echo PS1=\'[$NAME] $PS1\' >> $TEMP_FILE
121+SHELL_OPTIONS="--init-file $TEMP_FILE"
122+
123+echo Entering $NAME shell.
124+$SHELL $SHELL_OPTIONS
125+echo Leaving $NAME shell. Have a nice day!
126+
127+if test ! -z "$TEMP_FILE"
128+then
129+ rm $TEMP_FILE
130+fi

Subscribers

People subscribed via source and target branches