diff options
Diffstat (limited to 'deprecated/old-scripts')
-rw-r--r-- | deprecated/old-scripts/Makefile | 32 | ||||
-rw-r--r-- | deprecated/old-scripts/dep-clean | 272 | ||||
-rw-r--r-- | deprecated/old-scripts/dep-clean.1 | 190 | ||||
-rwxr-xr-x | deprecated/old-scripts/ewhich | 44 | ||||
-rw-r--r-- | deprecated/old-scripts/ewhich.1 | 24 | ||||
-rw-r--r-- | deprecated/old-scripts/mkebuild | 216 | ||||
-rw-r--r-- | deprecated/old-scripts/mkebuild.1 | 20 | ||||
-rw-r--r-- | deprecated/old-scripts/pkg-clean | 107 | ||||
-rw-r--r-- | deprecated/old-scripts/pkg-clean.1 | 20 | ||||
-rw-r--r-- | deprecated/old-scripts/pkg-size | 63 | ||||
-rw-r--r-- | deprecated/old-scripts/pkg-size.1 | 11 |
11 files changed, 999 insertions, 0 deletions
diff --git a/deprecated/old-scripts/Makefile b/deprecated/old-scripts/Makefile new file mode 100644 index 0000000..8f61cb5 --- /dev/null +++ b/deprecated/old-scripts/Makefile @@ -0,0 +1,32 @@ +# Copyright 2004 Karl Trygve Kalleberg <karltk@gentoo.org> +# Copyright 2004 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# +# $Header$ + +include ../../makedefs.mak + +all: + echo "BOTOLPHS Huge benign tumors which archdeacons and old chemistry teachers affect to wear on the sides of their noses." + +dist: + mkdir -p ../../$(distdir)/src/old-scripts/ + cp Makefile ../../$(distdir)/src/old-scripts/ + cp dep-clean dep-clean.1 ../../$(distdir)/src/old-scripts/ + cp pkg-clean pkg-clean.1 ../../$(distdir)/src/old-scripts/ + cp ewhich ewhich.1 ../../$(distdir)/src/old-scripts/ + cp mkebuild mkebuild.1 ../../$(distdir)/src/old-scripts/ + cp pkg-size pkg-size.1 ../../$(distdir)/src/old-scripts/ + +install: + install -m 0755 dep-clean $(bindir)/ + install -m 0755 pkg-clean $(sbindir)/ + install -m 0755 ewhich $(bindir)/ + install -m 0755 mkebuild $(sbindir)/ + install -m 0755 pkg-size $(bindir)/ + + install -m 0644 dep-clean.1 $(mandir)/ + install -m 0644 pkg-clean.1 $(mandir)/ + install -m 0644 ewhich.1 $(mandir)/ + install -m 0644 mkebuild.1 $(mandir)/ + install -m 0644 pkg-size.1 $(mandir)/ diff --git a/deprecated/old-scripts/dep-clean b/deprecated/old-scripts/dep-clean new file mode 100644 index 0000000..89c6364 --- /dev/null +++ b/deprecated/old-scripts/dep-clean @@ -0,0 +1,272 @@ +#!/bin/bash +#Shows unrequired packages and missing dependencies. +#Author/Maintainer: Brandon Low <lostlogic@gentoo.org> +#Author: Jerry Haltom <ssrit@larvalstage.net> + +echo +echo -e "\x1b[31;01m!!! As of Gentoolkit 0.2.0, this tool is deprecated." +echo -e "!!!\x1b[0;0m Please refer to 'emerge clean' and 'emerge depclean' for replacements." +echo + +PROG=`basename ${0}` + +tmp="/tmp/$$" + +#Get PORTDIR and PORTDIR_OVERLAY from portage +PORTDIR_OVERLAY="$(/usr/lib/portage/bin/portageq portdir_overlay)" +PORTDIR="$(/usr/lib/portage/bin/portageq portdir)" + +rm -rf ${tmp} > /dev/null 2>&1 +mkdir ${tmp} > /dev/null 2>&1 + +declare -i i + +set -- `getopt -n ${PROG} -o N,R,U,I,v,q,C,h -l needed,removed,unneeded,interactive,verbose,quiet,nocolor,help -- ${*/ --/};[ $? != 0 ] && echo "y"` + +while [ ${#} -gt 0 ] +do + a=${1} + shift + case "${a}" in + + -I|--interactive) + interactive=y + ;; + + -N|--needed) + needed=y + ;; + + -U|--unneeded) + unneeded=y + ;; + + -R|--removed) + removed=y + ;; + + -v|--verbose) + verb=y + ;; + + -q|--quiet) + quiet=y + ;; + + -C|--nocolor) + nocolor=y + ;; + + -h|--help) + usage=y + ;; + + --) + [ ${1} ] && usage=y && broke=y + break + ;; + + *) + usage=y + broke=y + echo "FIXME - OPTION PARSING - ${a}" + break + ;; + + esac +done + +if [ ! ${needed} ] && [ ! ${unneeded} ] && [ ! ${removed} ]; then + needed=y + unneeded=y + removed=y +fi + +#Set up colors +if [ ! "${nocolor}" ]; then + NO="\x1b[0;0m" + BR="\x1b[0;01m" + CY="\x1b[36;01m" + GR="\x1b[32;01m" + RD="\x1b[31;01m" + YL="\x1b[33;01m" + BL="\x1b[34;01m" +elif [ ${quiet} ] && ( + ( [ ${needed} ] && [ ${unneeded} ] ) || + ( [ ${unneeded} ] && [ ${removed} ] ) || + ( [ ${removed} ] && [ ${needed} ] ) + ); then + NEED=" N" + UNNE=" U" + REMO=" R" +fi + +if [ ${usage} ]; then + echo -e "${BR}GenToolKit's Dependency Checker! +${NO}Displays packages that are installed but which none +of the packages in world or system depend on, and +displays packages which are depended on by world or +system, but are not currently installed. + +${BR}USAGE: + ${BL}${PROG}${YL} [${NO}options${YL}]${NO} + ${BL}${PROG}${GR} --help${NO} + +${BR}OPTIONS: + ${GR}-U, --unneeded${NO} display unneeded packages that are installed (${GR}green${NO}) + ${GR}-N, --needed${NO} display needed packages that are not installed (${RD}red${NO}) + ${GR}-R, --removed${NO} display installed packages not in portage (${YL}yellow${NO}) + + ${GR}-I, --interactive${NO} interactively modify world file before proceeding + ${GR}-C, --nocolor${NO} output without color, if necessary, package types are + noted with ${GR}U, N${NO} and ${GR}R${NO} respectively + ${GR}-v, --verbose${NO} be more verbose + ${GR}-q, --quiet${NO} be quiet (just output the packages, no extra info) + +${BR}NOTES: + ${GR}*${NO} If this script is run on a system that is not up-to-date or which hasn't + been cleaned (with '${BL}emerge -c${NO}') recently, the output may be deceptive. + ${GR}*${NO} If the same package name appears in all three categories, then it is + definitely time to update that package and then run '${BL}emerge -c${NO}'. + ${GR}*${NO} The ${GR}-U, -N${NO} and ${GR}-R${NO} options may be combined, defaults to ${GR}-UNR${NO}" + rm -rf ${tmp} > /dev/null 2>&1 + [ ${broke} ] && exit 1 || exit 0 +fi + +X="\([^/]*\)" + +#Retrieve currently merged packages. +if [ ${verb} ];then + echo -e "${CY}Retrieving currently merged packages.${NO}" +fi +find /var/db/pkg/ -name '*.ebuild' | \ + sed -e "s:/var/db/pkg/::" \ + -e "s:${X}/${X}/${X}:\1/\2:" | \ + sort -u >> ${tmp}/current + +if [ ${verb} ]; then + echo -e "${CY}"`cat ${tmp}/current | wc -l` "currently merged packages.${NO}" + echo -e +fi + +#Retrieve system packages and add to image. +if [ ${verb} ];then + echo -e "${CY}Retrieving system packages.${NO}" +fi +emerge system -ep | \ + sed -e "/ebuild/s:^.*] \([^ ]*\) *:\1:p;d" | \ + sort -u \ + > ${tmp}/system + +if [ ${verb} ]; then + echo -e "${CY}"`cat ${tmp}/system | wc -l 2> /dev/null` "packages contained in system.${NO}" + echo -e + echo -e "${CY}Preparing world file.${NO}" +fi + +#Create local copy of world and ask user to verify it. +cp /var/cache/edb/world ${tmp}/world + +if [ ${interactive} ]; then + ${EDITOR} ${tmp}/world +fi + +#Retrieve world packages and dependencies and add to image. +if [ ${verb} ]; then + echo -e + echo -e "${CY}Preparing list of installed world packages.${NO}" + echo -e +fi + +cat ${tmp}/current | grep -f ${tmp}/world | sort > ${tmp}/world.inst +find ${PORTDIR} ${PORTDIR_OVERLAY} -iname '*.ebuild' | \ + awk -F'/' '{printf("%s/%s\n", $(NF-2), $NF)}' | \ + sed -e 's:\.ebuild::' > ${tmp}/ebuilds +grep -xf ${tmp}/world.inst ${tmp}/ebuilds >> ${tmp}/world.new + +if [ ${verb} ]; then + echo -e "${CY}"`cat ${tmp}/ebuilds | wc -l`"\tebuilds available.${NO}" + echo -e "${CY}"`cat ${tmp}/world.new | wc -l`"\tpackages contained in final world file.${NO}" + echo -e + echo -e "${CY}List prepared, checking dependencies with emerge -ep${NO}" +fi + +sort ${tmp}/world.new |sed -e 's:^:\\\=:' | uniq | xargs emerge -ep | \ + tee ${tmp}/log | sed -e '/ebuild/s:^.*] \([^ ]*\) *$:\1:p;d' > ${tmp}/image.unsorted + +depends=`cat ${tmp}/image.unsorted|wc -l` + +if [ ${depends} -lt "2" ]; then + echo -e "${RD}There appears to be an unresolved dependency in your world file." + echo -e "Please check for masking errors or other world file issues," + echo -e "and then try again." + echo -e + echo -e "The following is the emerge output for your reference:${NO}" + cat ${tmp}/log + rm -rf ${tmp} > /dev/null 2>&1 + exit 1 +fi + +cat ${tmp}/system >> ${tmp}/image.unsorted + +#Cleanup image +sort -u ${tmp}/image.unsorted > ${tmp}/image + +if [ ${verb} ];then + echo -e "${CY}"`cat ${tmp}/image | wc -l` "packages contained in final image.${NO}" + echo -e +fi + +#Determine packages that exist in current but not in image. +#These packages are safe to clean up. +if [ ${unneeded} ]; then + if [ ! ${quiet} ]; then + echo -e "${CY}These packages have no other packages depending on them.${NO}" + fi + + grep -vxf ${tmp}/image ${tmp}/current > ${tmp}/unneeded + for line in `cat ${tmp}/unneeded`;do + echo -e "${GR}${line}${CY}${UNNE}${NO}" + done + + if [ ! ${quiet} ];then + echo -e "${CY}Total of"`cat ${tmp}/unneeded|wc -l` "unneeded packages.${NO}" + fi +fi + +#Determine packages that exist in image but not in current. +#These packages should be added. +if [ ${needed} ]; then + if [ ! ${quiet} ];then + echo -e + echo -e "${CY}These packages are depended upon but are not present on the system.${NO}" + fi + + grep -vxf ${tmp}/current ${tmp}/image > ${tmp}/needed + for line in `cat ${tmp}/needed`;do + echo -e "${RD}${line}${CY}${NEED}${NO}" + done + + if [ ! ${quiet} ];then + echo -e "${CY}Total of"`cat ${tmp}/needed|wc -l` "needed packages.${NO}" + fi +fi + +#Determine packages that are installed but not currently in portage +if [ ${removed} ]; then + if [ ! ${quiet} ];then + echo -e + echo -e "${CY}These packages are installed but not in the portage tree.${NO}" + fi + grep -xf ${tmp}/current ${tmp}/ebuilds > ${tmp}/hascurrent + grep -vxf ${tmp}/hascurrent ${tmp}/current > ${tmp}/removed + for line in `cat ${tmp}/removed`;do + echo -e "${YL}${line}${CY}${REMO}${NO}" + done + + if [ ! ${quiet} ];then + echo -e "${CY}Total of"`cat ${tmp}/removed|wc -l` "removed packages.${NO}" + fi +fi + +rm -rf ${tmp} > /dev/null 2>&1 diff --git a/deprecated/old-scripts/dep-clean.1 b/deprecated/old-scripts/dep-clean.1 new file mode 100644 index 0000000..9747ce4 --- /dev/null +++ b/deprecated/old-scripts/dep-clean.1 @@ -0,0 +1,190 @@ +.\" Automatically generated by Pod::Man version 1.15 +.\" Thu Jul 18 15:59:55 2002 +.\" +.\" Standard preamble: +.\" ====================================================================== +.de Sh \" Subsection heading +.br +.if t .Sp +.ne 5 +.PP +\fB\\$1\fR +.PP +.. +.de Sp \" Vertical space (when we can't use .PP) +.if t .sp .5v +.if n .sp +.. +.de Ip \" List item +.br +.ie \\n(.$>=3 .ne \\$3 +.el .ne 3 +.IP "\\$1" \\$2 +.. +.de Vb \" Begin verbatim text +.ft CW +.nf +.ne \\$1 +.. +.de Ve \" End verbatim text +.ft R + +.fi +.. +.\" Set up some character translations and predefined strings. \*(-- will +.\" give an unbreakable dash, \*(PI will give pi, \*(L" will give a left +.\" double quote, and \*(R" will give a right double quote. | will give a +.\" real vertical bar. \*(C+ will give a nicer C++. Capital omega is used +.\" to do unbreakable dashes and therefore won't be available. \*(C` and +.\" \*(C' expand to `' in nroff, nothing in troff, for use with C<> +.tr \(*W-|\(bv\*(Tr +.ds C+ C\v'-.1v'\h'-1p'\s-2+\h'-1p'+\s0\v'.1v'\h'-1p' +.ie n \{\ +. ds -- \(*W- +. ds PI pi +. if (\n(.H=4u)&(1m=24u) .ds -- \(*W\h'-12u'\(*W\h'-12u'-\" diablo 10 pitch +. if (\n(.H=4u)&(1m=20u) .ds -- \(*W\h'-12u'\(*W\h'-8u'-\" diablo 12 pitch +. ds L" "" +. ds R" "" +. ds C` "" +. ds C' "" +'br\} +.el\{\ +. ds -- \|\(em\| +. ds PI \(*p +. ds L" `` +. ds R" '' +'br\} +.\" +.\" If the F register is turned on, we'll generate index entries on stderr +.\" for titles (.TH), headers (.SH), subsections (.Sh), items (.Ip), and +.\" index entries marked with X<> in POD. Of course, you'll have to process +.\" the output yourself in some meaningful fashion. +.if \nF \{\ +. de IX +. tm Index:\\$1\t\\n%\t"\\$2" +.. +. nr % 0 +. rr F +.\} +.\" +.\" For nroff, turn off justification. Always turn off hyphenation; it +.\" makes way too many mistakes in technical documents. +.hy 0 +.if n .na +.\" +.\" Accent mark definitions (@(#)ms.acc 1.5 88/02/08 SMI; from UCB 4.2). +.\" Fear. Run. Save yourself. No user-serviceable parts. +.bd B 3 +. \" fudge factors for nroff and troff +.if n \{\ +. ds #H 0 +. ds #V .8m +. ds #F .3m +. ds #[ \f1 +. ds #] \fP +.\} +.if t \{\ +. ds #H ((1u-(\\\\n(.fu%2u))*.13m) +. ds #V .6m +. ds #F 0 +. ds #[ \& +. ds #] \& +.\} +. \" simple accents for nroff and troff +.if n \{\ +. ds ' \& +. ds ` \& +. ds ^ \& +. ds , \& +. ds ~ ~ +. ds / +.\} +.if t \{\ +. ds ' \\k:\h'-(\\n(.wu*8/10-\*(#H)'\'\h"|\\n:u" +. ds ` \\k:\h'-(\\n(.wu*8/10-\*(#H)'\`\h'|\\n:u' +. ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'^\h'|\\n:u' +. ds , \\k:\h'-(\\n(.wu*8/10)',\h'|\\n:u' +. ds ~ \\k:\h'-(\\n(.wu-\*(#H-.1m)'~\h'|\\n:u' +. ds / \\k:\h'-(\\n(.wu*8/10-\*(#H)'\z\(sl\h'|\\n:u' +.\} +. \" troff and (daisy-wheel) nroff accents +.ds : \\k:\h'-(\\n(.wu*8/10-\*(#H+.1m+\*(#F)'\v'-\*(#V'\z.\h'.2m+\*(#F'.\h'|\\n:u'\v'\*(#V' +.ds 8 \h'\*(#H'\(*b\h'-\*(#H' +.ds o \\k:\h'-(\\n(.wu+\w'\(de'u-\*(#H)/2u'\v'-.3n'\*(#[\z\(de\v'.3n'\h'|\\n:u'\*(#] +.ds d- \h'\*(#H'\(pd\h'-\w'~'u'\v'-.25m'\f2\(hy\fP\v'.25m'\h'-\*(#H' +.ds D- D\\k:\h'-\w'D'u'\v'-.11m'\z\(hy\v'.11m'\h'|\\n:u' +.ds th \*(#[\v'.3m'\s+1I\s-1\v'-.3m'\h'-(\w'I'u*2/3)'\s-1o\s+1\*(#] +.ds Th \*(#[\s+2I\s-2\h'-\w'I'u*3/5'\v'-.3m'o\v'.3m'\*(#] +.ds ae a\h'-(\w'a'u*4/10)'e +.ds Ae A\h'-(\w'A'u*4/10)'E +. \" corrections for vroff +.if v .ds ~ \\k:\h'-(\\n(.wu*9/10-\*(#H)'\s-2\u~\d\s+2\h'|\\n:u' +.if v .ds ^ \\k:\h'-(\\n(.wu*10/11-\*(#H)'\v'-.4m'^\v'.4m'\h'|\\n:u' +. \" for low resolution devices (crt and lpr) +.if \n(.H>23 .if \n(.V>19 \ +\{\ +. ds : e +. ds 8 ss +. ds o a +. ds d- d\h'-1'\(ga +. ds D- D\h'-1'\(hy +. ds th \o'bp' +. ds Th \o'LP' +. ds ae ae +. ds Ae AE +.\} +.rm #[ #] #H #V #F C +.\" ====================================================================== +.\" +.IX Title "DEP-CLEAN 1" +.TH DEP-CLEAN 1 "Copyright 2002 Gentoo Technologies, Inc." "2002-07-18" "GenToolKit's Dependency Checker!" +.UC +.SH "NAME" +dep-clean \- Gentoo: Shows unrequired packages and missing dependencies. +.SH "SYNOPSIS" +.IX Header "SYNOPSIS" +.Vb 1 +\& dep-clean [-RUNICv] +.Ve +.SH "DESCRIPTION" +.IX Header "DESCRIPTION" +dep-clean displays extraneous, missing or extra packages. Extra packages are those in which are not a part of the portage tree (/usr/portage). It does \s-1NOT\s0 modify the system in any way. +.SH "OPTIONS" +.IX Header "OPTIONS" +.Ip "\-N, \-\-needed" 4 +.IX Item "-N, --needed" +Display needed packages that are not installed. (red) (default) +.Ip "\-R, \-\-removed" 4 +.IX Item "-R, --removed" +Display installed packages not in portage. (yellow) (default) +.Ip "\-U, \-\-unneeded" 4 +.IX Item "-U, --unneeded" +Display unneeded packages that are installed. (green) (default) +.Ip "\-I, \-\-interactive" 4 +.IX Item "-I, --interactive" +Interactively modify world file before proceeding. +.Ip "\-C, \-\-nocolor" 4 +.IX Item "-C, --nocolor" +Output without color. Package types will be noted with R, U and N. +.Ip "\-v, \-\-verbose" 4 +.IX Item "-v, --verbose" +Be more verbose. +.Ip "\-q, \-\-quiet" 4 +.IX Item "-q, --quiet" +Be quiet (display only packages). +.SH "NOTES" +.IX Header "NOTES" +.Ip "" 4 +If this script is run on a system that is not up-to-date or which hasn't been cleaned (with 'emerge \-c') recently, the output may be deceptive. +.Ip "" 4 +If the same package name appears in all three categories, then it is definitely time to update that package and then run 'emerge \-c'. +.Ip "" 4 +The \-U, \-N and \-R options may be combined, default is \-UNR +.SH "AUTHORS" +.IX Header "AUTHORS" +Jerry Haltom <ssrit at larvalstage dot net> (dep-clean) +.br +Brandon Low <lostlogic at gentoo dot org> (dep-clean) +.PP +Paul Belt <gaarde at users dot sourceforge dot net> (man page) diff --git a/deprecated/old-scripts/ewhich b/deprecated/old-scripts/ewhich new file mode 100755 index 0000000..345ec34 --- /dev/null +++ b/deprecated/old-scripts/ewhich @@ -0,0 +1,44 @@ +#!/usr/bin/python +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header$ +# +# Author: Marius Mauch <genone@gentoo.org> +# +# ewhich is a tool to get the ebuild filename for a given package name + +import portage,sys,os +from output import * + +sys.stderr.write("\n" + red("!!!") + " As of Gentoolkit 0.2.0 this tool is deprecated\n") +sys.stderr.write(red("!!!") + " Refer to 'equery which' for a replacement\n\n") + +def print_help(): + print + print fuscia(os.path.basename(sys.argv[0])), "is a tool to get the filename of the ebuild for a given package" + print ' '*len(os.path.basename(sys.argv[0])), "that would be used by portage with the current configuration" + print + print yellow("Syntax:"), os.path.basename(sys.argv[0]), teal("<package>") + print + print teal("<package>"), "is either a simple package name (like "+green("xfree")+")," + print " a package name with category (like "+green("x11-base/xfree")+")" + print " or a DEPEND style atom as defined in ebuild(5) (like "+green(">=x11-base/xfree-4.3.0")+")" + print + +if len(sys.argv) <= 1 or sys.argv[1] == "-h" or sys.argv[1] == "--help": + print_help() + sys.exit(0) + +p = portage.db[portage.root]["porttree"].dbapi.xmatch("bestmatch-visible", sys.argv[1]) +if len(p) <= 1: + print + print red("*"), "\""+sys.argv[1]+"\" is not a valid package name or a masked package" + print + sys.exit(1) +pv = portage.catpkgsplit(p) +ebuild = "/"+pv[0]+"/"+pv[1]+"/"+p.split("/")[1]+".ebuild" +for ov in portage.settings["PORTDIR_OVERLAY"].split(): + if os.path.exists(ov+ebuild): + print os.path.normpath(ov+ebuild) + sys.exit(0) +print os.path.normpath(portage.settings["PORTDIR"]+ebuild) diff --git a/deprecated/old-scripts/ewhich.1 b/deprecated/old-scripts/ewhich.1 new file mode 100644 index 0000000..4bc5459 --- /dev/null +++ b/deprecated/old-scripts/ewhich.1 @@ -0,0 +1,24 @@ +.TH ewhich 1 "October 19, 2003" "ewhich" + +.SH NAME +ewhich \- Gentoo: program for resolving ebuild names + +.SH SYNOPSIS +.B ewhich +[ -h | --help ] <package> + +.SH DESCRIPTION +.B ewhich +is a little tool to find the actual ebuild file for a given package name. +It can use simple package names (like xfree), package names with category +(like x11-base/xfree) or DEPEND atoms (like >=x11-base/xfree-4.3.0). + +.SH BUGS +.B ewhich +No known bugs + +.SH SEE ALSO +emerge(1), make.conf(5), ebuild(5) + +.SH AUTHOR +Marius Mauch <genone@gentoo.org> diff --git a/deprecated/old-scripts/mkebuild b/deprecated/old-scripts/mkebuild new file mode 100644 index 0000000..9ee0ce1 --- /dev/null +++ b/deprecated/old-scripts/mkebuild @@ -0,0 +1,216 @@ +#!/bin/bash + +# Copyright (c) 2002 +# John Stalker +# Department of Mathematics +# Princeton University + +echo +echo -e "\x1b[31;01m!!! As of Gentoolkit 0.2.0, this tool is deprecated" +echo -e "!!!\x1b[0;0m Refer to app-portage/ebuilder for a replacement." +echo + +CONFIG_FILE=${HOME}/.mkebuild +if [ -e $CONFIG_FILE ] +then + source $CONFIG_FILE +else + echo This appears to be the first time you have used mkebuild. + echo I am going to make some guesses. If any of these are wrong + echo you should edit the file ${CONFIG_FILE}. + echo + MY_NAME=`awk -F":" '/^'${USER}:'/ { print $5 }' /etc/passwd` + echo Your name is ${MY_NAME}. + echo 'MY_NAME="'${MY_NAME}'"' >${CONFIG_FILE} + COPYRIGHT="Gentoo Technologies, Inc." + echo You wish to asign copyright to ${COPYRIGHT} + echo 'COPYRIGHT="'${COPYRIGHT}'"' >>${CONFIG_FILE} + MY_EMAIL=${USER}"@"${HOSTNAME} + echo Your email address is ${MY_EMAIL}. + echo 'MY_EMAIL='${MY_EMAIL} >>$CONFIG_FILE + LICENSE="the GNU General Public License, v2" + echo Your preferred license is ${LICENSE}. + echo 'LICENSE="'${LICENSE}'"' >>${CONFIG_FILE} + LOCAL_SOURCE=${HOME} + echo You download sources to ${LOCAL_SOURCE}. + echo LOCAL_SOURCE=${LOCAL_SOURCE} >>${CONFIG_FILE} + BUILD_DIRECTORY=${HOME} + echo You build packages in ${BUILD_DIRECTORY}. + echo 'BUILD_DIRECTORY='${BUILD_DIRECTORY} >>${CONFIG_FILE} + echo +fi +FILE_NAME=`basename $1` +SOURCE_LOCATION=`dirname $1` +PACKAGE_NAME=${FILE_NAME%.*} +FILE_EXTENSION=${FILE_NAME##*.} +if [ "${PACKAGE_NAME##*.}" = "tar" ] +then + FILE_EXTENSION=tar.${FILE_EXTENSION} + PACKAGE_NAME=${PACKAGE_NAME%.tar} +fi +EBUILD_FILE=${PWD}/${PACKAGE_NAME}.ebuild +echo "# Copyright" `date +"%Y"` ${COPYRIGHT} >${EBUILD_FILE} +echo "# Distributed under the terms of" ${LICENSE} >>${EBUILD_FILE} +#echo "# Author" ${MY_NAME} '<'${MY_EMAIL}'>' >>${EBUILD_FILE} +echo "# \$Header$" >>${EBUILD_FILE} +echo >>${EBUILD_FILE} +echo 'DESCRIPTION=""' >>${EBUILD_FILE} +echo 'SRC_URI="'${SOURCE_LOCATION}'/${P}.'${FILE_EXTENSION}'"' >>${EBUILD_FILE} +echo 'HOMEPAGE="'${SOURCE_LOCATION}'/"' >>${EBUILD_FILE} +echo 'LICENSE=""' >>${EBUILD_FILE} +echo 'SLOT="0"' >>${EBUILD_FILE} +echo 'KEYWORDS="~x86"' >>${EBUILD_FILE} +echo 'IUSE=""' >>${EBUILD_FILE} +echo >>${EBUILD_FILE} +echo 'DEPEND=""' >>${EBUILD_FILE} +echo >>${EBUILD_FILE} +echo '#RDEPEND=""' >>${EBUILD_FILE} +echo 'S=${WORKDIR}/${P}' >>${EBUILD_FILE} +echo >>${EBUILD_FILE} +echo 'src_unpack() {' >>${EBUILD_FILE} +echo >>${EBUILD_FILE} +echo -e "\t"'unpack ${A}' >>${EBUILD_FILE} +echo -e "\t"'cd ${S}' >>${EBUILD_FILE} +echo >>${EBUILD_FILE} +echo '}' >>${EBUILD_FILE} +if [ -e ${LOCAL_SOURCE}/${FILE_NAME} ] +then + echo I am assuming that $1 really + echo exists and that ${LOCAL_SOURCE}/${FILE_NAME} + echo is a faithful copy. +else + echo I didn\'t find ${LOCAL_SOURCE}/${FILE_NAME} so I will fetch + echo $1. + cd ${LOCAL_SOURCE} + wget $1 +fi +if [ -e ${BUILD_DIRECTORY}/${PACKAGE_NAME} ] +then + echo + echo I am assuming that ${BUILD_DIRECTORY}/${PACKAGE_NAME} \ + is the unpacked + echo version of ${LOCAL_SOURCE}/${FILE_NAME}. +else + cd ${BUILD_DIRECTORY} + if [ $? -ne 0 ] + then + echo + echo I was unable to enter the directory ${BUILD_DIRECTORY}. + exit 1 + fi + case "${FILE_EXTENSION}" in + tar.gz|tgz) + tar xzf ${LOCAL_SOURCE}/${FILE_NAME} + ;; + tar.bz2|tbz2) + tar xjf ${LOCAL_SOURCE}/${FILE_NAME} + ;; + tar.Z|tar.z) + unzip ${LOCAL_SOURCE}/${FILE_NAME} + tar xf ${PACKAGE_NAME}.tar + ;; + *) + echo + echo I can\'t figure out how to uncompress + echo ${LOCAL_SOURCE}/${FILE_NAME} + exit 1 + esac + if [ $? -ne 0 ] + then + echo + echo I was unable to uncompress ${LOCAL_SOURCE}/${FILE_NAME}. + exit 1 + fi +fi +cd ${BUILD_DIRECTORY}/${PACKAGE_NAME} +if [ $? -ne 0 ] +then + echo + echo I could not change directory to ${BUILD_DIRECTORY}/${PACKAGE_NAME} + exit 1 +fi +echo +echo You might want to look at the following files for configuration and +echo dependency information: +find ${PWD} -name README -print +find ${PWD} -name README.txt -print +find ${PWD} -name INSTALL -print +find ${PWD} -name INSTALL.txt -print +find ${PWD} -name Changes -print +find ${PWD} -name CHANGES.txt -print +find ${PWD} -name FAQ.txt +find ${PWD} -name ChangeLog -print +find ${PWD} -name NEWS -print +echo >>${EBUILD_FILE} +echo 'src_compile() {' >>${EBUILD_FILE} +echo >>${EBUILD_FILE} +echo +if [ -e Imakefile ] +then + echo I found an Imakefile. I am assuming that we should use xmkmf. + echo I don\'t really understand xmkmf so you will have to configure + echo things on your own. + echo + echo -e "\t"'xmkmf || die' >>${EBUILD_FILE} + echo -e "\tmake Makefiles" >>${EBUILD_FILE} + echo -e "\tmake includes" >>${EBUILD_FILE} + echo -e "\tmake depend" >>${EBUILD_FILES} +elif [ -e configure ] +then + echo I found a configure file. I am assuming that we are using autoconf +. + echo I will take care of setting the most commonly used options. I am + echo including a list of all the available options to confiigure, commen +ted + echo out. You might want to look it over to see if I have missed anythi +ng. + echo + ./configure --help >.config.options + echo -e "\t./configure \\" >>${EBUILD_FILE} + awk '/--prefix/ { print "\t\t--prefix=/usr \\"}' \ + .config.options >>${EBUILD_FILE} + awk '/--infodir/ { print "\t\t--infodir=/usr/share/info \\"}' \ + .config.options >>${EBUILD_FILE} + awk '/--mandir/ { print "\t\t--mandir=/usr/share/man \\"}' \ + .config.options >>${EBUILD_FILE} + echo -e "\t\t"'|| die "./configure failed"' >>${EBUILD_FILE} + echo -e "#\tAvailable options to configure:" >>${EBUILD_FILE} + awk '/--/ { print "#" $0 }' .config.options >>${EBUILD_FILE} + echo -e "\t"'emake || die' >>${EBUILD_FILE} +elif [ -e Makefile ] +then + echo I found a Makefile. You should look at it and possibly prepare + echo a patch. + echo + echo -e "\temake || die" >>${EBUILD_FILE} +else + echo I couldn\'t find a Imakefile, configure script, or Makefile for + echo this package. You will have to figure out what to do on your + echo own. + echo +fi +echo '}' >>${EBUILD_FILE} +echo >>${EBUILD_FILE} +echo 'src_install () {' >>${EBUILD_FILE} +echo >>${EBUILD_FILE} +echo -e "\t"'make DESTDIR=${D} install || die' >>${EBUILD_FILE} +echo '}' >>${EBUILD_FILE} +echo >>${EBUILD_FILE} +echo >>${EBUILD_FILE} +echo >>${EBUILD_FILE} +echo I couldn\'t supply a package description for the ebuild file +echo because I don\'t know what ${PACKAGE_NAME} does. +echo +echo I am assume the hompage for this package is ${SOURCE_LOCATION}/. +echo If that is not correct you will need to edit that portion of +echo the ebuild file as well. +echo +echo I don\'t understand dependencies yet. You will have to add any +echo dependencies you know of by hand. Then try your ebuild script +echo out to see if there are any dependencies you don\'t know of. +echo +echo I am assuming that this package comes with a well-behaved Makefile +echo which does not install anything outside of '${DESTDIR}'. You will +echo need to check this by looking at the portion of the Makefile +echo beginning with the line '"install:"'. + diff --git a/deprecated/old-scripts/mkebuild.1 b/deprecated/old-scripts/mkebuild.1 new file mode 100644 index 0000000..e800d4d --- /dev/null +++ b/deprecated/old-scripts/mkebuild.1 @@ -0,0 +1,20 @@ +.TH mkebuild "1" "Nov 2003" "gentoolkit" +.SH NAME +mkebuild \- Gentoo: Interactive ebuild generator +.SH SYNOPSIS +.B mkebuild +.SH BUGS +This tool is obsolete, as of gentoolkit 0.2.0. +Use ebuilder [app\-portage/ebuilder] instead. +.SH SEE ALSO +.BR ebuilder(1) +.br +.BR /usr/sbin/ebuilder +.br +.BR /usr/sbin/mkebuild + +.SH AUTHORS +This informative man page was written by Karl Trygve Kalleberg +<karltk@gentoo.org> and expanded by Katerina Barone\-Adesi +<katerinab@gmail.com>. + diff --git a/deprecated/old-scripts/pkg-clean b/deprecated/old-scripts/pkg-clean new file mode 100644 index 0000000..9b07337 --- /dev/null +++ b/deprecated/old-scripts/pkg-clean @@ -0,0 +1,107 @@ +#!/usr/bin/python +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header$ +# Author: Leo Lipelis <aeoo@gentoo.org> +# Author: Karl Trygve Kalleberg <karltk@gentoo.org> + +import commands +import re +import sys +import time +import os +from output import * + +print +print red("!!! As of Gentoolkit 0.2.0, this tool is deprecated") +print red("!!!") + " Refer to 'emerge clean' and 'emerge depclean' for replacements." +print + +time.sleep(4) + +# constants for package tuples that are stored in pkg_hash +PKG_TIME = 0 # number of seconds for ctime function +PKG = 1 # package full path as accepted by ebuild +PKG_NAME = 2 # package name as accepted by emerge + +(status, pkg_files) = commands.getstatusoutput( + "find /var/db/pkg -iname '*.ebuild' -printf '%T@ %p\n' | sort -n") + +pkg_file_list = pkg_files.splitlines() + +pkg_hash = {} +for time_pkg_pair in pkg_file_list: + (pkg_time, pkg) = time_pkg_pair.split() + pkg_time = int(pkg_time) + # This covers developer trees with not-accepted categories + tmp_name = re.match(r'/var/db/pkg/(.*/.*)/.*', pkg) + if not tmp_name: continue + pkg_name = tmp_name.group(1) + tmp_core = re.match(r'(.*)-\d.*', pkg_name) + if not tmp_core: continue + pkg_core = tmp_core.group(1) + if pkg_hash.has_key(pkg_core): + pkg_hash[pkg_core].append((pkg_time, pkg, pkg_name)) + else: + pkg_hash[pkg_core] = [(pkg_time, pkg, pkg_name)] + +total_len = len(pkg_hash.keys()) +curpkg = 0 +tmpname = os.tmpnam() +assume_yes = 0 + +if len(sys.argv) > 1: + if sys.argv[1] in ["-y", "--yes"]: + assume_yes = 1 + elif sys.argv[1] in ["-h", "--help"]: + print """pkg-clean [options] + +-y, --yes Don't ask for individual confirmation before unmerging; assume yes. +""" + sys.exit(0) + +for pkg_core in pkg_hash.keys(): + print "Examining %s:" % (pkg_core) + if len(pkg_hash[pkg_core]) < 2: + continue + unmerged_indexes = [] + + curpkg += 1 + choices = "" + idx = 1 + for pkg_tuple in pkg_hash[pkg_core]: + choices += " %d \"%s %s\" 0" % \ + (idx, time.ctime(pkg_tuple[PKG_TIME]), + pkg_tuple[PKG_NAME]) + idx += 1 + + params = "dialog --separate-output --backtitle \"pkg-clean processing package %d of %d\" " % ( curpkg, total_len) + params += "--checklist \"Select which package(s) to unmerge\" 20 70 12" + choices + res = os.system(params + " 2> " + tmpname) + if res: + sys.exit(0) + + ins = open(tmpname) + for j in ins.readlines(): + idx = int(j) + if idx == 0: + break + + full_path = pkg_hash[pkg_core][idx-1][PKG] + ebuild = full_path.replace('/var/db/pkg','') + + if not assume_yes: + params = "dialog --backtitle \"" + ebuild + "\" " + \ + "--yesno \"Are you sure you want to unmerge " + ebuild + " ?\" 20 70" + res = os.system(params) + else: + res = 0 + + if res == 0: + (status, unmerge_out) = commands.getstatusoutput( + "ebuild %s unmerge" % (full_path)) + print unmerge_out + time.sleep(2) + if status != 0: + sys.exit(status) + ins.close() diff --git a/deprecated/old-scripts/pkg-clean.1 b/deprecated/old-scripts/pkg-clean.1 new file mode 100644 index 0000000..7a295f3 --- /dev/null +++ b/deprecated/old-scripts/pkg-clean.1 @@ -0,0 +1,20 @@ +.TH pkg\-clean "1" "Nov 2003" "gentoolkit" +.SH NAME +pkg\-clean \- Gentoo: Clean obsolete packages +.SH SYNOPSIS +.B pkg\-clean +.SH BUGS +This tool is obsolete, as of gentoolkit 0.2.0. +Use 'emerge clean' or 'emerge depclean' (with caution; read the man page) +instead. + +.SH SEE ALSO +.BR emerge(1) +.br +.BR /usr/sbin/pkg\-clean + +.SH AUTHORS +This informative man page was written by Karl Trygve Kalleberg +<karltk@gentoo.org> and expanded by Katerina Barone\-Adesi +<katerinab@gmail.com>. + diff --git a/deprecated/old-scripts/pkg-size b/deprecated/old-scripts/pkg-size new file mode 100644 index 0000000..8770db7 --- /dev/null +++ b/deprecated/old-scripts/pkg-size @@ -0,0 +1,63 @@ +#!/bin/sh +# Copyright 1999-2003 Gentoo Technologies, Inc. +# Distributed under the terms of the GNU General Public License v2 +# $Header$ +# Author: Karl Trygve Kalleberg <karltk@gentoo.org> + +echo +echo -e "\x1b[31;01m!!! As of Gentoolkit 0.2.0, this tool is deprecated." +echo -e "!!!\x1b[0;0m Refer to 'equery size' for a replacement." +echo + +spec=$1 + +if [ -z "$spec" ] ; then + echo "Usage: pkg-size package" + exit 1 +fi + +name=`echo $1 | sed "s/\([^/]*\)\///"` +category=`echo $1 | sed "s/\/.*//"` + +if [ "$category" == "$name" ] ; then + category= +fi + +function tryfile() { + local foo + foo=/var/db/pkg/$1/CONTENTS + bar=`ls $foo 2> /dev/null` + for i in $bar ; do + if [ -f "$i" ] ; then + echo $i + break + fi + done +} + +file=`tryfile "${category}/${name}"` +if [ -z $file ] ; then + file=`tryfile "${category}/${name}*"` + if [ -z $file ] ; then + file=`tryfile "${category}*/${name}"` + if [ -z $file ] ; then + file=`tryfile "${category}*/${name}*"` + if [ -z $file ] ; then + echo "!!! Package resembling ${category}/${name} not found" + exit 1 + fi + fi + fi +fi + +pkgname=`echo $file | sed -e "s:\/var\/db\/pkg\/::" -e "s:\/CONTENTS::"` + +totals=`cat $file|grep "obj"|awk '{ print $2 }' | sed "s/ /\\ /" | xargs du -scb | grep total | cut -f 1` + +size=0 +for i in $totals ; do + size=$[size+i] +done + +echo "$pkgname $size ($[size/1024]KB)" + diff --git a/deprecated/old-scripts/pkg-size.1 b/deprecated/old-scripts/pkg-size.1 new file mode 100644 index 0000000..b195412 --- /dev/null +++ b/deprecated/old-scripts/pkg-size.1 @@ -0,0 +1,11 @@ +.TH pkg-size "1" "Nov 2003" "gentoolkit" +.SH NAME +pkg-size \- Gentoo: Package size calculator +.SH SYNOPSIS +.B pkg-size +\fIpackage\fR +.SH DESCRIPTION +Calculate size of \fIpackage\fR. +.SH AUTHORS +\fBpkg-size\fR was written by Karl Trygve Kalleberg <karltk@gentoo.org>. + |