Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
pike
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
pikelang
pike
Commits
2dcc2969
Commit
2dcc2969
authored
24 years ago
by
Fredrik Noring
Browse files
Options
Downloads
Patches
Plain Diff
Better cwd handling (for relative paths).
Rev: bin/install.pike:1.66 Rev: lib/modules/Tools.pmod/Install.pmod:1.2
parent
65757d12
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
bin/install.pike
+1
-0
1 addition, 0 deletions
bin/install.pike
lib/modules/Tools.pmod/Install.pmod
+10
-4
10 additions, 4 deletions
lib/modules/Tools.pmod/Install.pmod
with
11 additions
and
4 deletions
bin/install.pike
+
1
−
0
View file @
2dcc2969
...
...
@@ -870,6 +870,7 @@ int pre_install(array(string) argv)
status1("");
interactive=Tools.Install.Readline();
interactive->set_cwd("../");
write(" Welcome to the interactive "+version()+
" installation script.\n"
...
...
This diff is collapsed.
Click to expand it.
lib/modules/Tools.pmod/Install.pmod
+
10
−
4
View file @
2dcc2969
...
...
@@ -2,7 +2,7 @@
// Common routines which are useful for various install scripts based on Pike.
//
string make_absolute_path(string path)
string make_absolute_path(string path
, string|void cwd
)
{
#if constant(getpwnam)
if(sizeof(path) && path[0] == '~')
...
...
@@ -22,7 +22,7 @@ string make_absolute_path(string path)
#endif
if(!sizeof(path) || path[0] != '/')
return combine_path(getcwd(), ".
.
/", path);
return combine_path(
cwd ||
getcwd(), "./", path);
return path;
}
...
...
@@ -92,7 +92,8 @@ class Readline
{
inherit Stdio.Readline;
int match_directories_only;
private int match_directories_only;
private string cwd;
void trap_signal(int n)
{
...
...
@@ -153,7 +154,7 @@ class Readline
string text = gettext();
int pos = getcursorpos();
array(string) path = make_absolute_path(text[..pos-1])/"/";
array(string) path = make_absolute_path(text[..pos-1]
, cwd
)/"/";
array(string) files =
glob(path[-1]+"*",
get_dir(sizeof(path)>1? path[..sizeof(path)-2]*"/"+"/":".")||({}));
...
...
@@ -187,6 +188,11 @@ class Readline
break;
}
}
void set_cwd(string _cwd)
{
cwd = _cwd;
}
void create(mixed ... args)
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment