This works for extracting an archive that has already been downloaded.

# Tupfile
run ./extracttarball.sh $(ARCHIVEFILE)

# now do something with the extracted files...


#! /bin/bash
# extracttarball.sh archive.tar.gz

# skip entries for directories
mapfile -t FILES < <(tar -tf $1 | grep -e "[^/]$")

for f in ${FILES[*]}
do
# create a rule to unzip each file in the archive
echo ": |> tar -xf $1 %o |> $f {ARCHIVECONTENTS}"
done

Then just add {ARCHIVECONTENTS} as an extra input where needed.

Thanks,


On Wednesday, October 24, 2018 at 12:47:57 PM UTC-7, sateesh vandavasi 
wrote:
>
> Hi Mike,
>
> Some of component builds follows below workflow .
>
> 1) untar ( openssh-4.0.1.tar.gz )
> 2) create a link " contents --> openssh-4.0.1 )
> 3)  patch 
> 4) build contents/src/*.c into contents/obj-dir/*.o
> 5) create binary/so using    contents/obj-dir/*.o in contents/lib-dir/*.so 
> , contents/bin-dir/*.bin 
>
> Sampe Tupfile :
>
> VERSION = 4.0.1
> : |> tar -xzvf openssh-$(VERSION).tar.gz  && touch untar-done |> untar-done
> : untar-done |> ln -fs openssh-$(VERSION) contents |>  contents
> :   foreach contents/src/*.c | contents |> gcc $(CFLAGS) -c %f -o %o |> 
> contents/obj-dir/%B.o 
> :    contents/obj-dir/*.o  |> gcc %f -o %o |> contents/bin-dir/openssh.bin 
>
> Issue 1) tar -xzvf is not working inside tup build
> Issue 2) I do not want to list , all files as output in untar command
>
> Shall we write Tupfile on toplevel or generate a tupfile under contents/ 
> dynamically ?
>
>  We are trying to showcase tup build ( comparing to make ) for fast 
> incremental builds . 
> Really appreciate your response.
>
> Regards,
> Sateesh
>
>

-- 
-- 
tup-users mailing list
email: [email protected]
unsubscribe: [email protected]
options: http://groups.google.com/group/tup-users?hl=en
--- 
You received this message because you are subscribed to the Google Groups 
"tup-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to