Forums

Skip to content

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

[TOOL ] - bininfo -info dai binari prima di installarli

Questa è la sezione italiana del forum gentoo destinata a fornire supporto all'omonima distribuzione.

Moderator: ago

Post Reply
  • Print view
Advanced search
27 posts
  • Previous
  • 1
  • 2
Author
Message
silian87
Advocate
Advocate
User avatar
Posts: 2318
Joined: Mon Oct 06, 2003 7:12 pm
Location: Treviso, Italy
Contact:
Contact silian87
Website

  • Quote

Post by silian87 » Sun Oct 10, 2004 12:00 pm

E' molto ma molto utile.
Musica che ascolto: http://www.last.fm/user/silian87/

Silian87 FAQs: http://marentax.homelinux.org/~silian87 ... 87-faq.txt

GTalk: silian87@gmail.com
Top
Benve
l33t
l33t
User avatar
Posts: 897
Joined: Thu Mar 13, 2003 4:37 pm
Location: Italy Romagna
Contact:
Contact Benve
Website

  • Quote

Post by Benve » Wed Oct 13, 2004 9:02 am

Posto quà il prototipo di binmerge.
Lo script è semplicissimo e serve solo a dare un'idea di quello che può essere fatto coi binari

submit.sh:

Code: Select all

#! /bin/bash

BPDIR="/mnt/packages" #dir dove stanno i binari generici
PKGDIR="/usr/portage/packages/All" #dir coi binari specifici da usare

OUT=`ls $PKGDIR`

for i in $OUT
 do
 echo -n $i
 sum=`md5sum $PKGDIR/$i | cut -d " " -f 1`
 name=`basename $(./bininfo2 $PKGDIR/$i | head -n1)`
 
 if ! [ -e "$BPDIR/$name-$sum.tbz2" ];
  then
  echo -n " copio in $BPDIR/$name-$sum.tbz2"
  cp $PKGDIR/$i $BPDIR/$name-$sum.tbz2
  
 fi                     

 echo " "
        
done
Questo è lo script che inserisce i binari compilati localmente (PKGDIR) in BPDIR
ogni binario viene copiato aggiungendo al nome l'md5, per distinguere binari della stessa versione di software ma compilati con use diverse

binmerge.sh

Code: Select all

#!/bin/bash

#echo $1

BPDIR="/mnt/packages" #dir dove stanno i binari generici
PKGDIR="/usr/portage/packages/All" #dir coi binari specifici da usare

#prendo informazioni sull'ebuild che devo installare e sulle sue dipendenze
OUT=`emerge -pv $1 | grep 'ebuild'`

iFIELD=0 #campo dell'ebuild
iUSE=0
PACKAGES=""


for i in $OUT
  do
  if [ $i == '[ebuild' ]; then
      iFIELD=0
      iUSE=0
  fi

#	echo "SONO I -> $i"

  case $iFIELD in
      0 | 2 )
	  ;;
      1 ) #stato ebuild
	  EBUILD[1]=$i
	  
	  ;;
      3 ) #nome-versione ebuild
	  EBUILD[0]=$i
	  PACKAGES=`ls $BPDIR | grep $(basename $i)`
	  ;;
      * )
	  tmp=`echo $i | cut -c1`
	  PKTMP=""
	  if [[ $tmp == + || $tmp == - ]]; then
	      U=`echo $tmp$(echo ${i#[+-]} | cut -d ")" -f 1 | cut -d "(" -f 2)`
	      
	      for pk in $PACKAGES
				do
					if [[ -n `./bininfo2 $BPDIR/$pk | grep USEFLAGS | grep -- $U` ]] 
					then
		    				#echo "pk" $pk $PKTMP
		    				PKTMP=`echo $pk $PKTMP`  
					fi
	   		done
	      iUSE=$[$iUSE+1]
	      PACKAGES=$PKTMP
	      #echo $PACKAGES
	  fi
	  ;;
  esac
    
  #echo "$i" 
  iFIELD=$[$iFIELD+1]

done

echo $PACKAGES
Questo script ci dice quali pacchetti sono compatibili con le nostre use.
Non fa altro che stampare a video il pacchetto compatibile.
Il codice lo so fa veramente schifo, è stato stritto in mezzora spalmata in una settimana.

Va invocato col nome del software es:
./binmerge grep
Top
Post Reply
  • Print view

27 posts
  • Previous
  • 1
  • 2

Return to “Forum italiano (Italian)”

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