Advertisement
Shnatsel

ITP generator for elementary software

Jun 6th, 2014
362
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.46 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ -z "$1" ]; then
  4.     echo "Usage: $0 lp:~elementary-os/SOMEPROJECT/deb-packaging"
  5.     exit 1
  6. fi
  7.  
  8. set -e
  9.  
  10. project_name=$(echo "$1" | cut -d '/' -f 2)
  11.  
  12. target_dir="$(mktemp -d)"
  13. bzr export "$target_dir" "$1"
  14. cd "$target_dir"
  15.  
  16. package_name=$(grep 'Source:' debian/control | cut -d ':' -f 2-)
  17. description=$(grep -m 1 'Description:' debian/control | cut -d ':' -f 2-)
  18. license=$(grep -m 1 'License:' debian/copyright | cut -d ':' -f 2-)
  19. version=$(grep -m 1 '(' debian/changelog | cut -d '(' -f 2- | cut -d ')' -f 1 | cut -d '-' -f 1)
  20.  
  21. msg_tempfile="$(mktemp)"
  22.  
  23. echo "Package: wnpp
  24. Owner: Sergey \"Shnatsel\" Davidoff <sergey@elementaryos.org>
  25. Severity: wishlist
  26.  
  27. * Package name    : $package_name
  28.  Version         : $version
  29.  Upstream Author : elementary Developers
  30. * URL             : https://launchpad.net/$project_name
  31. * License         : $license
  32.  Programming Lang: Vala
  33.  Description     : $description
  34.  
  35. This is a part of my Google Summer of Code project on packaging elementary software for Debian, see https://wiki.debian.org/SummerOfCode2014/Projects/PackageElementarySoftware for more information.
  36. " > "$msg_tempfile"
  37.  
  38. nano "$msg_tempfile"
  39.  
  40. echo -n "Submit the ITP to Debian bug tracking system? [y/N]: "
  41. read
  42. if ( echo "$REPLY" | grep -q -i 'y' ); then
  43.     cat "$msg_tempfile" | mail -s "ITP: $package_name -- $description" submit@bugs.debian.org
  44. else
  45.     echo "Not submitting. The generated text is available at $msg_tempfile"
  46. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement