Skip to content
13 changes: 13 additions & 0 deletions build/build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -834,8 +834,21 @@

<!-- Retrieve tool -->
<target name="untar-unzip-download" depends="untar-unzip-check" unless="${archive_file}_available">
<antcall target="untar-unzip-download-web" />
<antcall target="untar-unzip-download-local" />
</target>
<target name="untar-unzip-download-web" unless="local_sources">
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this distinction really needed?

AFAIR if you copy the needed archives in the right place before launching the build, the file is not downloaded again (this is done in the untar-unzip-check that is a dependency of untar-unzip-download).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

One of the biggest reasons I remember is that some paths are different for different architectures or not existant (mkdir -p). On top of that you need to always change the PKGBUILD and need to carefully check where the build script wants to have its downloaded files. This makes it harder to maintain.

This patch makes it simpler to search the download files from a local source instead.

<get src="${archive_url}" dest="${archive_file}" verbose="true" ignoreerrors="true" />
</target>
<target name="untar-unzip-download-local" if="local_sources">
<basename file="${archive_file}" property="basename" />
<echo>Skipping download of ${archive_url}, using makepkg downloaded ${basename}</echo>
<exec executable="ln" failonerror="true">
<arg value="-s" />
<arg value="${basedir}/../../${basename}" />
<arg value="${archive_file}" />
</exec>
</target>

<target name="untar-unzip-checksum" depends="untar-unzip-download">
<echo>Testing checksum of "${archive_file}"</echo>
Expand Down