Necrose99

/etc/portage/bashrc_do-git-ftp.inc

Sep 3rd, 2020 (edited)
136
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.50 KB | None | 0 0
  1. #!/bin/env bash
  2. ### /etc/portage/bashrc_do-git-ftp.inc
  3. ### /etc/portage/bashrc add source bashrc_do-git-ftp.inc
  4. #### https://github.com/spreequalle/gentoo-binhost , some credits , on RPI4 devices sometimes she works , offten she wont..
  5. ## to my fork https://github.com/necrose99/gentoo-binhost  GH also has a 50 meg file limit ie ghc or larger tools nuts...
  6. ### so needed a fix to a public binhost on www/ftp or shared webhosting thats dope....
  7.  
  8. if [[ ${EBUILD_PHASE} == 'postinst' ]]; then
  9.   # FIXME come up with a more sophisticated approach to detect if binary package build is actually requested
  10.   # commandline args like -B or --buildpkg-exclude and other conditionals are not supported right now.
  11.   grep -q 'buildpkg' <<< {$PORTAGE_FEATURES}
  12.   if [ $? -eq 0 ]; then
  13. do_emaint && do_pkgtar && git-ftp_pusher
  14.   fi
  15. fi
  16.  
  17. do_emaint() {
  18. emaint binhost --check --fix
  19. ##  checkfix packages indexfile before.. crunch..
  20. }
  21.  
  22. do_pkgtar() {
  23. tar -czvf --update ${packagesdir}/packages.tar.gz
  24. ## tar-gzip /packages/packages---file before upload as
  25. }
  26.  
  27. # go git-ftp push https://github.com/git-ftp/git-ftp  / https://bugs.gentoo.org/show_bug.cgi?id=740124
  28.  
  29. git-ftp_pusher () {
  30. if then
  31. git ftp catchup
  32. ## handle fubar's
  33. else
  34. # Work and deploy
  35. echo "new content" >> index.txt
  36. git commit index.txt -m "Add new content"
  37. git ftp push
  38. }
  39.  
  40. # Setup "Crib" notes ...
  41. #git config git-ftp.url "ftp://ftp.example.net:21/public_html"
  42. #git config git-ftp.user "ftp-user"
  43. #git config git-ftp.password "secr3t"
Add Comment
Please, Sign In to add comment