Skip to content

Commit

Permalink
Add 'debug' option which preserves failed package dirs (#119)
Browse files Browse the repository at this point in the history
If a package fails to install, it is normally deleted to prevent stale
packages from clogging up the system. But for debugging the failure it
is useful to keep the package around.
  • Loading branch information
fingolfin committed Aug 29, 2023
1 parent 4d8e91f commit d69e567
Showing 1 changed file with 18 additions and 6 deletions.
24 changes: 18 additions & 6 deletions gap/PackageManager.gi
Original file line number Diff line number Diff line change
Expand Up @@ -291,13 +291,17 @@ function(url)
# Install dependencies
if PKGMAN_InstallDependencies(dir) <> true then
Info(InfoPackageManager, 1, "Dependencies not satisfied for ", topdir);
PKGMAN_RemoveDir(dir);
if ValueOption("debug") <> true then
PKGMAN_RemoveDir(dir);
fi;
return false;
fi;

# Check validity
if PKGMAN_CheckPackage(dir) = false then
PKGMAN_RemoveDir(dir);
if ValueOption("debug") <> true then
PKGMAN_RemoveDir(dir);
fi;
return false;
fi;
PKGMAN_RefreshPackageInfo();
Expand Down Expand Up @@ -380,14 +384,18 @@ function(url, args...)
info := Filename(Directory(dir), "PackageInfo.g");
if not IsReadableFile(info) then
Info(InfoPackageManager, 1, "Could not find PackageInfo.g");
PKGMAN_RemoveDir(dir);
if ValueOption("debug") <> true then
PKGMAN_RemoveDir(dir);
fi;
return false;
fi;

# Install dependencies
if PKGMAN_InstallDependencies(dir) <> true then
Info(InfoPackageManager, 1, "Dependencies not satisfied for ", name);
PKGMAN_RemoveDir(dir);
if ValueOption("debug") <> true then
PKGMAN_RemoveDir(dir);
fi;
return false;
fi;

Expand Down Expand Up @@ -470,14 +478,18 @@ function(url, args...)
info := Filename(Directory(dir), "PackageInfo.g");
if not IsReadableFile(info) then
Info(InfoPackageManager, 1, "Could not find PackageInfo.g");
PKGMAN_RemoveDir(dir);
if ValueOption("debug") <> true then
PKGMAN_RemoveDir(dir);
fi;
return false;
fi;

# Install dependencies
if PKGMAN_InstallDependencies(dir) <> true then
Info(InfoPackageManager, 1, "Dependencies not satisfied for ", name);
PKGMAN_RemoveDir(dir);
if ValueOption("debug") <> true then
PKGMAN_RemoveDir(dir);
fi;
return false;
fi;

Expand Down

0 comments on commit d69e567

Please sign in to comment.