@ -21,11 +21,11 @@ if you want to avoid use GitHub.
- Verboses changes if requested
- Verboses changes if requested
- Can rewrite sources files if run as `root`
- Can rewrite sources files if run as `root`
- Does backup old sources files for easy restoring
- Does backup old sources files for easy restoring
- Supports mirror lists for allowing fallback to direct connection (see [`man apt-transport-mirror`](https://manpages.debian.org/buster/apt/apt-transport-mirror.1.en.html))
### ToDo
### ToDo
- Support https for approx
- Support https for approx
- Implement '--mirror' mode
## Usage
## Usage
@ -51,7 +51,12 @@ If you want to approve these changes, run as `root`:
```
```
Now your system will use the approx cache.
Now your system will use the approx cache.
The old entries are commented out.
The old entries can be found in the backup files.
### Mirror Mode
To use mirror mode, follow the same approach as above,
but append the flag `-m` or `--mirror-mode` to the arguments.
parser=argparse.ArgumentParser(description="Redirects apt sources to a given approx cache if cached by approx. Only files ending with .list in sources.list.d will be changed.")
parser=argparse.ArgumentParser(description="Redirects apt sources to a given approx cache if cached by approx. Only files ending with .list in sources.list.d will be changed.")
parser.add_argument('host',help="The URL of the approx cache, uses http:// if protocol is omitted")
parser.add_argument('host',help="The URL of the approx cache, uses http:// if protocol is omitted")
parser.add_argument('-c','--confirm',action='store_true',dest='confirm',help="Does rewrite the source files to redirect to approx, does require run as root")
parser.add_argument('-c','--confirm',action='store_true', help="Does rewrite the source files to redirect to approx, may does require run as root")
parser.add_argument('-m','--mirror',action='store_true',dest='use_mirror',help="Uses mirror lists to allow falling back to direct connection")
parser.add_argument('-m','--mirror',action='store_true', help="Uses mirror lists to allow falling back to direct connection, mirror lists will be stored to {path}/mirror-lists")
parser.add_argument('-p','--path',dest='path',default='/etc/apt',type=Path,help="Configuration directory of apt containing sources.list files, defaults to /etc/apt")
parser.add_argument('-p','--path',default='/etc/apt',type=Path,help="Configuration directory of apt containing sources.list files, defaults to /etc/apt")