====== Zypper-Repos an Smart übergeben ====== Heute saß ich am PC, tippte ''smart update'' und der Paketmanager smart war der Meinung, dass er alle Channel entfernene solle. Anscheinend war ein Update eingetroffen, das mal so nebenbei ein ''rm -rf /etc/smart/channels/*'' abgesetzt hat, und meine mühsam synchronisierten Kanäle waren weg :-( Also: wie kann ich ''smart'' überreden, die Repositorioes von ''zypp'' zu benutzen? Ein kleines Shellscript reicht: #!/bin/bash # this script is intended to copy zypper repositories to smart sources # written by Werner Flamme 2009-02-14 ZYPPERDIR=/etc/zypp/repos.d SMARTDIR=/etc/smart/channels # loop over all zypper repositories for DAT in $ZYPPERDIR/*.repo; do # do we have to care about the repo? grep -q 'enabled=0' "$DAT" && continue # get the name of the repo, so that it will be understood by smart FIRSTPART=$(basename "$DAT" '.repo') # where do we write to? NEWFILE="$SMARTDIR/${FIRSTPART}.channel" # write the channel's name echo "[$FIRSTPART]" > "$NEWFILE" echo "Alias = $FIRSTPART" >> "$NEWFILE" # get the zypper repo info we need BASEURL=$(grep 'baseurl=' "$DAT") REPOTYPE=$(grep 'type=' "$DAT") echo "$BASEURL" >> "$NEWFILE" echo "$REPOTYPE" >> "$NEWFILE" done Damit erstelle ich aus jedem aktiven Zypper-Repository einen Smart-Kanal. Und zwar recht schnell... ;-) Anschließend noch ein ''%%smart channel --show%%'', damit smart alle neuen Kanäle einliest, und noch ein ''%%smart channel --show > /etc/smart/channelsik%%'', um eine Sicherungskopie der Channel anzulegen :-). Damit sollte das nächste Update keine Probleme mehr bereiten ;-)