Go Back   openSUSE Forums > Archives > SLS Archives > ARCHIVES - Linux Tweaks > ARCHIVES - Tips, Tricks & Tweaks
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Tips, Tricks & Tweaks Post your tips, tricks and tweaks about SuSE Linux in here. Please do not ask questions here - this is for factual information

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 12-Apr-2008, 02:23
thidney
Guest
 
Posts: n/a
Default

I have about 30 repos in my 10.3 box, and zypper became realy realy slow when refreshing cache. So I write this small script to sync zypper repositories with smart (one way !)
Hope it helps. Use at own risk.
Code:
#/!/bin/bash

smart channel --remove-all
zypper -v sl | awk -F "\|" '
$0 !~ /^[-]/
{
********gsub(/(^[ ]*)|([ ]*$)/,"",$4)
********type=$4
********gsub(/(^[ ]*)|([ ]*$)/,"",$5)
********alias=$5
********gsub(/(^[ ]*)|([ ]*$)/,"",$7)
********uri=$7
********if ( type =="NONE"){
****************print "unknown type for repository "alias
********}
********else{
****************reti=sprintf ("smart channel --add**\"%s\" type=\"%s\" 
name=\"%s\" baseurl=\"%s\" -y" ,alias,type,alias,uri)
****************system(reti)
********}
}'
smart channel --show
smart update
after update finish run [smart --gui] [/code] to install any package

 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2