[CentOS-docs] Automated RPMForge Repository Installation Script for Tips & Tricks section

Thu Jun 11 14:22:36 UTC 2009
Christoph Maser <cmr at financial.com>

Am Donnerstag, den 11.06.2009, 16:01 +0200 schrieb Vladislav Rastrusny:
> Hello.
>
> With the help of the community I finished polishing the translation of
> my PHP script to Bash version
> http://www.centos.org/modules/newbb/viewtopic.php?viewmode=flat&topic_id=20222&forum=38
>
> It has now autodetection of architecture and CentOS version and handles errors.
>
> I have published an article under my homepage here:
> http://wiki.centos.org/VladislavRastrusny/AutoRPMForgeRepo
>
> Since no automated RPM to install RPMForge repo was added to native
> CentOS repositories, I think my article can be included to Tips &
> Tricks section. And, probably, linked from here:
> http://wiki.centos.org/AdditionalResources/Repositories/RPMForge.
> Manually performing all changes from here is a hard job ;)
>
> Please tell me, what should I improve in this article if anything?
>
> Best regards,
> Vladislav "FractalizeR" Rastrusny
> _______________________________________________
> CentOS-docs mailing list
> CentOS-docs at centos.org
> http://lists.centos.org/mailman/listinfo/centos-docs


It would be much nicer if you could replace the "command ; if [ $? !=
0 ] then echo ...; exit 1; with a sub. So you could do
  command || _myexit "Comment"

You can als run all sed statements in a single sed call.

  sed -i -e 'replace1' -e 'replace2' -e 'replace3' <file>

If you want to massdeploy repositories you should also consider using
configuration management eg. cfengine, puppet, spacewalk.





financial.com AG

Munich head office/Hauptsitz München: Maria-Probst-Str. 19 | 80939 München | Germany
Frankfurt branch office/Niederlassung Frankfurt: Messeturm | Friedrich-Ebert-Anlage 49 | 60327 Frankfurt | Germany
Management board/Vorstand: Dr. Steffen Boehnert (CEO/Vorsitzender) | Dr. Alexis Eisenhofer | Dr. Yann Samson | Matthias Wiederwach
Supervisory board/Aufsichtsrat: Dr. Dr. Ernst zur Linden (chairman/Vorsitzender)
Register court/Handelsregister: Munich – HRB 128 972 | Sales tax ID number/St.Nr.: DE205 370 553