Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error building XPI file #261

Open
barancev opened this issue May 18, 2015 · 3 comments
Open

Error building XPI file #261

barancev opened this issue May 18, 2015 · 3 comments

Comments

@barancev
Copy link

alexei@alexei-xubuntu64:~/se-builder$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

nothing to commit, working directory clean

alexei@alexei-xubuntu64:~/se-builder$ make xpi
Building latest '/home/alexei/se-builder/build/seleniumbuilder-2.3.2.xpi'...
sed: can't read : No such file or directory
make: *** [xpi] Error 123

@Zarkonnen
Copy link

Hm, that was written by @knorrium years ago. Unfortunately I don't speak sed, so I'm less than clear on what's gone wrong. Anyone?

@ghost
Copy link

ghost commented Jun 15, 2015

The problem is because @knorrium was probably using Mac (or an old shell on nix) and difference of sed within BSD and GNU. That's why sed -i "" will work for Mac, but for linux sed we should remove "" in the statement.

Code looks not like the best one, should it be bsd/gnu cross compatible?

If you want to run it on modern nix systems:

diff --git a/Makefile b/Makefile
index d489c59..b2f76af 100644
--- a/Makefile
+++ b/Makefile
@@ -18,7 +18,7 @@ help:
 xpi:
        @echo "Building latest '${XPI}'..."
        @mkdir -p ${BUILD}
-       @find . -iname "*.rdf" | xargs grep -l "em:version" | xargs sed -i "" -e 's#<em:version>\([^<][^<]*\)</em:version>#<em:version>${JS_VERSION}</em:version>#'
+       @find . -iname "*.rdf" | xargs grep -l "em:version" | xargs sed -i -e 's#<em:version>\([^<][^<]*\)</em:version>#<em:version>${JS_VERSION}</em:version>#'
        @cd seleniumbuilder; zip -r ../build/${NAME} .
        @echo "File generated at: build/${NAME}" 

Some more issues about this Makefile.

  1. why [^<][^<] but not [^<]+ ?
  2. why are we trying to match 2.3.3 with \([^<][^<]*\) ? It will never match and will never change the version? Why not just everything between tests?
  3. in some cases within Makefile its used find '*.rdf', but somewhere the name of file is hardcoded, that make no sense in fact.

Is it ok if I will refactor the script a bit?

@Zarkonnen
Copy link

Please do! A more robust makefile would be extremely useful.

@ghost ghost mentioned this issue Jun 30, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants