Skip to content
Snippets Groups Projects
Commit cb2ac18a authored by Henrik (Grubba) Grubbström's avatar Henrik (Grubba) Grubbström
Browse files

The generated package should now survive being called with an absolute path.

Rev: bin/mkpackage.pike:1.4
parent 20a60b7d
No related branches found
No related tags found
No related merge requests found
......@@ -49,9 +49,9 @@ class Package
"echo 'Package version unknown.'\n"
"exit",
({ "-a", "--add-component" }):
"shift; ORIGINAL_WD=\"`pwd`\"\n"
"shift\n"
"(cd `dirname \"$1\"` &&\n"
" tar rf \"$ORIGINAL_WD/$TARFILE\" `basename \"$1\"`)\n"
" tar rf \"$TARFILE\" `basename \"$1\"`)\n"
"exit",
({ "-l", "--list" }):
"echo \"$CONTENTS\"\n"
......@@ -77,6 +77,14 @@ class Package
"TARFILE=\"$1\"; shift; ARGS=''\n"
"CONTENTS=`tar tf \"$TARFILE\" | sed -ne '/^"+
replace(basename(install_filename), ".", "\\.")+"/,$p'`\n"
// Convert $TARFILE to an absolute path
"case \"$TARFILE\" in\n"
" /*)\n"
" ;;\n"
" *)\n"
" TARFILE=\"`pwd`/$TARFILE\"\n"
" ;;\n"
"esac\n"
// Check all arguments for possible options.
"while [ $# != 0 ]\n"
"do\n"
......@@ -93,7 +101,7 @@ class Package
// Commence installation.
"mkdir "+unpack_directory+"\n"
"(cd "+unpack_directory+"\n"
" tar xf ../\"$TARFILE\" $CONTENTS\n"
" tar xf \"$TARFILE\" $CONTENTS\n"
" ./"+basename(pike_filename)+" "
"--script \"`pwd`\"/"+
basename(install_filename)+")\n"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment