intersystems / intersystems/ipm

Support `UseCachedPackages` flag to prioritize existing local files during installation

Open
#1,044 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
ObjectScript
Stars
41
Forks
29
Avg merge
23h 54m
Merged PRs (30d)
4

Description

### **Description**

Currently, when a module is uninstalled via IPM, the physical source files often remain in the installation directory (e.g., `/ipm///`). However, if a user attempts to `install` that same module/version again, IPM ignores the existing local files and initiates a fresh download from the remote registry.

### **Proposed Solution**

I propose a new configuration setting that allows IPM to detect and use existing local source files instead of redownloading them.

**Name:** `UseCachedPackages`

**Logic:**
When running `zpm "install "`:

1. **Check Setting:** If `UseCachedPackages` is set to `1`.
2. **Local Scan:** IPM checks if the directory `/ipm///` exists and contains a valid `module.xml`.
3. **Action:**
* **If Local Files Exist:** IPM skips download from registry and proceeds directly to loading/compiling the existing local files (similar to a `load` command).
* **If Local Files Do Not Exist:** IPM performs the standard download from the registry.

### **Requested Flag Behavior:**

* **`0` (Default):** Maintain current behavior (always fetch from registry).
* **`1`:** Prefer local files if they exist in the standard IPM directory.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.