Advertisement
Guest User

update-apt-repository.sh

a guest
Dec 6th, 2012
55
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.42 KB | None | 0 0
  1. #!/bin/bash
  2. #This script updates the APT repository by looking at the packages present in
  3. #the pool/main directory, generates Packages files for each architecture,
  4. #generates a standard Release file and signs it.
  5. #
  6.  
  7. #Set repository location
  8. echo "REPO set to $REPO"
  9. if [ ! -d $REPO ]
  10. then
  11.     echo "$REPO does not exist! Exiting..."; exit 1
  12. fi
  13.  
  14. cd "$REPO" &&
  15.  
  16. #Generate Packages files
  17. echo "Generating Packages files..."
  18. #apt-ftparchive --arch i386 packages ./ > | gzip -9c > ./dists/testing/main/binary-i386/Packages.gz
  19. apt-ftparchive --arch i386 packages ./ > ./dists/testing/main/binary-i386/Packages
  20. #apt-ftparchive --arch amd64 packages ./ | gzip -9c > ./dists/testing/main/binary-amd64/Packages.gz
  21. apt-ftparchive --arch amd64 packages ./ > ./dists/testing/main/binary-amd64/Packages
  22. #apt-ftparchive --arch all packages ./ | gzip -9c > ./dists/testing/main/binary-all/Packages.gz
  23. apt-ftparchive --arch all packages ./ > ./dists/testing/main/binary-all/Packages
  24.  
  25. #Release file header
  26. echo "Origin: $YOUR_DISTRO
  27. Suite: testing
  28. Label: $YOUR_DISTRO
  29. Components: main
  30. Date: `date`
  31. Architectures: amd64 i386
  32. Description: $YOUR_REPO_DESCRIPTION" > ./dists/testing/Release
  33.  
  34. #Generate Release File
  35. echo "Generating main Release file..."
  36. apt-ftparchive release ./dists/testing/ >> ./dists/testing/Release
  37.  
  38. #Sign Release file
  39. echo "Signing release file..."
  40. gpg -abs -o ./dists/testing/Release.gpg ./dists/testing/Release
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement