Permalink
Browse files

Migrate mocksetup-first to use getopts to better support multiple req…

…uired packages

And add rubygem-gem2rpm as a required package
  • Loading branch information...
1 parent 99afae6 commit a324af223e8c4f042a1a1b5d426e72e5ab5ee9a3 @erikogan erikogan committed Dec 4, 2010
Showing with 17 additions and 5 deletions.
  1. +1 −1 build/rpm.rb
  2. +16 −4 rpm/release/mocksetup-first.sh
View
@@ -77,7 +77,7 @@ def fetch(dir)
desc "Build a Yum repository for the current release"
task 'yum' => :rpm_verbosity do
- test_setup('--need-createrepo')
+ test_setup(*%w{-p createrepo -p rubygem-gem2rpm})
create_tarball(@verbosity)
# Add a single -v for some feedback
noisy_system(*(%w{./rpm/release/build.rb --stage-dir=yum-repo --extra-packages=release/mock-repo} + @build_verbosity))
@@ -9,10 +9,22 @@ else
required_packages=( ${required_packages[@]} rpm-build )
fi
-if [ "$1" == '--need-createrepo' ] ; then
- shift
- required_packages=( ${required_packages[@]} createrepo )
-fi
+while getopts ':p:' opt
+do
+ case $opt in
+ p)
+ required_packages=( ${required_packages[@]} $OPTARG )
+ ;;
+ \?)
+ echo "Invalid flag -$OPTARG" >&2
+ exit 255
+ ;;
+ \:)
+ echo "missing argument to -$OPTARG" >&2
+ exit 127
+ ;;
+ esac
+done
repo=${1:-/var/lib/mock/passenger-build-repo}
etc=${2:-/etc/mock}

0 comments on commit a324af2

Please sign in to comment.