Using "$ source export_modules_dir.sh" causes the error "bash: /bin/build_paths.inc: No such file or directory"

Bug #1518106 reported by Andrew Hayzen
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
ubuntu-ui-toolkit (Ubuntu)
Confirmed
Undecided
Unassigned

Bug Description

When branching lp:ubuntu-ui-toolkit and using the script export_modules_dir.sh it causes the error "bash: /bin/build_paths.inc: No such file or directory".

What happened:
1) Branch lp:ubuntu-ui-toolkit and cd into the directory
2) Run the command $ source export_modules_dir.sh
3) Observe the error "bash: /bin/build_paths.inc: No such file or directory"

What I expected to happen:
At step 3) for the modules to be correctly exported.

Note that the workaround I currently perform is running the following set of commands (the only difference from the script is ". `dirname $0`/build_paths.inc" is now ". build_paths.inc")

$ . build_paths.inc
$ export QML_IMPORT_PATH=$BUILD_DIR/qml
$ export QML2_IMPORT_PATH=$BUILD_DIR/qml
$ export UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml
$ /sbin/initctl set-env --global QML_IMPORT_PATH=$BUILD_DIR/qml
$ /sbin/initctl set-env --global QML2_IMPORT_PATH=$BUILD_DIR/qml
$ /sbin/initctl set-env --global UBUNTU_UI_TOOLKIT_THEMES_PATH=$BUILD_DIR/qml

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in ubuntu-ui-toolkit (Ubuntu):
status: New → Confirmed
Revision history for this message
Tim Peeters (tpeeters) wrote :

build_paths.inc does not exist until you run 'qmake'. Did you do that?

Also exporting the modules dir before running 'make' to compile the plugin is useless, so you need to do that as wel.

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

Nope, I have run both qmake and make in the directory and then source export_modules_dir.sh

Revision history for this message
Andrew Hayzen (ahayzen) wrote :

After further investigation it is specifically the "dirname $0" that is causing the issue, and appears to be related to the terminal I'm using. As if I run gnome-terminal this works as expected but with terminator it doesn't.

gnome-terminal
$ dirname $0
.

terminator
$ dirname $0
/bin

Revision history for this message
Victor Thompson (vthompson) wrote :

Sourcing in the "export_modules_dir.sh" script causes $0 to be "bash" in gnome-terminal and "/bin/bash" in terminator. When executing the script $0 is ./export_modules_dir.sh as one would expect.

Since the script is being sourced in I don't think it dirname should be used.

http://unix.stackexchange.com/questions/4650/determining-path-to-sourced-shell-script

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.