bundle.sh 912 B

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. #!/bin/bash
  2. ## Generates the bundle
  3. function copy_dir {
  4. rm -rf dwarf-compilation
  5. cp -r dwarf-compilation.base dwarf-compilation
  6. }
  7. function download_repo {
  8. echo -n "Downloading $1… "
  9. wget -q "https://git.tobast.fr/m2-internship/$1/archive/master.tar.gz"
  10. tar xzf master.tar.gz
  11. rm -f master.tar.gz
  12. echo "OK"
  13. }
  14. function download_tgz {
  15. echo -n "Downloading $3… "
  16. wget -q "$1" -O archive.tar.gz
  17. tar xzf archive.tar.gz
  18. mv "$2" "$3"
  19. rm archive.tar.gz
  20. echo "OK"
  21. }
  22. function download {
  23. cd dwarf-compilation
  24. download_repo "dwarf-assembly"
  25. download_repo "libunwind-eh_elf"
  26. cd contrib
  27. download_tgz "http://www.mr511.de/software/libelf-0.8.13.tar.gz" \
  28. 'libelf-0.8.13' 'libelf'
  29. cd ../..
  30. }
  31. function package {
  32. echo -n "Packaging… "
  33. tar czf dwarf-compilation.tar.gz dwarf-compilation
  34. echo "OK"
  35. }
  36. copy_dir
  37. download
  38. package