Forums

Skip to content

Advanced search
  • Quick links
    • Unanswered topics
    • Active topics
    • Search
  • FAQ
  • Login
  • Register
  • Board index International Gentoo Users Forum italiano (Italian) Risorse italiane (documentazione e tools)
  • Search

[Tool] ebuildswitcher, ruota gli ebuild + vecchi di x giorni

Forum riservato alla documentazione in italiano.

Moderator: ago

Post Reply
  • Print view
Advanced search
2 posts • Page 1 of 1
Author
Message
FonderiaDigitale
Veteran
Veteran
User avatar
Posts: 1710
Joined: Thu Nov 06, 2003 4:28 am
Location: Rome, Italy
Contact:
Contact FonderiaDigitale
Website

[Tool] ebuildswitcher, ruota gli ebuild + vecchi di x giorni

  • Quote

Post by FonderiaDigitale » Wed May 12, 2004 1:40 pm

questo script scanna la directory di portage per ebuild vecchi di X giorni, li salva nella dir di overlay di modo tale che non vadano sovrascritti da emerge sync.
Ovviamente anche se overlay ha la precedenza sulla dir canonica, essendo le versioni degli ebuild piu vecchie, non avrete problemi con i vostri normali ebuild piu recenti :)

Changelog:

Code: Select all

0.0.3
aggiunto un controllo per verificare la presenza del file nell'overlay
ripulito un po' il codice
Sorgente:

Code: Select all

#!/bin/sh
# routa gli ebuild piu vecchi di tot giorni nella directory di overlay
# di modo tale che non vadano persi
# Autore Giovanni Ferri <fonderiadigitale@gechi.it>
# Rilasciato sotto la licenza GPL2
#
# uso: ebuildswitcher <giorni>
 
DEBUG=0
 
case $1 in
        *0*|*1*|*2*|*3*|*4*|*5*|*6*|*7*|*8*|*9*)        days=$1 ;;
        *)      echo "Usage: ebuildswitcher <n.days>" ; exit 1 ;;
esac
 
version=0.0.3
GOOD=$'\e[32;01m'
WARN=$'\e[33;01m'
BAD=$'\e[31;01m'
NORMAL=$'\e[0m'
HILITE=$'\e[36;01m'
BRACKET=$'\e[34;01m'
 
##
source /etc/make.conf
portbase=`echo $PORTDIR|sed 's:/:_:g'`
[ -z "$PORTDIR_OVERLAY" ] && echo "${BAD}Cannot continue, overlay dir is not specified in make.conf.${NORMAL}" && exit 1
echo "${BRACKET}Ebuild Switcher $version${GOOD} by Giovanni Ferri <fonderiadigitale@gechi.it>"
echo "Scanning $PORTDIR for ebuild older than $days days."
[ -d $PORTDIR_OVERLAY ] || mkdir -p $PORTDIR_OVERLAY > /dev/null
for a in `find $PORTDIR -iname *.ebuild -mtime $days`; do
        c=1
        [ "$DEBUG" != 0 ] && echo "${WARN}Ebuild trovato: ${HILITE}$a${WARN}"
        PORTNEW=(`echo ${a/\//}|sed 's:/: :g'`)
        category=${PORTNEW[2]}
        package=${PORTNEW[3]}
        ebuild=${PORTNEW[4]}
 
        newpath="$PORTDIR_OVERLAY/$category/$package"
        [ "$DEBUG" != 0 ] && echo -en "\\n==>   category: ${GOOD}$category\\n   ${WARN}package: ${BAD}$package\\n       ${WARN}ebuild: ${BRACKET}$ebuild\\n${WARN}"
        [ -z "$newpath" ] && mkdir -p  $newpath/files > /dev/null
        [ -d $newpath ] || mkdir -p  $newpath > /dev/null
        if [ -f  $newpath/$ebuild ]; then
                [ "$DEBUG" != 0 ] && echo -e "\\n$newpath/$ebuild esiste, non lo copio.\\n"
                echo "${GOOD}Skipping ${HILITE}$ebuild${GOOD} already present in ${HILITE}$newpath${NORMAL}"
        else
                [ "$DEBUG" != 0 ] && echo -e "\\ncopio $a in $newpath"
                cp $a $newpath
                echo "${GOOD}Backed up ${HILITE}$a${GOOD} to ${HILITE}$newpath/$ebuild${NORMAL}"
        fi
done
[ -z "$c" ] &&  echo -e "\\n${GOOD}No ebuild older than $days days found.${NORMAL}"
Come disse un amico, i sistemisti sono un po' come gli artigiani per l'informatica :)
Top
shev
Bodhisattva
Bodhisattva
User avatar
Posts: 4084
Joined: Mon Feb 03, 2003 3:12 pm
Location: Italy

  • Quote

Post by shev » Wed May 12, 2004 5:13 pm

Ma quante ne sai? Grande fonderiadigitale :D
Se per vivere ti dicono "siediti e stai zitto" tu alzati e muori combattendo
Top
Post Reply
  • Print view

2 posts • Page 1 of 1

Return to “Risorse italiane (documentazione e tools)”

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