Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users Deutsches Forum (German) Deutsche Dokumentation
  • Search

[obsolet] Gentoo news mit git sync

Dokumentation, Tipps und Tricks.
Post Reply
  • Print view
Advanced search
3 posts • Page 1 of 1
Author
Message
ulenrich
Veteran
Veteran
Posts: 1483
Joined: Sun Oct 10, 2010 9:26 pm

[obsolet] Gentoo news mit git sync

  • Quote

Post by ulenrich » Wed Nov 18, 2015 11:33 pm

[edit] OBSOLET - post below.
@bell, Danke für den Tip

---
Wenn man die Git Methode benutzt um sehr schnell den Portage Tree zu aktualisieren, bekommt man aber keine News mehr. Oder habe ich eine Möglichkeit nicht gesehen? Jetzt habe ich mir erstmal diese Methode ausgedact: /etc/cron.daily/gentoonews

Code: Select all

#!/bin/bash
temp="${TMPDIR:=/tmp}/www.gentoo.org/support/news-items"
pdir="/usr/share/portage/metadata"
debug=0

[ ${debug} -gt 2 ] \
   &&set -x

[ -d "${pdir}" ] \
   ||pdir="$(portageq get_repo_path / gentoo)/metadata"

[ ! -d "${pdir}" ] \
   &&echo "ERROR gentoo repository" \
   &&exit

[ ${debug} -lt 2 ] \
  &&quiet="-q"     \
  ||quiet=""

mkdir -p $temp     \
  &&cd  ${TMPDIR}  \
  &&wget ${quiet} --no-parent --no-clobber  --continue \
    --recursive https://www.gentoo.org/support/news-items/index.html

pdir="${pdir}/news"
cd ${temp}

for i in 20*.html; do
    [ ! -f $i ] \
       &&echo "WARN not exists $i" \
       &&continue
    cat "${temp}/$i" \
       |sed -n -e'/^Title: /,/<.pre>/b show' \
               -e'b'            \
               -e':show'        \
               -e'/<.pre>/Q'    \
               -e"s/&#39./\'/g" \
               -e's/&lt;/</g'   \
               -e's/&gt;/>/g'   \
               -e's/&quot;/\"/g'\
               -e's/&amp;/\&/g' \
               -e'p' >"${temp}/${i%%.html}.en.txt"

    rm   "${temp}/$i"
done

for j in *.en.txt ; do
    [ ! -f $j ] \
       &&echo "ERROR not exists $j" \
       &&continue

    a="${j%%.en.txt}"

    if /usr/bin/diff -w -B "$j" "${pdir}/$a/$j"; then
       rm   "${temp}/$j"

       [ ${debug} -gt 0 ]  \
          &&echo "OK -- ${pdir}/$a/$j"
    else
       [ ! -d  "${pdir}/$a" ]         \
          &&mkdir -p "${pdir}/$a"

       [ ! -d  "${pdir}/$a" ]            \
          &&echo "ERROR mkdir ${pdir}/$a" \
          &&continue

       [ -f    "${pdir}/$a/$j" ] \
          &&[   ${debug} -gt 1 ] \
          &&cp "${temp}/$j" "${temp}/$j.sic"  \
          &&echo "WARN diff  ${temp}/$j.sic"

       [ -f    "${pdir}/$a/$j" ] \
          &&rm "${pdir}/$a/$j"

       cp "$j" "${pdir}/$a/$j"  \
          &&rm    "${temp}/$j"  \
          ||echo "ERROR cp $j"

       grep -q   "$a"   /var/lib/gentoo/news/news-gentoo.{read,skip,unread} \
          ||echo "$a" >>/var/lib/gentoo/news/news-gentoo.unread
    fi
done 
Last edited by ulenrich on Thu Dec 17, 2015 10:49 pm, edited 3 times in total.
Top
bell
Guru
Guru
User avatar
Posts: 524
Joined: Tue Nov 27, 2007 8:48 am

  • Quote

Post by bell » Fri Dec 11, 2015 10:49 am

Also bei mir kommen auch über Git die News an.
Du nutzt wahrscheinlich https://github.com/gentoo/gentoo. In diesem wird das "metadata" Verzeichnis wohl nicht gepflegt.
Ich nutze den https://github.com/gentoo-mirror/gentoo. Dort sind die Metadaten aktuell.
Top
mv
Watchman
Watchman
User avatar
Posts: 6795
Joined: Wed Apr 20, 2005 12:12 pm

  • Quote

Post by mv » Fri Apr 22, 2016 5:37 pm

Richtig obsolet ist die Sache nicht:
Erstens sind die Spiegel mit Metadaten nicht offiziell, zweitens speicherst Du dann natürlich auch die "Geschichte" der Metadaten auf Deine Platte, was vermutlich vehrältnismäßig schnell viel Speicher kostet (weil sich bei jedem eclass-Update Hunderte von diesen Dateien ändern).
Es gibt allerdings Scripte, die die Metadaten berechnen, und insbesondere auch die News upgraden. Wenn ich mich recht erinnere, findet man die irgendwie indirekt über die Beschreibung zum git-syncen im gentoo-wiki.
Top
Post Reply
  • Print view

3 posts • Page 1 of 1

Return to “Deutsche Dokumentation”

Jump to
  • Assistance
  • ↳   News & Announcements
  • ↳   Frequently Asked Questions
  • ↳   Installing Gentoo
  • ↳   Multimedia
  • ↳   Desktop Environments
  • ↳   Networking & Security
  • ↳   Kernel & Hardware
  • ↳   Portage & Programming
  • ↳   Gamers & Players
  • ↳   Other Things Gentoo
  • ↳   Unsupported Software
  • Discussion & Documentation
  • ↳   Documentation, Tips & Tricks
  • ↳   Gentoo Chat
  • ↳   Gentoo Forums Feedback
  • ↳   Duplicate Threads
  • International Gentoo Users
  • ↳   中文 (Chinese)
  • ↳   Dutch
  • ↳   Finnish
  • ↳   French
  • ↳   Deutsches Forum (German)
  • ↳   Diskussionsforum
  • ↳   Deutsche Dokumentation
  • ↳   Greek
  • ↳   Forum italiano (Italian)
  • ↳   Forum di discussione italiano
  • ↳   Risorse italiane (documentazione e tools)
  • ↳   Polskie forum (Polish)
  • ↳   Instalacja i sprzęt
  • ↳   Polish OTW
  • ↳   Portuguese
  • ↳   Documentação, Ferramentas e Dicas
  • ↳   Russian
  • ↳   Scandinavian
  • ↳   Spanish
  • ↳   Other Languages
  • Architectures & Platforms
  • ↳   Gentoo on ARM
  • ↳   Gentoo on PPC
  • ↳   Gentoo on Sparc
  • ↳   Gentoo on Alternative Architectures
  • ↳   Gentoo on AMD64
  • ↳   Gentoo for Mac OS X (Portage for Mac OS X)
  • Board index
  • All times are UTC
  • Delete cookies

© 2001–2026 Gentoo Foundation, Inc.

Powered by phpBB® Forum Software © phpBB Limited

Privacy Policy