You are not logged in.
Hi all!
I haven't found any info on whether the source archives are extracted in the same order as they are listed in the PKGBUILD. In my own PKGBUILD I need to be sure that file1.tar.gz is downloaded and extracted (or simply extracted as it should be local) before the file2.tar.gz. I know that I can use noextract array for the file2.tar.gz and extract it later in the prepare() function but I wonder if there any standard for the extraction order or similar.
Last edited by dviktor (2018-09-09 19:10:41)
Offline
Is this because both archives contain the same file?
Offline
The software that I need to install consists of two archives. Every archive contains almost the same directory structure and some files are overlaps but the second file is the kind of "update" in comparison with the first file so it should be extracted after it
Last edited by dviktor (2018-09-09 17:47:57)
Offline
You can see from /usr/share/makepkg/source.sh the current implementation. The man page for PKGBUILD does not specify the order sources will be extracted.
So if you are being cautious I would suggest using noextract for the second archive as you already noted.
Offline
As loqs said, we don't officially support any sort of order at all. However, the implementation-defined behavior should coincidentally be "iterate over files in the order they are listed in source=()", so if you want to rely on this, we *most likely* won't break it.
I guess each release you can check the file loqs mentioned to see if we do though.
Managing AUR repos The Right Way -- aurpublish (now a standalone tool)
Offline
Seems like files are extracted in corresponding order:
extract_sources() {
msg "$(gettext "Extracting sources...")"
local netfile all_sources
get_all_sources_for_arch 'all_sources'
for netfile in "${all_sources[@]}"; do
local file=$(get_filename "$netfile")
local proto=$(get_protocol "$netfile")
case "$proto" in
bzr*)
extract_bzr "$netfile"
;;
git*)
extract_git "$netfile"
;;
hg*)
extract_hg "$netfile"
;;
svn*)
extract_svn "$netfile"
;;
*)
extract_file "$file"
;;
esac
done
}
So it should be safe. Thank you!
Offline