Browse Source

security mirror, command line commit specification

pull/4/head
devrandom 12 years ago
parent
commit
d765459667
  1. 4
      README.md
  2. 19
      bin/gbuild
  3. 3
      bin/make-base-vm

4
README.md

@ -25,6 +25,10 @@ Then execute the build using a YAML description file (can be run as non-root): @@ -25,6 +25,10 @@ Then execute the build using a YAML description file (can be run as non-root):
bin/gbuild <package>-desc.yml
or if you need to specify a commit for one of the git remotes:
bin/gbuild --commit <dir>=<hash> <package>-desc.yml
The resulting report will appear in result/\<package\>-res.yml
## Poking around

19
bin/gbuild

@ -109,6 +109,9 @@ OptionParser.new do |opts| @@ -109,6 +109,9 @@ OptionParser.new do |opts|
opts.on("-q", "--quiet", "be quiet") do |v|
@options[:skip_image] = v
end
opts.on("-c PAIRS", "--commit PAIRS", "comma separated list of DIRECTORY=COMMIT pairs") do |v|
@options[:commit] = v
end
end.parse!
base_dir = Pathname.new(__FILE__).expand_path.dirname.parent
@ -146,6 +149,22 @@ build_desc["files"].each do |filename| @@ -146,6 +149,22 @@ build_desc["files"].each do |filename|
in_sums << `cd inputs && sha256sum #{filename}`
end
commits = {}
if @options[:commit]
@options[:commit].split(',').each do |pair|
(dir, commit) = pair.split('=')
commits[dir] = commit
end
end
build_desc["remotes"].each do |remote|
if !remote["commit"]
remote["commit"] = commits[remote["dir"]]
raise "must specify a commit for directory #{remote["dir"]}" unless remote["commit"]
end
end
base_manifests = YAML::Omap.new
suites.each do |suite|

3
bin/make-base-vm

@ -4,6 +4,7 @@ set -e @@ -4,6 +4,7 @@ set -e
SUITE=lucid
ARCH=amd64
MIRROR=http://${MIRROR_HOST:-`hostname`}:3142/archive.ubuntu.com/ubuntu
SECURITY_MIRROR=http://${MIRROR_HOST:-`hostname`}:3142/security.ubuntu.com/ubuntu
usage() {
echo "Usage: ${0##*/} [OPTION]... <command>"
@ -60,7 +61,7 @@ fi @@ -60,7 +61,7 @@ fi
rm -rf $OUT
sudo vmbuilder kvm ubuntu --arch=$ARCH --suite=$SUITE --addpkg=openssh-server,pciutils,build-essential,git-core,subversion --ssh-key=var/id_dsa.pub --ssh-user-key=var/id_dsa.pub --mirror=$MIRROR --dest=$OUT --flavour=virtual --overwrite
sudo vmbuilder kvm ubuntu --arch=$ARCH --suite=$SUITE --addpkg=openssh-server,pciutils,build-essential,git-core,subversion --ssh-key=var/id_dsa.pub --ssh-user-key=var/id_dsa.pub --mirror=$MIRROR --security-mirror=$SECURITY_MIRROR --dest=$OUT --flavour=virtual
mv $OUT/*.qcow2 $OUT.qcow2

Loading…
Cancel
Save