Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users Polskie forum (Polish)
  • Search

[forum] Przydatne skrypty w ogole i w szczegole

Witajcie na polskim forum użytkowników Gentoo!
Opis instalacji i pracy z Gentoo. Pozostała dokumentacja Gentoo

Moderator: SlashBeast

Post Reply
  • Print view
Advanced search
36 posts
  • 1
  • 2
  • Next
Author
Message
fallow
Bodhisattva
Bodhisattva
User avatar
Posts: 2208
Joined: Thu Jan 08, 2004 12:53 pm
Location: Poland

[forum] Przydatne skrypty w ogole i w szczegole

  • Quote

Post by fallow » Wed Jan 12, 2005 10:41 am

tak jak kiedys byl pomysl utworzenia sticky ze zbiorem how-to na polskim forum :
- watek do dyskusji o sticky how-to : http://forums.gentoo.org/viewtopic.php?t=176719
- sticky how-to http://forums.gentoo.org/viewtopic.php?t=177544

tak teraz taki sam pomysl ale ze zbiorem przydatnych skryptow takich jak np. ten ktory pokazuje procent skompilowania emergowanego pakietu :

Code: Select all

#!/bin/bash 
#eprogress v0.0.1, July 13, 2004 

#When given a package name this scipt is will track the progress of an ebuild by counting the number of .c and .cpp files in the portage temp directory and comparing it to the number of .o files that have been compiled so far. 

#When run without arguements it's useful for locating previous failed or interrupted ebuilds so they can be attempted again or deleted manually to free space. 

cd /var/tmp/portage 
printf "%40s%8s%8s%8s%9s" "PACKAGE" "TOTAL" "LEFT" "DONE" "PERCENT"; echo 
for i in $1*; do 
   A=`find $i/ -iname "*.c*" | wc -l` 
   if test $A -eq 0; then continue; fi 
   B=`find $i/ -iname "*.o*" | wc -l` 
   C=$[$A-$B] 
   D=`expr $B \* 100 / $A` 
   if test $D -gt 100; then D="??"; fi 
   printf "%40s%8s%8s%8s%7s" "$i" "$A" "$C" "$B" "$D"; echo 
done
zalozylem ten watek aby wspolnie przedyskutowac ten pomsyl jeszcze przed utworzeniem sticky o skryptach.

chodzi glownie o to :

1) - czy ma miec to taka budowe jak sticky o how-to , a skrypty zglaszane do niego by w pierwszym poscie byl zbior - nie musza byc wlasnego autorstwa
2) - czy ma byc to po prostu jeden "ciag" postow
3) - czy ciag postow a w pierwszym poscie sukcesywne wskazania do postow w watku zawierajacych skrypt.
"Time is a companion that goes with us on a journey. It reminds us to cherish each moment, because it will never come again. What we leave behind is not as important as how we have lived" J-L. Picard ;)
Top
milu
Bodhisattva
Bodhisattva
User avatar
Posts: 1122
Joined: Mon May 03, 2004 9:49 pm
Location: Poland, Konstancin-Jeziorna

  • Quote

Post by milu » Wed Jan 12, 2005 2:55 pm

Wg mnie:
2 sposób odpada już na starcie - ciężko znaleźć skrypt(trzeba przeczesać cały wątek).
Pozostaje więc 1 albo 3. 3 sposób ma jedną wadę - dyskusje na temat różnych skryptów są toczone w tym samym wątku - dyskusje o różnych skryptach poprzeplatane miedzy sobą.
Drogą eliminacji pozostał punkt 1 i typuję go jako zwycięzcę - dyskusje i unowocześnienia skryptów nie będą się plątały pomiedzy sobą bo 1 wątek=1 skrypt i skrypty powinny być dość łatwe do przejrzenia.
Pozdrawiam,
Milu
------------------------------------
Registered Linux User: #246079

Zanim zadasz pytanie przeczytaj to dokładnie!!
Top
Strus
l33t
l33t
Posts: 780
Joined: Mon Apr 19, 2004 7:36 pm
Location: Poland - Bochnia
Contact:
Contact Strus
Website

  • Quote

Post by Strus » Wed Jan 12, 2005 4:32 pm

Tu nie ma co głosować, tylko trzeba robić co napisane w pkt. 1 :D
Pomysł dobry i co najważniejsze sprawdzony.
Top
madman
Apprentice
Apprentice
Posts: 161
Joined: Thu Mar 11, 2004 8:26 pm
Location: Lodz, Poland

  • Quote

Post by madman » Wed Jan 12, 2005 6:00 pm

oczywiscie pkt. 1
Kto jest twoim autorytetem moralnym i dlaczego jest nim JPII ?
Top
Poe
Bodhisattva
Bodhisattva
User avatar
Posts: 2155
Joined: Sat Apr 03, 2004 5:57 pm
Location: Mysłowice/Lublin, Poland
Contact:
Contact Poe
Website

  • Quote

Post by Poe » Wed Jan 12, 2005 6:02 pm

"Jedyneczka" ;) IMHO najlepsza...
Hardware:HP Pavilion DV6875SE[C2DT5550@1.83GHz_3GB-DDR2_320GB-SATA_GF8400GS]
http://popularcoffee.blogspot.com - Popkulturowa Kawa
RLU#342333
Top
senu
n00b
n00b
User avatar
Posts: 31
Joined: Sat Oct 02, 2004 7:35 am
Location: /dev/urandom

  • Quote

Post by senu » Wed Jan 12, 2005 6:51 pm

pkt jeden
Top
fallow
Bodhisattva
Bodhisattva
User avatar
Posts: 2208
Joined: Thu Jan 08, 2004 12:53 pm
Location: Poland

  • Quote

Post by fallow » Wed Jan 12, 2005 7:07 pm

dobra : ostatecznie bedzie tak jak w pkt.1

po utworzeniu tego sticky podam w nim ze do dyskusji i zglaszania skyptow bedzie sluzyl ten wlasnie watek ktory obecnie czytamy :)

cheers :)
"Time is a companion that goes with us on a journey. It reminds us to cherish each moment, because it will never come again. What we leave behind is not as important as how we have lived" J-L. Picard ;)
Top
Poe
Bodhisattva
Bodhisattva
User avatar
Posts: 2155
Joined: Sat Apr 03, 2004 5:57 pm
Location: Mysłowice/Lublin, Poland
Contact:
Contact Poe
Website

  • Quote

Post by Poe » Wed Jan 12, 2005 7:16 pm

To ja moze juz zapodam skrypcik (od razu mowie, ze nie mojego autrostwa, poki co jeszcze sie za to nie bralem :) ), dzieki ktoremu mozna zrobic, np emerge -e world/system "na raty"

Code: Select all

#!/bin/bash                                                                     
 while true                                                                     
 do                                                                             
         CURRENT_PACKAGE=`head -n 1 file.lst`                                   
         if [ ! -n "$CURRENT_PACKAGE" ]; then                                   
                 exit 0                                                         
         else                                                                   
                 emerge --oneshot =$CURRENT_PACKAGE                             
                 grep -v "$CURRENT_PACKAGE" file.lst > file.ls1                 
                 mv file.ls1 file.lst                                           
         fi                                                                     
 done                                           
Hardware:HP Pavilion DV6875SE[C2DT5550@1.83GHz_3GB-DDR2_320GB-SATA_GF8400GS]
http://popularcoffee.blogspot.com - Popkulturowa Kawa
RLU#342333
Top
nelchael
Retired Dev
Retired Dev
User avatar
Posts: 1948
Joined: Sat Mar 20, 2004 9:15 am
Location: /dev/drzewo
Contact:
Contact nelchael
Website

  • Quote

Post by nelchael » Wed Jan 12, 2005 7:33 pm

To ja tez sobie cos zglosze :) -> nowy watek :)
[color=gray:17697d0166]http://dev.gentoo.org/~nelchael/[/color:17697d0166]

[size=14:17697d0166]>> [b:17697d0166]Zasady na f.g.o->Polish[/b:17697d0166] <<[/size:17697d0166]
Top
Rav70
l33t
l33t
User avatar
Posts: 607
Joined: Wed Feb 11, 2004 8:27 pm
Location: Poland

  • Quote

Post by Rav70 » Wed Jan 12, 2005 9:09 pm

Poe wrote:To ja moze juz zapodam skrypcik (od razu mowie, ze nie mojego autrostwa, poki co jeszcze sie za to nie bralem :) ), dzieki ktoremu mozna zrobic, np emerge -e world/system "na raty"

Code: Select all

#!/bin/bash                                                                     
 while true                                                                     
 do                                                                             
         CURRENT_PACKAGE=`head -n 1 file.lst`                                   
         if [ ! -n "$CURRENT_PACKAGE" ]; then                                   
                 exit 0                                                         
         else                                                                   
                 emerge --oneshot =$CURRENT_PACKAGE                             
                 grep -v "$CURRENT_PACKAGE" file.lst > file.ls1                 
                 mv file.ls1 file.lst                                           
         fi                                                                     
 done                                           
Mógłbyś jeszcze dla porządku dodać że listę pakietów tworzy się np przez:

Code: Select all

emerge -ep world | grep '\[ebuild' | sed -e 's/.*] //' > file.lst
Musi on mieć format

Code: Select all

kategoria/pakiet-wersja
po jednym pakiecie w linii.
Pozdr. Rav
Q: Why is Microsoft's Product Support a failure?
A: Because Microsoft needs a Support Group instead.
Top
madman
Apprentice
Apprentice
Posts: 161
Joined: Thu Mar 11, 2004 8:26 pm
Location: Lodz, Poland

  • Quote

Post by madman » Thu Jan 13, 2005 1:19 pm

oto prosciutki ale jakze przydatny skrypcik :)

Code: Select all

#! /bin/bash
directory=/path/to/dir/*
find $directory -depth -type d -exec chmod xxx {} \;
find $directory -depth -type f -exec chmod yyy {} \;
skypt zmienia uprawnienia osobno do plikow i osobno do katalogow wewnatrz zadanego przez nas katalogu
Kto jest twoim autorytetem moralnym i dlaczego jest nim JPII ?
Top
Poe
Bodhisattva
Bodhisattva
User avatar
Posts: 2155
Joined: Sat Apr 03, 2004 5:57 pm
Location: Mysłowice/Lublin, Poland
Contact:
Contact Poe
Website

  • Quote

Post by Poe » Fri Jan 14, 2005 6:44 pm

znalazlem u siebie na dysku ciekawy skrypcik, ale niestety nie pamiętam dokladnie na jakiej zasadzie dziala i nie jestem pewien do czego sluzy (o ile dobrze pamietam do zwalaniania miejsca na dysku)

Code: Select all

#!/bin/bash 
 # 
 # Author: Ed Catmur <ed@catmur.co.uk> 
 # Licensed under the GNU Public License, version 2. 
 # 
 # Copyright Š Ed Catmur 2004 
 # Contains code believed to be copyright Š Gentoo Technologies, Inc. 
 
 has_version() { 
    if /usr/lib/portage/bin/portageq 'has_version' "${ROOT}" "$1"; then 
       return 0 
    else 
       return 1 
    fi 
 } 
 
 best_version() { 
    if /usr/lib/portage/bin/portageq 'best_version' "${ROOT}" "$1"; then 
       return 0 
    else 
       return 1 
    fi 
 } 
 
 # 
 # name:   python_version 
 # desc:   run without arguments and it will export the version of python 
 #         currently in use as $PYVER 
 # 
 python_version() { 
    local tmpstr 
    python=${python:-/usr/bin/python} 
    tmpstr="$(${python} -V 2>&1 )" 
    export PYVER_ALL="${tmpstr#Python }" 
 
    export PYVER_MAJOR=$(echo ${PYVER_ALL} | cut -d. -f1) 
    export PYVER_MINOR=$(echo ${PYVER_ALL} | cut -d. -f2) 
    export PYVER_MICRO=$(echo ${PYVER_ALL} | cut -d. -f3-) 
    export PYVER="${PYVER_MAJOR}.${PYVER_MINOR}" 
 } 
 
 ROOT="/" 
 
 # Files and directory trees to omit, ordered alphabetically. 
 # If a package drops files or directories in more than one place, move its 
 # definitions to the appropriate stanza. ldconfig symlinks go in the last 
 # stanza. Put large lists of single files next to the CONTENTS listing code. 
 PRUNE=" 
    /boot 
    /dev 
     
 $([ -h /etc/runlevels/boot/clock ]    && echo "/etc/adjtime") 
 $([ -d /proc/asound ]          && echo "/etc/asound.state") 
 $(has_version net-wireless/bluez-utils   && echo "/etc/bluetooth/link_key") 
    /etc/config-archive 
    $(echo /etc/cron.{hourly,daily,weekly,monthly}) 
    /etc/csh.env 
    /etc/dnsdomainname 
    $(echo /etc/env.d/??hostname) 
    $(echo /etc/env.d/??locale) 
 $(has_version dev-java/java-config   && echo "/etc/env.d/20java") 
 $(has_version sys-devel/prelink      && echo "/etc/env.d/99prelink") 
    /etc/gconf/gconf.xml.defaults 
    /etc/gentoo-release 
    /etc/group   /etc/group- 
    /etc/gshadow   /etc/gshadow- 
 $(has_version x11-libs/gtk+      && echo "/etc/gtk-2.0/gtk.immodules") 
    /etc/hostname 
    /etc/hosts 
    /etc/ioctl.save 
    /etc/ld.so.cache 
    /etc/ld.so.conf 
    /etc/localtime 
    /etc/make.conf 
    /etc/make.profile 
    /etc/modprobe.conf   /etc/modprobe.conf.old 
    /etc/modprobe.devfs   /etc/modprobe.devfs.old 
    /etc/modules.conf   /etc/modules.conf.old 
    /etc/motd 
    /etc/mtab 
 $(has_version x11-libs/pango      && echo "/etc/pango/pango.modules") 
    /etc/passwd   /etc/passwd- 
    /etc/portage 
 $(has_version net-dialup/ppp       && echo "/etc/ppp") 
 $(has_version sys-devel/prelink      && echo "/etc/prelink.cache") 
    /etc/profile.env 
    /etc/resolv.conf 
    /etc/runlevels 
 ... 
 $(has_version app-admin/syslog-ng   && echo "/var/run/syslog-ng.pid") 
    /var/run/utmp 
    $(echo /var/spool/cron/crontabs/*) 
    $(echo /var/spool/cron/lastrun/cron.{hourly,daily,weekly,monthly}) 
    /var/tmp/distfiles 
    /var/tmp/portage 
    /var/tmp/portage-pkg 
    /var/tmp/sync 
 " 
 
 # Packages which drop files or directories on more than one place go here, 
 # listed alphabetically by cp. 
 has_version app-text/docbook-sgml-dtd \ 
    && PRUNE="${PRUNE} 
    $(cat /var/db/pkg/app-text/docbook-sgml-dtd-*/SLOT | sed 's:^:/etc/sgml/sgml-docbook-:; s:$:.cat:') 
    /etc/sgml/sgml.cenv 
    /etc/sgml/sgml.env" 
 ... 
 has_version x11-misc/electricsheep \ 
    && PRUNE="${PRUNE} 
    $(echo /usr/share/electricsheep-{frown,smile,splash-{0,1}}.tif) 
    /var/cache/sheep" 
 
 # Packages which omit ldconfig symlinks (to test, delete the symlink and see 
 # if ldconfig recreates it). Specify at least to minor, these are ugly. 
 has_version '=gnome-extra/vfs-menu-applet-0.1*' \ 
    && PRUNE="${PRUNE}          /usr/lib/libvfsmenu-applet.0" 
 has_version '=net-fs/samba-3.0*' \ 
    && PRUNE="${PRUNE}          /usr/lib/libsmbclient.so.0" 
 has_version '=media-libs/xvid-1.0*' \ 
    && PRUNE="${PRUNE}          /usr/lib/libxvidcore.so.4" 
 has_version '=media-video/nvidia-glx-1.0*' \ 
    && PRUNE="${PRUNE}    /usr/X11R6/lib/libXvMCNVIDIA_dynamic.so.1" 
 
 # awk: filter out pyc and pyo files for which the corresponding .py exists 
 find / '(' -false $(echo $PRUNE | xargs -n 1 echo -or -path) \ 
    ')' -prune -or -print \ 
 | sort \ 
 | awk '/\.py$/ { py=$0; } $0 !~ "^"py"[co]$"' \ 
 >/tmp/allfiles 
 
 ( 
    echo "/" 
    # sed code stolen from qpkg 
    cat /var/db/pkg/*/*/CONTENTS \ 
    | sed -e "s:\(^obj \)\(.*\)\( .*\)\{2\}$:\2:; 
       s:\(^sym \)\(.*\)\( -> \)\(.*\)\( .*\)$:\2:; 
       s:\(^dir \)\(.*\)$:\2:" 
    # Generate cached man pages 
    for manx in /usr/share/man/man*; do 
       x=${manx#/usr/share/man/man} 
       for manp in $manx/*; do 
          p=${manp#$manx/}; 
          echo "/var/cache/man/cat$x/${p%.gz}.bz2" 
       done 
    done 
    # The gnome-games ebuild doesn't install scores files that already 
    # exist on the filesystem (silly!) 
    has_version gnome-extra/gnome-games \ 
       && for game in $( 
          cat /var/db/pkg/gnome-extra/gnome-games-*/CONTENTS \ 
          | grep '^obj /usr/bin/'\ 
          | sed "s:\(^obj \)/usr/bin/\(.*\)\( .*\)\{2\}$:\2:" 
       ); do 
          find /var/lib/games/${game}.*.scores /var/lib/games/${game}.scores 2>/dev/null 
       done 
 ) \ 
 | sort \ 
 | uniq \ 
 >/tmp/portagefiles 
 
 comm -2 -3 /tmp/allfiles /tmp/portagefiles 
Napewno jest to do czyszczenia niepotrzebnych skladnikow w systemie?... ehh.. tak to jest, jak sie zle podpisze skrypt, a z kodu nie umie sie zbyt wiele wydedukowac.... sorki, pozdrawiam
Hardware:HP Pavilion DV6875SE[C2DT5550@1.83GHz_3GB-DDR2_320GB-SATA_GF8400GS]
http://popularcoffee.blogspot.com - Popkulturowa Kawa
RLU#342333
Top
nelchael
Retired Dev
Retired Dev
User avatar
Posts: 1948
Joined: Sat Mar 20, 2004 9:15 am
Location: /dev/drzewo
Contact:
Contact nelchael
Website

  • Quote

Post by nelchael » Mon Jan 17, 2005 7:00 pm

Zgloszenie: http://forums.gentoo.org/viewtopic.php?t=278634
[color=gray:17697d0166]http://dev.gentoo.org/~nelchael/[/color:17697d0166]

[size=14:17697d0166]>> [b:17697d0166]Zasady na f.g.o->Polish[/b:17697d0166] <<[/size:17697d0166]
Top
milu
Bodhisattva
Bodhisattva
User avatar
Posts: 1122
Joined: Mon May 03, 2004 9:49 pm
Location: Poland, Konstancin-Jeziorna

  • Quote

Post by milu » Tue Feb 08, 2005 6:14 pm

Gentoo Linux Cron Update
Autor: Michael Panhorst
Oryginalny post: http://forums.gentoo.org/viewtopic.php? ... 52#1304452

Wymagania: mailx, esearch, gentoolkit
Sposób instalacji: Najprostszy - umieszczenie skryptu w katalogu /etc/cron.weekly, inny - umieszczenie w crontabie.

Opis: Skrypt służy do automatycznego synchronizowania komputera(zalecane raz na tydzień - chodzi głównie o obciążenie serwerów rsync)

Co robi skrypt:
1. emerge sync
2. fixpackages, jeśli trzeba
3. Sprawdzenie GLSA
4. Jeśli wystąpiły błędy przy emerge sync albo są nowe GLSA, skrypt wysyła email z informacją
5. Sprawdzenie czy są nowe wersje (emerge system or emerge world)
6. Paczkowanie nowych wersji jeśli spełnione są zależności(emerge -B)
7. Wysłanie emaila (jeśli są pakiety do zaktualizowania), a także informacji w jaki sposób tego dokonać (używając juz skompilowanych paczek - emerge -avK)

Code: Select all

#!/bin/bash 
# 
# 
# glcu - gentoo linux cron update 
# script for keeping your Gentoo linux up to date 
# 
# Version 0.65 - written by Michael Panhorst - Michael [at] untiefe [dot] de 
# 
# put this script in the /etc/cron.weekly directory 
# You need to have mailx, esearch and gentoolkit emerged 


# Set your eMail address first: 
EMAILADRESS=root 

# set if you want to test (and build) emerge 'system' or 'world' 
UPDATE=system 


################################################################ 
# You shouldn't need to change anything below this line 


PKGDIR="/usr/portage/packages" 
source /etc/make.conf  # in case you set PKGDIR different 
SUBJECT="glcu: New ebuilds for emerge $UPDATE on $HOSTNAME" 
FS="" 
EXTRA="" 

# 1. emerge sync ############## (sync first) #################### 

emerge sync 2>/tmp/emergesync.$$ 

# and run fixpackages (if needed) 

grep "Skipping packages. Run 'fixpackages' or set it in FEATURES" /tmp/emergesync.$$ 

if [ $? == 0 ] 
    then 
    echo "" >>/tmp/ecdep.$$ 
    echo "Running fixpackages" >>/tmp/ecdep.$$ 
    echo "" >>/tmp/ecdep.$$ 
    fixpackages 2>>/tmp/ecdep.$$ 
    echo "" >>/tmp/ecdep.$$ 
fi 

# 2. update database for esearch ################################ 

eupdatedb 2>>/tmp/emergesync.$$ 

# 3. glsa-check - check for security updates #################### 

glsa-check -l -n|grep " \[N\] " >/tmp/eupdate.$$ 
if [ $? == 0 ] 
    then 
    echo "" >>/tmp/emergesync.$$ 
    echo "----------------------------------------------------------------------" >>/tmp/emergesync.$$ 
    echo "Important Security updates for $HOSTNAME:" >>/tmp/emergesync.$$ 
    echo "" >>/tmp/emergesync.$$ 
    cat /tmp/eupdate.$$ >> /tmp/emergesync.$$ 
    echo "" >>/tmp/emergesync.$$ 
    echo "" >>/tmp/emergesync.$$ 
    echo "*** Run 'glsa-check --fix new' to auto-apply all security updates" >>/tmp/emergesync.$$ 
    echo "         ====================" >>/tmp/emergesync.$$ 
    echo "" >>/tmp/emergesync.$$ 
    echo "----------------------------------------------------------------------" >>/tmp/emergesync.$$ 

    FS="- SECURITY UPDATES!" 
fi 

# only send a mail if errors ocurred 
if [ -s /tmp/emergesync.$$ ] 
then 
    if [ -s /tmp/ecdep.$$ ] 
   then 
   cat /tmp/ecdep.$$ >> /tmp/emergesync.$$ 
    fi 
   cat /tmp/emergesync.$$ | mail -s "glcu($HOSTNAME): emerge sync $FS" $EMAILADRESS 
fi 



# 4. emerge -pv system/world (check for needed/new ebuilds) ### 

emerge --pretend --deep $UPDATE > /tmp/eupdate.$$ 2>&1 

# prebuild (emerge --buildpkgonly) all needed packages 

grep ebuild /tmp/eupdate.$$ 

if [ $? == 0 ] 
    then 
    echo "- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -" >> /tmp/ecdep.$$ 
    echo "List of new Packages:" > /tmp/ecdep.$$ 
    echo "---------------------" >> /tmp/ecdep.$$ 
    grep ebuild /tmp/eupdate.$$ >> /tmp/ecdep.$$ 
    echo "---------------------------------------------------------------------" >> /tmp/ecdep.$$ 

    for package in `cat /tmp/eupdate.$$ | grep ebuild | cut -f 2- -d "/" | cut -f 1 -d " "` ; 
      do 
      if [ ! -f $PKGDIR/All/$package.tbz2 ] 
     then 
     echo "" >> /tmp/ecdep.$$ 
     echo "Building binary package for $package :" >> /tmp/ecdep.$$ 

     emerge --pretend --buildpkgonly --oneshot =$package > /tmp/eupdate.$$ 
     if [ ` grep -c ebuild /tmp/eupdate.$$ ` == 1 ] 
         then 
         nice -n +19 emerge --buildpkgonly --oneshot =$package 2>> /tmp/ecdep.$$ 
         if [ $? == 0 ] 
        then 
        PACKAGES="$PACKAGES =$package" 
        else 
        echo "" >> /tmp/ecdep.$$ 
        echo " ***  Error while building $package!" >> /tmp/ecdep.$$ 
        SUBJECT="glcu: DEPENDENCY PROBLEM, COULDN'T PREBUILD ALL PACKAGES ON $HOSTNAME" 
        DEP=1 
         fi 

         else 
         echo " *** Dependencies for $package not met." >> /tmp/ecdep.$$ 
         echo " *** Cannot prebuilt $package!" >> /tmp/ecdep.$$ 
         SUBJECT="glcu: DEPENDENCY PROBLEM, COULDN'T PREBUILD ALL PACKAGES ON $HOSTNAME" 
         DEP=1 
     fi 

      fi 
    done 

    echo "New packages for 'emerge $UPDATE'!" > /tmp/glcu.$$ 
    echo "                  =============" >> /tmp/glcu.$$ 
    echo "" >> /tmp/glcu.$$ 

    if [ -n "$PACKAGES" ] 
   then 
   echo "To update your gentoo linux, execute:" >> /tmp/glcu.$$ 
   echo "" >> /tmp/glcu.$$ 
   echo "  emerge -avK $PACKAGES" >> /tmp/glcu.$$ 
   echo "" >> /tmp/glcu.$$ 
   EXTRA=further 
   SEND=1 
    fi 

    if [ $DEP ] 
   then 
   echo "check for $EXTRA packages with:" >> /tmp/glcu.$$ 
   echo "" >> /tmp/glcu.$$ 
   echo "  emerge -av $UPDATE" >> /tmp/glcu.$$ 
   echo "" >> /tmp/glcu.$$ 
   SEND=1 
    fi 


    cat /tmp/ecdep.$$ >> /tmp/glcu.$$ 

    # send mail, how to update the system 

    if [ $SEND ] 
   then 
   cat /tmp/glcu.$$ | mail -s "$SUBJECT" $EMAILADRESS 
    fi 

# rm all used files 

    rm /tmp/glcu.$$ 

fi 

rm /tmp/emergesync.$$ /tmp/eupdate.$$ /tmp/ecdep.$$
Pozdrawiam,
Milu
------------------------------------
Registered Linux User: #246079

Zanim zadasz pytanie przeczytaj to dokładnie!!
Top
fallow
Bodhisattva
Bodhisattva
User avatar
Posts: 2208
Joined: Thu Jan 08, 2004 12:53 pm
Location: Poland

  • Quote

Post by fallow » Tue Feb 08, 2005 6:40 pm

Dzieki Milu - dodane :):)

cheers.
"Time is a companion that goes with us on a journey. It reminds us to cherish each moment, because it will never come again. What we leave behind is not as important as how we have lived" J-L. Picard ;)
Top
Dawid159
Guru
Guru
User avatar
Posts: 414
Joined: Mon Jun 28, 2004 3:38 pm
Location: /dev/Kłodzko

  • Quote

Post by Dawid159 » Wed Feb 09, 2005 1:08 pm

Find old distfiles
Autor: Konstantin Shaposhnikov
Opis: Wyszukuje i wyświetla stare i potencjalnie niepotrzebne już pliki znajdujące się w distfiles

Code: Select all

#!/bin/bash

function create_portage_list() {
  find $1 -path '*files/digest-*' -type f | xargs -n1 awk '{print $3}' > $2
}

echo "Finding portage distfiles ... "
create_portage_list /usr/portage /tmp/portage-distfiles1

echo "Finding port overlay distfiles ... "
create_portage_list `portageq portdir_overlay` /tmp/portage-distfiles2

echo "Sorting list of distfiles ... "
cat /tmp/portage-distfiles{1,2} | sort > /tmp/portage-distfiles
rm /tmp/portage-distfiles{1,2}

echo "Finding local distfiles ... "
find /usr/portage/distfiles/ -type f | xargs -n1 basename | sort > /tmp/local-distfiles

comm -1 -3 /tmp/portage-distfiles /tmp/local-distfiles
Top
fallow
Bodhisattva
Bodhisattva
User avatar
Posts: 2208
Joined: Thu Jan 08, 2004 12:53 pm
Location: Poland

  • Quote

Post by fallow » Wed Feb 09, 2005 3:37 pm

dodany : thx :)

jest kilka minusow :)

skyrpt nie bierze pod uwage ze ktos moze miec cvs w swoich distfiles i wywalil mi wszystkie pliki e17 (tysiace) <-> ebuildy cvs.

oraz czasami pokazuje imho potrzebne pliki :)
tak czy siak , jest fajny :)

cheers.
"Time is a companion that goes with us on a journey. It reminds us to cherish each moment, because it will never come again. What we leave behind is not as important as how we have lived" J-L. Picard ;)
Top
moniek
n00b
n00b
User avatar
Posts: 71
Joined: Sat Sep 11, 2004 10:32 pm

  • Quote

Post by moniek » Thu Feb 10, 2005 6:33 am

A może ma ktoś taki skrypcik który zmienia wszystkie litery plików i podkatalogów w określonym kalalogu. Oczywiście chodzi mi o to aby działał rekurencyjnie.
Top
Insenic
Guru
Guru
User avatar
Posts: 329
Joined: Tue Jan 25, 2005 3:48 pm
Location: Poland, Bialystok
Contact:
Contact Insenic
Website

  • Quote

Post by Insenic » Thu Feb 10, 2005 10:36 pm

Dawid159 wrote:

Code: Select all

#
echo "Finding local distfiles ... "
find /usr/portage/distfiles/ -type f | xargs -n1 basename | sort 
nie lepiej by było

Code: Select all

echo "Finding local distfiles ... "
find ${DISTDIR} -type f | xargs -n1 basename | sort 
nie wszyscy przecierz mają ustawiony katalog distfiles standardowo ;)
Top
_troll_
Bodhisattva
Bodhisattva
User avatar
Posts: 1971
Joined: Wed Feb 04, 2004 9:16 pm
Location: Warszawa, Poland

  • Quote

Post by _troll_ » Thu Feb 10, 2005 10:42 pm

Insenic wrote:

Code: Select all

echo "Finding local distfiles ... "
find ${DISTDIR} -type f | xargs -n1 basename | sort 
tez nie - DISTDIR zdaje sie widac dopiero w procesie emerge.... (jak puscisz set w konsoli to nie widac... :) )

jesli juz to moze:

Code: Select all

echo "Finding local distfiles ... "
find `emerge info | grep "^DISTDIR"` -type f | xargs -n1 basename | sort 
hmmmm - ale to sie wylozy przy bialych znakach na poczatku.... no to jeszcze zabezpieczenie na biale znaki na poczatku (nie pamietam... \W* ?) i moze hulac.

Pozdrawiam,
Przemek
Życie jest jak pudełko czekoladek....
Nigdy nie wiesz na co trafisz" by mother of Forrest Gump
Top
nelchael
Retired Dev
Retired Dev
User avatar
Posts: 1948
Joined: Sat Mar 20, 2004 9:15 am
Location: /dev/drzewo
Contact:
Contact nelchael
Website

  • Quote

Post by nelchael » Thu Feb 10, 2005 10:46 pm

Code: Select all

portageq distdir
[color=gray:17697d0166]http://dev.gentoo.org/~nelchael/[/color:17697d0166]

[size=14:17697d0166]>> [b:17697d0166]Zasady na f.g.o->Polish[/b:17697d0166] <<[/size:17697d0166]
Top
_troll_
Bodhisattva
Bodhisattva
User avatar
Posts: 1971
Joined: Wed Feb 04, 2004 9:16 pm
Location: Warszawa, Poland

  • Quote

Post by _troll_ » Thu Feb 10, 2005 10:57 pm

super! nie wiedzialem nawet, ze cos takiego mamy :) thx nelchael - przydatny skrypcik!

tylko dla uscislenia:

Code: Select all

echo "Finding local distfiles ... "
find `portageq distdir` -type f | xargs -n1 basename | sort 
Pozdrawiam,
Przemek
Życie jest jak pudełko czekoladek....
Nigdy nie wiesz na co trafisz" by mother of Forrest Gump
Top
Insenic
Guru
Guru
User avatar
Posts: 329
Joined: Tue Jan 25, 2005 3:48 pm
Location: Poland, Bialystok
Contact:
Contact Insenic
Website

  • Quote

Post by Insenic » Thu Feb 10, 2005 11:03 pm

Code: Select all

portageq distdir
Ja tez nie wiedzialem ze cos takiego jest
Notebook: Asus A6TC-AP015 - AMD Turion X2 | 1024 DDR | nVidia GeForce Go 7300 | 80 GB HDD
Top
quat
Guru
Guru
User avatar
Posts: 316
Joined: Sat Sep 18, 2004 11:00 am

  • Quote

Post by quat » Wed Mar 02, 2005 8:36 pm

chcialbym zglosic skrypt findcruft autorstwa hepta_sean.
skrypt jest to nastepca skryptu cruft autorstwa ectamur-a, niestety ten ostatni wydaje sie juz nie rozwijany.

jest to skrypt do znajdywania plikow ktore sa zbedne na dysku. skrypt jest w pelni konfigurowalny tzn mozna okreslic jakie katalogi lub plik nie powinien brac pod uwage. sprawdza rowniez dowiazania.

dziala calkiem dosyc szybko (P4 1.8GHz, 256RAM przy dosyc rozbudowanym systemie sprawdzal nie wiecej niz 3 min).

tutaj jest link do watku o tym skrypcie, a tutaj najnowsza wersja
a mind is like a parachute, it's better when it's open
Top
ai
Apprentice
Apprentice
Posts: 227
Joined: Sun Mar 21, 2004 2:41 pm
Location: Poland, Krk
Contact:
Contact ai
Website

  • Quote

Post by ai » Wed Mar 16, 2005 5:17 pm

przed chwila znalazlem to : http://forums.gentoo.org/viewtopic.php?t=67849/
tu jest dosc sporo przydatnych skryptow =]
Mam nadzieje, ze jeszcze nikt tego tu nie zamieszczal ale chyba nie :P
just nothing ;)
Top
Post Reply
  • Print view

36 posts
  • 1
  • 2
  • Next

Return to “Polskie forum (Polish)”

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