Skip to content

Commit

Permalink
Merge pull request #1574 from citrus-it/mirror
Browse files Browse the repository at this point in the history
Add -M build flag to temporarily override mirror for development
  • Loading branch information
hadfl authored Jan 22, 2025
2 parents 2c8b9fc + e3b796b commit e3bc65a
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 11 deletions.
26 changes: 16 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -739,21 +739,27 @@ packages. In the early stages of a build, this source tarball will not be
available on the OmniOS mirror, and will be need to be made available for the
build process.

This can be done by using the `set_mirror` directive in `build.sh`. For example
the source tarball for "Apache httpd 2.4.43" is available at the mirror:
<https://downloads.apache.org/>. Therefore the `set_mirror` directive should be
as follows:
The easiest way to do this is to use `build.sh`'s `-M` option to temporarily
point at either the original distribution site, or to a temporary directory.

```none
set_mirror "https://downloads.apache.org/"
For example the source tarball for "Apache httpd 2.4.43" is available at the
mirror: <https://downloads.apache.org/>. Therefore `build.sh` can be run as:

```bash
$ ./build.sh -M https://downloads.apache.org/
```
Further in the `build.sh` file, the `download_source` directive should be as
follows:

```none
download_source $PROG $PROG $VER
or, if you download `httpd-2.4.43.tar.bz2` and place it in `/tmp/apache`:

```bash
$ ./build.sh -M /tmp
```

If the download fails, look at `build.log` to determine the pathnames that
were tried, and adjust accordingly.

The mirror can also be changed permanently in `lib/site.sh`.

#### Checksums:

The above will be sufficient if the accompanying sha256 checksum file is
Expand Down
9 changes: 8 additions & 1 deletion lib/functions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ process_opts() {
SKIP_CHECKSUM=
EXTRACT_MODE=0
MOG_TEST=
while getopts "bcimPpstf:ha:d:Llr:x" opt; do
while getopts "bcimM:Ppstf:ha:d:Llr:x" opt; do
case $opt in
a)
set_arch "$OPTARG"
Expand Down Expand Up @@ -96,6 +96,11 @@ process_opts() {
m)
MOG_TEST=1
;;
M)
logmsg -n "-- Will retrieve files from $OPTARG"
set_mirror "$OPTARG"
set_checksum none
;;
P)
REBASE_PATCHES=1
;;
Expand Down Expand Up @@ -139,6 +144,8 @@ show_usage() {
-l : skip pkglint check
-L : skip hardlink target check
-m : re-generate final mog from local.mog (mog test mode)
-M URL : retrieve files from URL instead of OmniOS mirror
-M /PATH : retrieve files from (absolute) PATH instead of OmniOS mirror
-p : output all commands to the screen as well as log file
-P : re-base patches on latest source
-r REPO : specify the IPS repo to use
Expand Down

0 comments on commit e3bc65a

Please sign in to comment.