Skip to content

Commit 1607cd6

Browse files
committed
WIP
1 parent 3e11b6b commit 1607cd6

File tree

2 files changed

+14
-13
lines changed

2 files changed

+14
-13
lines changed

lib/package.gi

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1862,19 +1862,19 @@ InstallGlobalFunction( SetPackagePath, function( pkgname, pkgpath )
18621862
#F ExtendRootDirectories( <paths> )
18631863
##
18641864
InstallGlobalFunction( ExtendRootDirectories, function( rootpaths )
1865-
local i;
1866-
1867-
rootpaths:= Filtered( rootpaths, path -> not path in GAPInfo.RootPaths );
1868-
if not IsEmpty( rootpaths ) then
1869-
# 'DirectoriesLibrary' concatenates root paths with directory names.
1870-
for i in [ 1 .. Length( rootpaths ) ] do
1871-
if not EndsWith( rootpaths[i], "/" ) then
1872-
rootpaths[i]:= Concatenation( rootpaths[i], "/" );
1873-
fi;
1874-
od;
1875-
# Append the new root paths.
1876-
GAPInfo.RootPaths:= Immutable( Concatenation( GAPInfo.RootPaths,
1877-
rootpaths ) );
1865+
local path, changed;
1866+
1867+
changed:= false;
1868+
for path in rootpaths do
1869+
if not EndsWith( path, "/" ) then
1870+
path:= Concatenation( path, "/" );
1871+
fi;
1872+
if not path in GAPInfo.RootPaths then
1873+
Add( GAPInfo.RootPaths, path );
1874+
changed:= true;
1875+
fi;
1876+
od;
1877+
if changed then
18781878
# Clear the cache.
18791879
GAPInfo.DirectoriesLibrary:= AtomicRecord( rec() );
18801880
# Reread the package information.

src/sysroots.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,7 @@ void SySetGapRootPath(const Char * string)
137137
if (q == p) {
138138
// empty string treated as ./
139139
path = MakeString("./");
140+
// TODO: insert output of getcwd??
140141
} else {
141142
path = MakeStringWithLen(p, q - p);
142143

0 commit comments

Comments
 (0)