Advertisement
Guest User

spec2bb.inc

a guest
Apr 3rd, 2013
358
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.84 KB | None | 0 0
  1. usage()
  2. {
  3. cat << EOF
  4. usage: $0 options
  5.  
  6. Converts rpm spec file to bitbake recipe format.
  7.  
  8. OPTIONS:
  9.     -f      Don't search for package files
  10.     -h      Show this message
  11.     -i      Input file this should be a *.spec file
  12.     -o      Output file eg: somefile.bb, leave blank to use STDOUT
  13. EOF
  14. }
  15.  
  16. OUTFILE=
  17. SPECFILE=
  18. PKGFILES=
  19.  
  20. while getopts “fh:i:o:” OPTION
  21. do
  22.      case $OPTION in
  23.          f)
  24.              PKGFILES=1
  25.              ;;
  26.          h)
  27.              usage
  28.              exit 1
  29.              ;;
  30.          i)
  31.              SPECFILE=$OPTARG
  32.              ;;
  33.          o)
  34.              OUTFILE=$OPTARG
  35.              ;;
  36.          ?)
  37.              usage
  38.              exit
  39.              ;;
  40.      esac
  41. done
  42.  
  43.  
  44. if [[ -z $SPECFILE ]]
  45. then
  46.     usage
  47.     exit 1
  48. fi
  49.  
  50. if [[ -z $OUTFILE ]]
  51. then
  52.     OUTFILE="$$tmpfile.~"
  53. fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement