Changes between Version 6 and Version 7 of archives
- Timestamp:
- Jul 3, 2011, 3:52:13 PM (13 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
archives
v6 v7 1 1 = Using Your Own Archives = 2 MacPorts recently added the ability to verify archives when `archivemode` is enabled. Signing archives is basically a requirement now. This page will serve as a guide showing how to do this.2 MacPorts verifies archives when `archivemode` is enabled, making the signing archives a requirement. This page will serve as a guide showing how to do this. 3 3 4 4 = Create Keys = … … 26 26 {{{ 27 27 cd /archive/repository 28 for i in */* /*/*tbz2; do openssl dgst -ripemd160 -sign ~/.ssh/privkey.pem.bare -out $i.rmd160 $i; done28 for i in */*tbz2; do openssl dgst -ripemd160 -sign ~/.ssh/privkey.pem.bare -out $i.rmd160 $i; done 29 29 }}} 30 Note that this saves the signatures along side the archives, by simply using `.rmd160` as a suffix. This is what MacPorts presentlyexpects.30 Note that this saves the signatures along side the archives, by simply using `.rmd160` as a suffix. This is what MacPorts expects. 31 31 32 32 = Configure MacPorts = … … 35 35 * add path to this copy in pubkeys.conf 36 36 37 I saved my key as `/opt/local/etc/macports/snc.pub` for simplicity. To avoid naming collisions I suggest adding all custom keys to just one file.37 I used `${prefix}/etc/macports/snc.pub` for simplicity. 38 38 39 39 = Try It = … … 43 43 Each day (really, every 30 minutes) new ports arrive and several are updated. Rather than rebuilding the whole tree you'll want to go after the ones with changes. This is easily achieved by the `find` command. 44 44 {{{ 45 cd /opt/local/var/macports/sources/rsync.macports.org/release/ports45 cd ${prefix}/var/macports/sources/rsync.macports.org/release/ports 46 46 sudo port selfupdate 47 47 find . -name Portfile -mtime -1d | while read i … … 51 51 }}} 52 52 53 As you build archives, you'll eventually come across an instance where you're upgrading an older version. Keeping these outdated archives around might be less than ideal. We can wipe them out by looping through the repositorychecking the versions against what's current.53 As you build archives, you'll eventually come across an instance where you're upgrading an older version. Keeping these outdated archives around might be less than ideal. We can wipe them out as we build the updates in the repository, checking the versions against what's current. 54 54 {{{ 55 55 cd /archive/repository 56 56 sudo port selfupdate 57 for i in * /*/*57 for i in * 58 58 do 59 59 port -q info --index --version `basename $i` | while read j 60 60 do 61 ls $i | grep -v $j| while read k61 ls "$i" | grep -v "$j" | while read k 62 62 do 63 sudo rm -v $i/$k63 sudo rm -v "$i/$k" 64 64 done 65 65 done 66 66 done 67 67 }}} 68 69 This can also be accomplished using `rsync` between a build box and a web server. After syncing you'd run a `sign_archives` routine described above. 70 {{{ 71 for i in ${prefix}/var/macports/software/* 72 do 73 port -q info --index --version `basename $i` | while read j 74 do 75 rsync -az --delete --filter "P *$j*" "$i" snc@tazamahal.com:/var/www/macports/ 76 done 77 done 78 ssh snc@tazamahal.com sign_archives.sh 79 }}}