Skip to content

Commit

Permalink
Fix handling of pkdirs that directly contain a package
Browse files Browse the repository at this point in the history
  • Loading branch information
lgoettgens committed Jan 4, 2025
1 parent 7daec4d commit dafdb12
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions lib/package.gi
Original file line number Diff line number Diff line change
Expand Up @@ -286,7 +286,7 @@ end );
## In earlier versions, this function had an argument; now we ignore it.
##
InstallGlobalFunction( InitializePackagesInfoRecords, function( arg )
local pkgdirs, pkgdir, pkgdirstrs, ignore, name, files, record, r;
local pkgdirs, pkgdir, pkgdirstrs, ignore, name, file, files, record, r;

if IsBound( GAPInfo.PackagesInfoInitialized ) and
GAPInfo.PackagesInfoInitialized = true then
Expand Down Expand Up @@ -356,18 +356,20 @@ InstallGlobalFunction( InitializePackagesInfoRecords, function( arg )
fi;

# pkgdir may be a package instead of a package directory
files := FindPackageInfosInSubdirectories( pkgdir, "" );
AddPackageInfos( files, pkgdir, ignore );

# Loop over subdirectories of this package directory.
for name in Set( DirectoryContents( Filename( pkgdir, "" ) ) ) do
file:= Filename( [ pkgdir ], "PackageInfo.g" );
if file <> fail then
AddPackageInfos( [ [ file, "" ] ], pkgdir, ignore );
else
# Loop over subdirectories of this package directory.
for name in Set( DirectoryContents( Filename( pkgdir, "" ) ) ) do

## Get all package dirs
files := FindPackageInfosInSubdirectories( pkgdir, name );
## Get all package dirs
files := FindPackageInfosInSubdirectories( pkgdir, name );

AddPackageInfos( files, pkgdir, ignore );
AddPackageInfos( files, pkgdir, ignore );

od;
od;
fi;
od;

# Sort the available info records by their version numbers.
Expand Down

0 comments on commit dafdb12

Please sign in to comment.