ReleaseEngineering/PuppetAgain/Packages: Difference between revisions

Line 263: Line 263:
Now, build a custom repository (or possibly two, one for each architecture) on the distinguished master for the purpose.  For example, if you're updating openssh, create a new {{PuppetAgain Repo|repos/apt/custom/openssh}}.  If the appropriate repo already exists, use it.
Now, build a custom repository (or possibly two, one for each architecture) on the distinguished master for the purpose.  For example, if you're updating openssh, create a new {{PuppetAgain Repo|repos/apt/custom/openssh}}.  If the appropriate repo already exists, use it.


To build a custom repository, you'll need an Ubuntu system with apt-utils installedA package builder host will do the trick, but the host's details aren't importantSet up a directory containing the proper packages under <tt>pool/</tt> (although the nested <tt>o/openssh/</tt> directories are not required), run
To build a custom repository, start by laying out your package poolThe best plan is to divide the packages by distFor example:
<pre>
[root@releng-puppet2.srv.releng.scl3.mozilla.com openssl]# find pool/
pool/
pool/trusty
pool/trusty/openssl_1.0.1f-1ubuntu2.5_i386.deb
pool/trusty/openssl_1.0.1.orig.tar.gz
pool/trusty/libssl1.0.0-dbg_1.0.1f-1ubuntu2.5_i386.deb
...
pool/precise
pool/precise/libssl1.0.0_1.0.1-4ubuntu5.17_i386.deb
...
</pre>
Then edit an update.sh in the root of the repository with something along the lines of
<pre>
<pre>
for arch in i386 amd64; do
for arch in i386 amd64; do
   for dist in precise trusty; do
   for dist in precise trusty; do
     mkdir -p dists/${dist}-updates/all/binary-$arch
     mkdir -p dists/${dist}/all/binary-$arch
     apt-ftparchive --arch $arch packages . > dists/${dist}-updates/all/binary-$arch/Packages
     dpkg-scanpackages --arch $arch pool/$dist > dists/${dist}/all/binary-$arch/Packages
     bzip2 < dists/${dist}-updates/all/binary-$arch/Packages > dists/${dist}-updates/all/binary-$arch/Packages.bz2
     bzip2 < dists/${dist}/all/binary-$arch/Packages > dists/${dist}/all/binary-$arch/Packages.bz2
   done
   done
done
done
</pre>
</pre>
in that directory to update the apt indexes -- in this case for both precise (12.04) and trusty (14.04).  It's best to put this in <tt>update.sh</tt> in the root of the repo so that the next person to update the repo can do the same.  You might want to add or remove "-updates" from the script, or change "all" to some other section.
This script will update the apt indexes.


Don't forget to run ''puppetmaster-fixperms'' afterward to make sure permissions are correct.
Don't forget to run ''puppetmaster-fixperms'' afterward to make sure permissions are correct.
canmove, Confirmed users
1,394

edits