From 563012de8957e4c29943d3bd32a5073e9e350b81 Mon Sep 17 00:00:00 2001 From: hackbard Date: Sat, 23 Apr 2005 15:00:51 +0000 Subject: [PATCH] see CHANGELOG 2004-04-23 --- doc/CHANGELOG | 6 + misc/hdw-tools/hdw-get | 139 +++++++++--- misc/hdw-tools/hdw-get.db | 202 ++++++++++++++++++ .../00-copy-system-files/00-copy-system-files | 2 + scripts/Helper | 20 ++ 5 files changed, 337 insertions(+), 32 deletions(-) create mode 100644 misc/hdw-tools/hdw-get.db diff --git a/doc/CHANGELOG b/doc/CHANGELOG index f29f1b8..b802c4b 100644 --- a/doc/CHANGELOG +++ b/doc/CHANGELOG @@ -1,3 +1,9 @@ +*) 2004-04-23 + +- improved hdw-get to resolve run time dependencies +- new concept, hdw-get reading hdw-get.db file +- improved Helper script to print dependencies + *) 2005-04-17 - updated to linux kernel 2.6.11.7 diff --git a/misc/hdw-tools/hdw-get b/misc/hdw-tools/hdw-get index 10be612..9ff72ec 100644 --- a/misc/hdw-tools/hdw-get +++ b/misc/hdw-tools/hdw-get @@ -16,16 +16,26 @@ usage() { echo "-v tell me whats going on" echo "-a auto resolve deps, do not prompt user" echo "-no-dep do not care for dependencies (used by hdw-get itself)" + echo "-s simulation only, do not install/remove packages" echo } package="" ; inst_root="" +update="" d_install="" ; install="" verbose="" ; no_dep="" auto_resolve_deps="" +simulate="" + +FL_DIR="var/adm/flists" +DEPS_DIR="var/adm/deps/run" +CONF="/etc/hdw-get.conf" +DBF="/etc/hdw-get.db" while [ "$1" ] ; do case "$1" in + update) update="1" ; package="fake" ; inst_root="fake" + shift 1 ;; install) install="1" inst_root="$2" ; package="$3" ; shift 3 ;; remove) remove="1" @@ -35,6 +45,7 @@ while [ "$1" ] ; do -v) verbose=1 ; shift 1 ;; -a) auto_resolve_deps="1" ; shift 1 ;; -no-dep) no_dep="1" ; shift 1 ;; + -s) simulate="1" ; shift 1 ;; *) usage ; exit 1 ;; esac done @@ -45,28 +56,57 @@ fi # read hdw-get configs net_addr="" ; bin_dir="" ; distf_dir="" -if [ -f /etc/hdw-get.conf ] ; then - . /etc/hdw-get.conf +if [ -f $CONF ] ; then + . $CONF if [ -z "$hdw_version" -o -z "$hdw_arch" -o -z "$hdw_arch_opt" ] ; then echo "version, arch and arch_opt need to be specified." - echo "adjust /etc/hdw-get.conf file" + echo "adjust $CONF file" exit else [ "$verbose" ] && echo "hdw-get.conf file looks good ..." fi else - echo "/etc/hdw-get.conf file not found, aborting" + echo "$CONF file not found, aborting" exit 1 fi +if [ "$update" = "1" ] ; then + echo -en "updating hdw-get.db file ..." + wget -q $net_addr/hdw-linux/hdw-linux-$hdw_version/hdw-get/hdw-get.db \ + -O $DBF + echo -en " done. (`cat $DBF | wc -l` packages)\n" +fi + # create temp directory mkdir -p /tmp/.hdw-get # remove if [ "$remove" = "1" ] ; then + # check if packages depend on package to be removed + pkgs="" + ((isdep = 0)) + for fl_file in $inst_root/$DEPS_DIR/*; do + if [ "`grep "^$package$" $fl_file`" != "" ] ; then + pkg=`echo $fl_file | sed "s%$inst_root/$DEPS_DIR/%%"` + if [ "$pkg" != "$package" ] ; then + ((isdep += 1)) + pkgs="$pkg $pkgs" + fi + fi + done + if [ "$isdep" != "0" ] ; then + echo "info:" + echo "run time dependencies were autegenerated by build system." + echo "they may be wrong. edit $inst_root/$DEPS_DIR/* files." + echo "deps:" + echo -en "$pkgs\n" + echo "package $package should not be removed ($isdep deps)" + [ "$no_dep" != "1" ] && exit 1 + fi # looking for flist file - fl_pris="" - for fl_file in $inst_root/var/adm/flists/$package-[x,0-9]*; do + fl_pris="unknown" + for fl_file in $inst_root/$FL_DIR/$package-[x,0-9]*; do + [ -f $fl_file ] && \ fl_pris="`echo $fl_file | awk -F- '{ print $NF }'` $fl_pris" done fl_max="0" @@ -75,15 +115,18 @@ if [ "$remove" = "1" ] ; then fl_max="x" break fi + [ "$pri" = "unknown" ] && break [ "$pri" -gt "$fl_max" ] && fl_max=$pri done - fl_file="$inst_root/var/adm/flists/$package-$fl_max" + fl_file="$inst_root/$FL_DIR/$package-$fl_max" [ "$verbose" ] && echo "expecting flist file $fl_file" if [ ! -f $fl_file ] ; then - echo "package $apckage is not installed (moved the flist file?)" + echo "package $package is not installed (moved the flist file?)" exit 1 fi + if [ "$simulate" != "1" ] ; then + # care about info/dir file rm -f /tmp/.hdw-get/dir* ; modify_info_dir="" if [ -n "`grep usr/share/info/dir $fl_file`" ] ; then @@ -127,6 +170,8 @@ if [ "$remove" = "1" ] ; then rm -f /tmp/.hdw-get/dir* fi + fi + # install elif [ "$install" = "1" ] ; then # does inst_root exist @@ -139,14 +184,63 @@ elif [ "$install" = "1" ] ; then # does package exist? pkg=`basename $package | sed 's/.tar.bz2//'` - if [ -f $inst_root/var/adm/flists/${pkg}-[0-9]* ] ; then + if [ -f $inst_root/$FL_DIR/${pkg}-[0-9]* ] ; then echo "$pkg seems to be installed, candidates:" - for i in $inst_root/var/adm/flists/${pkg}-[0-9]*; do + for i in $inst_root/$FL_DIR/${pkg}-[0-9]*; do echo "-> $i" done exit 1 fi + # package in database? + if [ "`grep "^$pkg\ -" $DBF`" = "" ] ; then + echo "sorry, package $package not found ..." + echo "(use 'hdw-get update' to update database)" + exit 1 + fi + + # check for runtime deps + if [ -z $no_deps ] ; then + deps="`grep "^$pkg\ -" $DBF | sed 's/.* -//'`" + udeps="" + tudeps="" + for dep in $deps; do + [ ! -f $inst_root/$FL_DIR/$dep-* ] && \ + udeps="$dep $udeps" + done + while [ "$udeps" != "$tudeps" ] ; do + tudeps="$udeps" + for tdep in $tudeps; do + deps="`grep "^$tdep\ -" $DBF | sed 's/.* -//'`" + for dep in $deps; do + exists=0 + [ -f $inst_root/$FL_DIR/$dep-* ] && \ + break + for i in $udeps; do + [ "$i" = "$dep" ] && exists=1 + done + [ "$exists" = "0" ] && \ + udeps="$udeps $dep" + done + done + done + echo "$pkg depends on the following uninstalled packages:" + echo "$udeps" + echo + echo "continue? [y,n] (default 'n')" + if [ -z $auto_resolve_deps ] ; then + read answer + if [ "$answer" = "y" ] ; then + for i in $udeps; do + [ "$simulate" != "1" ] && \ + $0 -no-dep install $inst_root $i + done + fi + fi + fi + + if [ "$simulate" != "1" ] ; then + # store info/dir file rm -f /tmp/.hdw-get/dir* if [ -f $inst_root/usr/share/info/dir ] ; then @@ -185,7 +279,7 @@ elif [ "$install" = "1" ] ; then # merging info/dir file if [ "$pkg" != "00-dirtree" ] ; then - fl_file=`ls -A $inst_root/var/adm/flists/$pkg-[0-9]* | tail -1` + fl_file=`ls -A $inst_root/$FL_DIR/$pkg-[0-9]* | tail -1` if [ -n "`grep usr/share/info/dir $fl_file`" ] ; then echo "" >> /tmp/.hdw-get/dir echo "$pkg info - added by hdw `date`" >> /tmp/.hdw-get/dir @@ -207,27 +301,8 @@ elif [ "$install" = "1" ] ; then cp /tmp/.hdw-get/dir $inst_root/usr/share/info/dir rm -f /tmp/.hdw-get/dir - # check for runtime deps - #if [ -z $no_deps ] ; then - # alldeps=`get_all_deps $pkg` - # echo "$pkg depends on the following packages:" - # for i in $alldeps; do - # echo "-> $i" - # done - # echo "continue? [y,n]" - # if [ -z $auto_resolve_deps ] ; then - # read answer - # if [ "$answer" = "y" ] ; then - # for i in $alldeps; do - # $0 -no-dep install $inst_root $pkg - # done - # else - # echo -n "install dependencies on your own," - # echo " things will not work without." - # fi - # fi - #fi - + fi + # dist-install elif [ "$d_install" = "1" ] ; then # check dist file diff --git a/misc/hdw-tools/hdw-get.db b/misc/hdw-tools/hdw-get.db new file mode 100644 index 0000000..bc43967 --- /dev/null +++ b/misc/hdw-tools/hdw-get.db @@ -0,0 +1,202 @@ +# hdw packages + run time dependencies +# +# created Fri Apr 22 12:50:08 CEST 2005 + +aalib - xorg glibc ncurses aalib +acroread - xaw3d pango lesstif tetex qt openmotif tcltk mhonarc kbd bdb linux glibc xorg +alsa - xorg glib1 gtk+1 ncurses glibc alsa +apache - firefox gtk+1 gtk+ irssi xaw3d pango lesstif tetex qt openmotif tcltk mhonarc kbd linux glibc expat bdb gdbm apache +ardour - ncurses glib curl raptor gcc alsa libsamplerate liblrdf libsndfile libart zlib libxml jack xorg glibc glib1 gtk+1 +atk - glibc glib +audiofile - glibc audiofile +aumix - zlib expat freetype xorg glib pango glibc atk gtk+ ncurses +avifile - libjpeg expat glibc gcc sdl zlib freetype fontconfig xorg libpng qt avifile +avra - glibc +bc - glibc +bind - mhonarc kbd bdb linux glibc openssl bind +blackbox - glibc xorg +bridge-utils - glibc +cdrtools - glibc +checkpwd - glibc +cron - glibc +cups - libjpeg libtiff libpng zlib glibc cups +curl - zlib glibc curl +cvsd - glibc +dfbpoint - glib glibc zlib directfb +dfbsee - glibc zlib directfb +dhcp - glibc +dialog - glibc ncurses +directfb - libjpeg freetype xorg sdl directfb glibc zlib libpng +elftoaout - glibc +emacs - ncurses zlib libpng libjpeg libtiff xorg xaw3d glibc +ethereal - expat freetype xorg zlib glib glibc pango atk gtk+ openssl ethereal +etherwake - glibc +ettercap - expat freetype xorg libtool zlib glib atk glibc pango gtk+ ncurses openssl +expat - glibc expat +faad2 - glibc gcc faad2 +fbset - glibc +ffmpeg - freetype xorg sdl lame xvid faad2 libvorbis libogg zlib glibc ffmpeg +firefox - python perl libpng libjpeg expat atk freetype zlib gcc imagemagick libxml glib xdirectfb windowmaker gdb xorg sendmail pine mutt openssl zip udev ncurses man-pages linux-libc-headers glibc firefox gtk+1 gtk+ irssi xaw3d pango lesstif tetex qt openmotif tcltk mhonarc kbd bdb linux +flite - glibc +fontconfig - glibc expat zlib freetype fontconfig +freetype - glibc zlib +fvwm - zlib libpng glibc xorg +gdb - ncurses glibc +gdbm - glibc +ghostscript - glibc zlib libjpeg xorg +gimp - libart gimp zlib expat freetype xorg glib pango glibc atk gtk+ +gimp-print - libpng libjpeg libtiff cups glibc zlib +glib - tetex qt openmotif tcltk mhonarc kbd bdb linux glibc glib +glib1 - apache firefox gtk+1 gtk+ irssi xaw3d pango lesstif tetex qt openmotif tcltk mhonarc kbd bdb linux glibc +gnuplot - glibc libpdf libpng zlib +gpsd - glibc +grace - freetype expat glibc zlib libpng libjpeg libpdf xorg lesstif +gtk+ - libtiff libjpeg libpng expat pango zlib freetype xorg atk glibc glib gtk+ +gtk+1 - xorg glibc glib1 +gtk-gnutella - zlib libxml glib1 glibc xorg gtk+1 +gv - xorg xaw3d glibc +hdparm - glibc +hostap - +imagemagick - libpng tetex qt openmotif tcltk mhonarc kbd bdb linux libxml zlib freetype glibc bzip2 xorg libjpeg libtiff imagemagick +imlib - zlib libpng libtiff libjpeg libungif glibc glib1 gtk+1 xorg imlib +ipcheck - +iproute2 - bdb glibc +ipsec-tools - openssl glibc +iptables - glibc +irssi - ncurses openssl glib glibc +isdn4k-utils - isdn4k-utils tcltk ncurses glibc +jack - alsa libsndfile glibc jack +ladspa - gcc glibc +lam - gcc glibc lam +lame - glibc ncurses +lesstif - xorg zlib freetype expat glibc +liba52 - glibc +libart - glibc +libdivxdecore - glibc +libdvbpsi - glibc +libdvdcss - glibc +libdvdplay - libdvdcss glibc libdvdread +libdvdread - glibc libdvdcss +libflash - glibc zlib libjpeg +libgcrypt - glibc libgpg-error +libgpg-error - glibc libgpg-error +libidl - glibc glib +libieee1284 - glibc libieee1284 +libjpeg - glibc libjpeg +liblrdf - glib zlib libxml glibc curl raptor +libmad - glibc +libmpeg2 - glibc +libmpeg3 - glibc +libmustux - glibc +libnet - +libogg - glibc +libpcap - +libpdf - glibc mhonarc kbd bdb linux +libpng - glibc +libsamplerate - glibc libsamplerate +libsndfile - glibc libsndfile +libtiff - glibc libtiff +libungif - mhonarc kbd bdb linux glibc libungif +libunicode - glibc +libvorbis - libogg glibc +libxml - zlib glibc libxml +licq - zlib xorg gcc glibc openssl +lirc - xorg lirc glibc +lphdisk - glibc +lprng - glibc openssl +ltrace - glibc +lynx - apache firefox gtk+1 gtk+ irssi xaw3d pango lesstif tetex qt openmotif tcltk mhonarc kbd bdb linux glibc openssl ncurses +magicfilter - zlib glibc file +mhonarc - mhonarc kbd bdb linux +minicom - glibc ncurses +minimalist - +mixerapp - glibc gcc xorg +mplayer - mplayer gtk+1 gtk+ irssi xaw3d pango lesstif tetex qt openmotif tcltk mhonarc kbd bdb linux ncurses expat directfb sdl xorg aalib fontconfig libungif freetype libjpeg zlib libpng glibc xvid lame libogg libvorbis libmad +mppp - glibc +mutt - python pwlib mhonarc curl util-linux perl gawk bdb coreutils gcc binutils man-pages linux-libc-headers linux glibc openssl ncurses +netkit-ftp - glibc +netkit-rsh - glibc +netkit-telnet - gcc ncurses glibc +netkit-tftp - glibc +nfs-utils - glibc +ngrep - glibc +nmap - gcc openssl xorg glibc glib1 gtk+1 +openh323 - xorg gcc sdl expat openssl openldap glibc pwlib +openldap - openldap mhonarc kbd linux bdb glibc openssl +openmotif - tcltk mhonarc kbd bdb linux glibc xorg openmotif +openssh - zlib openssl glibc +openssl - glibc openssl +orbit - glibc glib1 orbit +pango - expat glib glibc zlib freetype xorg pango +parted - glibc e2fsprogs parted +pciutils - glibc +pcmcia-cs - glibc +pine - ncurses openssl glibc +pkgconfig - glibc +portmap - glibc +povray - glibc gcc xorg zlib libpng libjpeg libtiff +ppp - glibc +procmail - glibc +protux - glibc xorg zlib +pwlib - mhonarc kbd bdb linux gcc glibc pwlib +python - bzip2 zlib ncurses gdbm python openssl pwlib curl util-linux perl gawk coreutils binutils man-pages linux-libc-headers mhonarc kbd bdb linux gcc glibc +qiv - xorg glibc glib1 gtk+1 imlib +qt - expat fontconfig freetype xorg zlib libpng qt glibc gcc +raptor - glib zlib libxml glibc curl raptor +rcs - glibc +root-tail - glibc xorg +rp-pppoe - glibc +rsync - glibc +samba - cups openssl openldap glibc +screen - glibc ncurses +scummvm - xorg gcc glibc sdl zlib libmad libogg libvorbis +sdl - xorg glibc +sendmail - glibc bdb +sersniff - glibc +setserial - glibc +sp12 - glibc +speex - glibc libogg speex +strace - glibc +sudo - glibc +synaptics - xorg glibc +syslinux - xaw3d pango lesstif tetex qt openmotif tcltk mhonarc kbd bdb linux glibc +t1lib - gtk+1 gtk+ irssi xaw3d pango lesstif tetex qt openmotif tcltk mhonarc kbd bdb linux xorg glibc t1lib +tcltk - mhonarc kbd linux tcltk xorg mutt python perl bdb glibc +tcp_wrappers - glibc +tcpdump - glibc +tetex - gcc xorg ncurses glibc +tftp-hpa - glibc +thunderbird - python perl libpng libjpeg expat atk freetype zlib gcc emacs gimp gimp-print wine imagemagick libxml glib xdirectfb windowmaker gdb xorg sendmail pine mutt openssl zip udev ncurses man-pages linux-libc-headers glibc thunderbird apache firefox gtk+1 gtk+ irssi xaw3d pango lesstif tetex qt openmotif tcltk mhonarc kbd bdb linux +tpconfig - glibc +transcode - sdl glib1 gtk+1 libmpeg3 bzip2 xorg libjpeg freetype libtiff imagemagick zlib libxml libdvdcss libdvdread lame libogg libvorbis glibc +transfig - glibc zlib libpng +unrealircd - glibc +unzip - glibc +vim - glibc ncurses xorg +vlc - glib1 gtk+1 gcc freetype libdvbpsi speex libpng xorg sdl libmad libdvdplay libdvdread libdvdcss libogg libvorbis lame xvid faad2 zlib libxml ffmpeg glibc +vobcopy - libdvdcss glibc libdvdread +vpnc - glibc libgpg-error libgcrypt +windowmaker - glibc libungif libjpeg zlib libpng xorg libtiff windowmaker +wine - apache firefox gtk+1 gtk+ irssi xaw3d pango lesstif tetex qt openmotif tcltk mhonarc kbd bdb linux gcc ncurses libjpeg libungif isdn4k-utils xorg wine glibc +wireless_tools - glibc +wmapm - glibc xorg +wmifs - glibc xorg +wmitime - glibc xorg +wmmon - glibc xorg +wmnd - glibc xorg +wmpower - glibc xorg +wmwave - glibc xorg +wterm - glibc xorg +wvdial - openssl zlib glibc gcc wvstreams +wvstreams - libvorbis libogg zlib openssl glibc wvstreams +xaw3d - glibc xorg +xawtv - zlib freetype expat lesstif xorg aalib libjpeg ncurses glibc +xdirectfb - tetex qt openmotif tcltk mhonarc kbd bdb linux libpng gcc directfb ncurses expat zlib freetype xorg glibc +xfig - thunderbird apache firefox gtk+1 gtk+ irssi xaw3d pango lesstif tetex qt openmotif tcltk mhonarc kbd bdb linux glibc zlib libpng xorg libjpeg +xhkeys - glibc xorg +xlockmore - openmotif zlib gcc glibc freetype xorg +xmms - libogg libvorbis zlib glibc glib1 gtk+1 xmms xorg +xorg - apache firefox xaw3d pango lesstif openmotif tcltk kbd libpng gcc expat fontconfig zlib freetype emacs gimp gimp-print wine gtk+1 gtk+ irssi imagemagick libxml glib xdirectfb tetex windowmaker qt gdb xorg sendmail pine mutt openssl zip mhonarc udev ncurses bdb man-pages linux-libc-headers linux glibc +xpdf - expat zlib glibc gcc xorg lesstif freetype t1lib +xvid - glibc +zip - glibc diff --git a/packages/base/00-copy-system-files/00-copy-system-files b/packages/base/00-copy-system-files/00-copy-system-files index 91f119d..dd12aba 100644 --- a/packages/base/00-copy-system-files/00-copy-system-files +++ b/packages/base/00-copy-system-files/00-copy-system-files @@ -51,6 +51,8 @@ custmain() { cp -v $hdw_home_dir/misc/hdw-tools/hdw-get $root/usr/bin chown 0:0 $root/usr/bin/hdw-get chmod 750 $root/usr/bin/hdw-get + # hdw-get package info + cp -v $hdw_home_dir/misc/hdw-tools/hdw-get.db $root/etc # create /etc/hdw-get.conf cat > $root/etc/hdw-get.conf <<-EOF # hdw - linux hdw-get.conf file diff --git a/scripts/Helper b/scripts/Helper index 294efa9..048ed14 100755 --- a/scripts/Helper +++ b/scripts/Helper @@ -14,22 +14,42 @@ ccl=0 cdf=0 +rtd=0 +bd=0 while [ "$1" ] ; do case "$1" in -create_cvs_list) ccl=1; shift 1 ;; -create_dist_files) cdf=1; shift 1 ;; + -create_runtimedeps) rtd=1; shift 1 ;; + -create_build_deps) bd=1; shift 1 ;; *) echo echo "usage:" echo echo "$0 -create_cvs_list" echo "$0 -create_dist_files" + echo "$0 -create_runtimedeps" + echo "$0 -create_build_deps" echo exit 1 ;; esac done +if [ "$rtd" = "1" ] ; then + echo "# hdw packages + run time dependencies" + echo "#" + echo "# created `date`" + echo + for i in /var/adm/deps/run/*; do + echo -en $i | sed 's$/var/adm/deps/run/$$' + echo -en " - " + for j in `cat $i`; do + echo -en "$j " + done + echo -en "\n" + done +fi if [ "$ccl" = "1" ] ; then for i in download/*/PKGS; do -- 2.20.1