summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBrandon Low <lostlogic@gentoo.org>2002-07-14 22:39:40 +0000
committerBrandon Low <lostlogic@gentoo.org>2002-07-14 22:39:40 +0000
commit5dc78e4f67a904c29dda90b48cab00b8c226f182 (patch)
treea910c7270ccc6358000edfdb4a9ccc4666fbd379 /app-admin
parentremoved non-existent version of gkrellm-seti (diff)
downloadgentoo-2-5dc78e4f67a904c29dda90b48cab00b8c226f182.tar.gz
gentoo-2-5dc78e4f67a904c29dda90b48cab00b8c226f182.tar.bz2
gentoo-2-5dc78e4f67a904c29dda90b48cab00b8c226f182.zip
New gentoolkit revision fixes fairly critical bug in etc-update
etc-update didn't keep perms on merged files. Other etc-update bugfixes Add feature to qpkg.
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/gentoolkit/ChangeLog12
-rw-r--r--app-admin/gentoolkit/files/digest-gentoolkit-0.1.14 (renamed from app-admin/gentoolkit/files/digest-gentoolkit-0.1.13)0
-rw-r--r--app-admin/gentoolkit/files/etc-update/ChangeLog6
-rw-r--r--app-admin/gentoolkit/files/etc-update/etc-update120
-rw-r--r--app-admin/gentoolkit/files/etc-update/etc-update.conf3
-rw-r--r--app-admin/gentoolkit/files/scripts/qpkg61
-rw-r--r--app-admin/gentoolkit/files/scripts/qpkg.113
-rw-r--r--app-admin/gentoolkit/gentoolkit-0.1.14.ebuild (renamed from app-admin/gentoolkit/gentoolkit-0.1.13.ebuild)2
8 files changed, 160 insertions, 57 deletions
diff --git a/app-admin/gentoolkit/ChangeLog b/app-admin/gentoolkit/ChangeLog
index 0c490e18cb89..7e09d9a81474 100644
--- a/app-admin/gentoolkit/ChangeLog
+++ b/app-admin/gentoolkit/ChangeLog
@@ -1,6 +1,16 @@
# ChangeLog for app-admin/gentoolkit
# Copyright 2002 Gentoo Technologies, Inc.; Distributed under the GPL
-# $Header: /var/cvsroot/gentoo-x86/app-admin/gentoolkit/ChangeLog,v 1.26 2002/07/03 23:55:36 karltk Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/gentoolkit/ChangeLog,v 1.27 2002/07/14 22:39:40 lostlogic Exp $
+
+*gentoolkit-0.1.14 (14 Jul 2002)
+
+ 14 Jul 2002; Brandon Low <lostlogic@gentoo.org> files/scripts/qpkg files/scripts/qpkg.1
+ files/etc-update/etc-update files/etc-update/ChangeLog:
+
+ Added -q --query-deps option to qpkg and qpkg.1.
+ See `man qpkg` or `qpkg --help` for more information
+
+ See etc-update specific ChangeLog for etc-update changes.
*gentoolkit-0.1.13 (25 Jun 2002)
diff --git a/app-admin/gentoolkit/files/digest-gentoolkit-0.1.13 b/app-admin/gentoolkit/files/digest-gentoolkit-0.1.14
index e69de29bb2d1..e69de29bb2d1 100644
--- a/app-admin/gentoolkit/files/digest-gentoolkit-0.1.13
+++ b/app-admin/gentoolkit/files/digest-gentoolkit-0.1.14
diff --git a/app-admin/gentoolkit/files/etc-update/ChangeLog b/app-admin/gentoolkit/files/etc-update/ChangeLog
index 7137635851f0..f78b939bbd7e 100644
--- a/app-admin/gentoolkit/files/etc-update/ChangeLog
+++ b/app-admin/gentoolkit/files/etc-update/ChangeLog
@@ -1,3 +1,9 @@
+2002-07-14 Brandon Low <lostlogic@gentoo.org>
+ * Reasonable defaults
+ * Important: set correct permisions on merged files
+ * Began adding support for config setting "mode"
+ which is 0 for text mode and 1 for menu mode
+
2002-06-25 Brandon Low <lostlogic@gentoo.org>
* Users get to choose from list of all files at startup
* Menus are easier to use
diff --git a/app-admin/gentoolkit/files/etc-update/etc-update b/app-admin/gentoolkit/files/etc-update/etc-update
index 391de619b05c..06e1ba609a83 100644
--- a/app-admin/gentoolkit/files/etc-update/etc-update
+++ b/app-admin/gentoolkit/files/etc-update/etc-update
@@ -8,7 +8,7 @@
# Leo Lipelis <aeoo@gentoo.org>
# Karl Trygve Kalleberg <karltk@gentoo.org>
#
-# $Header: /var/cvsroot/gentoo-x86/app-admin/gentoolkit/files/etc-update/etc-update,v 1.9 2002/06/26 23:13:14 lostlogic Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/gentoolkit/files/etc-update/etc-update,v 1.10 2002/07/14 22:39:40 lostlogic Exp $
function get_config() {
item=$1
@@ -45,20 +45,20 @@ function scan() {
if [[ "${ofile:10}" != "${rfile:10}" ]] ||
[[ ${opath} != ${rpath} ]]; then
if [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}|
- grep "^[+-][^+-]"|grep -v '# $Header: /var/cvsroot/gentoo-x86/app-admin/gentoolkit/files/etc-update/etc-update,v 1.9 2002/06/26 23:13:14 lostlogic Exp $'` ]]; then
+ grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then
mv ${rpath}/${rfile} ${rpath}/${rfile:10}
continue
else
count=${count}+1
echo "${rpath}/${rfile:10}" > ${TMP}/files/${count}
echo "${rpath}/${rfile}" >> ${TMP}/files/${count}
- ofile="${rfile}"
+ ofile="${rfile}"
opath="${rpath}"
continue
fi
fi
if [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${ofile}|
- grep "^[+-][^+-]"|grep -v '# $Header: /var/cvsroot/gentoo-x86/app-admin/gentoolkit/files/etc-update/etc-update,v 1.9 2002/06/26 23:13:14 lostlogic Exp $'` ]]; then
+ grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then
mv ${rpath}/${rfile} ${rpath}/${ofile}
continue
else
@@ -72,18 +72,40 @@ function scan() {
}
function sel_file() {
-# [ ! -z `ls ${TMP}/files` ] && \
+ local -i isfirst=0
until [ -f ${TMP}/files/${input} ] || [ ${input} == -1 ]; do
- echo "The following is the list of files which need updating, each
+ if (( ${mode} == 0 )); then
+ echo "The following is the list of files which need updating, each
configuration file is followed by a list of possible replacement files."
+ else
+ local my_title="Please select a file to update"
+ fi
for file in `ls ${TMP}/files|sort -n`; do
- echo -n "${file}) "
- for word in `cat ${TMP}/files/${file}`; do
- echo ${word}
- done
- done
- echo -n "Please select a file to edit by entering the corresponding number (-1 to exit): "
- read input
+ if (( ${isfirst} == 0 )); then
+ isfirst=${file}
+ fi
+ echo -n "${file}${PAR} "
+ if (( ${mode} == 0 )); then
+ for word in `cat ${TMP}/files/${file}`; do
+ echo ${word}
+ done
+ else
+ head -n1 ${TMP}/files/${file}
+ fi
+ done > ${TMP}/menuitems
+ if (( ${mode} == 0 )); then
+ cat ${TMP}/menuitems
+ echo -n "Please select a file to edit by entering the corresponding number (-1 to exit): "
+ read input
+ else
+ dialog --title "${title}" --menu "${my_title}" \
+ 0 0 0 `echo "-1 Exit";cat ${TMP}/menuitems` \
+ 2> ${TMP}/input
+ input=`cat ${TMP}/input`
+ fi
+ if (( ${input} == 0 )); then
+ input=${isfirst}
+ fi
done
}
@@ -99,18 +121,36 @@ function do_file() {
fcount=0
for line in `cat ${TMP}/files/${input}`; do
if (( ${fcount} > 0 )); then
- echo -n "${fcount}) "
+ echo -n "${fcount}${PAR} "
echo "${line}"
else
- echo "Below are the new config files for ${line}:"
+ if (( ${mode} == 0 )); then
+ echo "Below are the new config files for ${line}:"
+ else
+ local my_title="Please select a file to process for ${line}"
+ fi
fi
fcount=${fcount}+1
- done
- echo -n "Please enter the number of the file to process (-1 to exit this file): "
- read my_input
- [ ${my_input} == -1 ] && break
+ done > ${TMP}/menuitems
+ if (( ${mode} == 0 )); then
+ cat ${TMP}/menuitems
+ echo -n "Please select a file to process (-1 to exit this file): "
+ read my_input
+ else
+ dialog --title "${title}" --menu "${my_title}" \
+ 0 0 0 `cat ${TMP}/menuitems;echo "${fcount} Exit"` \
+ 2> ${TMP}/input
+ my_input=`cat ${TMP}/input`
+ fi
+ if (( ${my_input} == 0 )); then
+ my_input=1
+ elif (( ${my_input} == ${fcount} )); then
+ break
+ fi
done
- [ ${my_input} == -1 ] && break
+ if (( ${my_input} == ${fcount} )); then
+ break
+ fi
fcount=${my_input}+1
@@ -122,7 +162,9 @@ function do_file() {
cat ${TMP}/files/${input}|sed -e "${fcount}!p;d" > ${TMP}/files/sed
mv ${TMP}/files/sed ${TMP}/files/${input}
- [ ${my_input} == -1 ] && break
+ if (( ${my_input} == -1 )); then
+ break
+ fi
done
echo
rm ${TMP}/files/${input}
@@ -140,11 +182,11 @@ function do_cfg() {
`echo "${diff_command}" |
sed -e "s:%file1:${ofile}:" \
-e "s:%file2:${file}:"` ) | ${pager}
- echo -n "1) Replace ${ofile} with ${file}
-2) Delete ${file}, keeping ${ofile} as is
-3) Interactively merge ${ofile} with ${file}
+ echo -n "1) Replace original with update
+2) Delete update, keeping original as is
+3) Interactively merge original with update
4) Show differences again
-Please select from the menu above (-1 to exit, ignoring this updated file):"
+Please select from the menu above (-1 to ignore this update): "
read my_input
case ${my_input} in
1) echo "Replacing ${ofile} with ${file}"
@@ -188,13 +230,14 @@ function do_merge() {
-e "s:%new:${file}:g"`
until (( ${my_input} == -1 )); do
echo -n "1) Replace ${ofile} with merged file
-2) Show differences between merged file and ${ofile}
-3) Remerge ${ofile} with ${file}
+2) Show differences between merged file and original
+3) Remerge original with update
4) Return to the previous menu
-Please select from the menu above (-1 to exit, ignoring ${file}): "
+Please select from the menu above (-1 to exit, losing this merge): "
read my_input
case ${my_input} in
1) echo "Replacing ${ofile} with ${mfile}"
+ chmod --reference=${ofile} ${mfile}
mv ${mv_opts} ${mfile} ${ofile}
rm ${rm_opts} ${file}
return 255
@@ -247,20 +290,37 @@ cp_opts=`get_config cp_opts`
pager=`get_config pager`
diff_command=`get_config diff_command`
merge_command=`get_config merge_command`
+declare -i mode=`get_config mode`
+[ -z ${mode} ] && mode=0
[ -z ${pager} ] && pager="cat"
#echo "rm_opts: $rm_opts, mv_opts: $mv_opts, cp_opts: $cp_opts"
#echo "pager: $pager, diff_command: $diff_command, merge_command: $merge_command"
+if (( ${mode} == 0 )); then
+ PAR=")"
+else
+ PAR=""
+ rm_opts=""
+ mv_opts=""
+ cp_opts=""
+ pager=""
+fi
+
declare -i count=0
declare -i input=0
+declare title="Gentoolkit's etc-update tool!"
scan
until (( ${input} == -1 )); do
- [ ${count} == 0 ] && die "No files to work on!" 0
+ if (( ${count} == 0 )); then
+ die "No files to work on!" 0
+ fi
sel_file
- [ ${input} != -1 ] && do_file
+ if (( ${input} != -1 )); then
+ do_file
+ fi
done
die "User termination!" 0
diff --git a/app-admin/gentoolkit/files/etc-update/etc-update.conf b/app-admin/gentoolkit/files/etc-update/etc-update.conf
index 5cd842fc4778..a623e0ce7bf9 100644
--- a/app-admin/gentoolkit/files/etc-update/etc-update.conf
+++ b/app-admin/gentoolkit/files/etc-update/etc-update.conf
@@ -1,5 +1,8 @@
# edit the lines below to your liking
+# mode - 0 for text, 1 for menu (support incomplete)
+mode="0"
+
# arguments used whenever rm is called
rm_opts="-i"
diff --git a/app-admin/gentoolkit/files/scripts/qpkg b/app-admin/gentoolkit/files/scripts/qpkg
index 602f56a77f68..fb8f947aca20 100644
--- a/app-admin/gentoolkit/files/scripts/qpkg
+++ b/app-admin/gentoolkit/files/scripts/qpkg
@@ -7,8 +7,8 @@
#
# Maintainer: Brandon Low <lostlogic@gentoo.org>
#
-# $Header: /var/cvsroot/gentoo-x86/app-admin/gentoolkit/files/scripts/qpkg,v 1.12 2002/06/26 22:14:37 lostlogic Exp $
-ID='$Id: qpkg,v 1.12 2002/06/26 22:14:37 lostlogic Exp $'
+# $Header: /var/cvsroot/gentoo-x86/app-admin/gentoolkit/files/scripts/qpkg,v 1.13 2002/07/14 22:39:40 lostlogic Exp $
+ID='$Id: qpkg,v 1.13 2002/07/14 22:39:40 lostlogic Exp $'
VERSION=0.`echo ${ID} | cut -d\ -f3`
PROG=`basename ${0}`
@@ -36,6 +36,10 @@ do
inst=y
;;
+ -q|--query-deps)
+ query=y
+ ;;
+
-s|--slot)
slot=y
;;
@@ -124,6 +128,7 @@ if [ ! "${nocolor}" ]; then
BR="\x1b[0;01m"
CY="\x1b[36;01m"
RD="\x1b[31;01m"
+ GR="\x1b[32;01m"
YL="\x1b[33;01m"
BL="\x1b[34;01m"
STAR=" *"
@@ -154,29 +159,31 @@ ${T}${CY}${PROG}${NO} ${BL}--dups${NO} [${BL}--slot${NO}]
${T}${CY}${PROG}${NO} ${BL}--help${NO}
${BR}Duplicate Locating:
- ${BL}-d, --dups${NO}${T}${T} print packages that have multiple versions installed
- ${BL}-s, --slot${NO}${T}${T} make ${BL}-d${NO} SLOT only print dups of the same SLOT
+ ${BL}-d, --dups${NO}${T}${T}print packages that have multiple versions installed
+ ${BL}-s, --slot${NO}${T}${T}make ${BL}-d${NO} SLOT only print dups of the same SLOT
${BR}Package Selection:
- ${BL}-f, --find-file${NO}${T} finds package that owns file <file>
- ${BL}-fp, --find-pattern${NO}${T} finds to package that owns file matching *<pattern>*
- ${BL}-I, --installed${NO}${T} Include${YL} only${NO} installed packages
- ${BL}-U, --uninstalled${NO}${T} Include${YL} only${NO} uninstalled packages
- ${BL}-g, --group${NO}${T}${T} Find by goup (can be combined with other searches)
+ ${BL}-f, --find-file${NO}${T}finds package that owns file <file>
+ ${BL}-fp, --find-pattern${NO}${T}finds to package that owns file matching *<pattern>*
+ ${BL}-I, --installed${NO}${T}Include${YL} only${NO} installed packages
+ ${BL}-U, --uninstalled${NO}${T}Include${YL} only${NO} uninstalled packages
+ ${BL}-g, --group${NO}${T}${T}Find by goup (can be combined with other searches)
${BR}Information Selection:
- ${BL}-l, --list${NO}${T}${T} List package content
- ${BL}-i, --info${NO}${T}${T} Get package description and home page.
+ ${BL}-l, --list${NO}${T}${T}List package content
+ ${BL}-i, --info${NO}${T}${T}Get package description and home page.
${BL}-ct, --check-time${NO}
- ${BL}-tc, --time-check${NO}${T} Verify package files timestamps
+ ${BL}-tc, --time-check${NO}${T}Verify package files timestamps
${BL}-cm, --check-md5${NO}
- ${BL}-mc, --md5-check${NO}${T} Verify package files md5
- ${BL}-c, --check${NO}${T}${T} Verify mtimes${YL} and${NO} md5.
+ ${BL}-mc, --md5-check${NO}${T}Verify package files md5
+ ${BL}-c, --check${NO}${T}${T}Verify mtimes${YL} and${NO} md5.
+ ${BL}-q, --query-deps${NO}${T}display all installed packages
+${T}${T}${T}depending on selected packages
${BR}Operation Modifiers:
- ${BL}-nc, --no-color${NO}${T} don't use colors
- ${BL}-v, --verbose${NO}${T} Be more verbose [ can be repeated twise ]
- ${BL}-vv${NO}${T}${T}${T} Same as ${BL}-v -v${NO}
+ ${BL}-nc, --no-color${NO}${T}don't use colors
+ ${BL}-v, --verbose${NO}${T}Be more verbose [ can be repeated twise ]
+ ${BL}-vv${NO}${T}${T}${T}Same as ${BL}-v -v${NO}
${YL}Notes${NO}:
${YL}*${NO} ${BL}-f${NO}, ${BL}-fp, ${BL}-d${NO}, ${BL}-l${NO}, ${BL}-ct${NO}, ${BL}-cm${NO}, and ${BL}-c${NO} apply only to installed packages.
@@ -203,7 +210,6 @@ ${YL}Examples${NO}:
exit
fi
-
#For the --dups switch only
if [ "${dups}" ]; then
#First dig out the list of packages with duplicates
@@ -254,7 +260,7 @@ if [ "${dups}" ]; then
else
echo -n "${duppak}"|cut -f2 -d" "| \
sed -e "s:-r[0-9]\+$::" \
- -e "s:-[0-9][^-]*$::" \
+ -e "s:-[0-9].*$::" \
-e "s:\(^[^/]*/\)\(.*\):${BR}\1${CY}\2${NO}:"|uniq
fi
exit
@@ -324,6 +330,19 @@ for p in ${ipak} ${upak} -;do
echo -e "${T}${BL}${desc}${NO} [ ${YL}${home}${NO} ]"
fi
+ if [ "${query}" ]; then
+ echo -e "${BL}DEPENDED ON BY:${NO}"
+ package="`echo ${n}|sed -e 's:-r[0-9]\+$::' \
+ -e 's:-[0-9].*$::' \
+ -e 's:^iii ::' \
+ -e 's:^uuu ::'`"
+ place="`echo ${n}|cut -f1 -d' '`"
+ [[ "${place}" == "iii" ]] && color="${GR}" || color="${RD}"
+ grep -R "${package}" /var/db/pkg/*/*/RDEPEND | \
+ cut -f5,6 -d"/" | sed -e "s:^:\t${color}:;s:$:${NO}:" | sort | uniq
+# gawk -F "/" '{printf("${place}\n\t%s/%s${NO}",$5,$6)}' | sort | uniq
+ fi
+
# cat package content, remove obj/sym/dir, md5 and mtime when not verbose
# display only match in file-find mode unless extra verbose
if [ "${list}" ]; then
@@ -438,9 +457,9 @@ for p in ${ipak} ${upak} -;do
fi
done | (
- if [ ! \( "${tcheck}" -o "${mcheck}" -o "${info}" -o "${list}" -o ${verb} -gt 0 \) ]; then
+ if [ ! \( "${tcheck}" -o "${mcheck}" -o "${info}" -o "${list}" -o "${query}" -o ${verb} -gt 0 \) ]; then
sed -e "s:-r[0-9]\+$::" -e "s:-[0-9][^-]*$::"|sort -k2|uniq -1
- elif [ ${verb} -lt 2 ]; then
+ elif [ ! \( "${tcheck}" -o "${mcheck}" -o "${info}" -o "${list}" -o "${query}" -o ${verb} -lt 2 \) ]; then
sort -k2|uniq -1
else
cat
diff --git a/app-admin/gentoolkit/files/scripts/qpkg.1 b/app-admin/gentoolkit/files/scripts/qpkg.1
index d042c4f59b03..b9803b7dcde8 100644
--- a/app-admin/gentoolkit/files/scripts/qpkg.1
+++ b/app-admin/gentoolkit/files/scripts/qpkg.1
@@ -6,7 +6,7 @@ qpkg \- the "query package" tool for Gentoo Linux
.B qpkg\fR [\fIoptions\fR] [\fIpkgname\fR] [\fI\-g group\fR]
.br
[\fI\-f <file>\fR|\fI\-fp <pattern>\fR]
-.br
+.TP
.B qpkg \fI\-\-dups\fR [\fI\-\-slot\fR]
.TP
.B qpkg \fI\-\-help\fR
@@ -16,8 +16,8 @@ qpkg is GenToolKit's "query package" tool, using it, you can find packages ownin
.LP
.I Duplicate Locating:
.LP
-.B \-d, \-\-dups\fR print packages that have multiple
-.br
+.B \-d, \-\-dups\fR print packages that have multiple
+.br
versions installed
.br
.B \-s, \-\-slot\fR make \-d SLOT only print dups of the
@@ -36,7 +36,7 @@ qpkg is GenToolKit's "query package" tool, using it, you can find packages ownin
.br
.B \-U, \-\-uninstalled\fR Include only uninstalled packages
.br
-.B \-g, \-\-group\fR Find by group (can be combined with
+.B \-g, \-\-group\fR Find by goup (can be combined with
.br
other searches)
.LP
@@ -55,6 +55,10 @@ qpkg is GenToolKit's "query package" tool, using it, you can find packages ownin
.B \-mc, \-\-md5\-check\fR Verify package files md5
.br
.B \-c, \-\-check\fR Verify mtimes and md5.
+.br
+.B \-q, \-\-query\-deps\fR display all installed packages
+.br
+\fR depending on selected packages
.LP
.I Operation Modifiers:
.LP
@@ -103,3 +107,4 @@ Brandon Low <lostlogic@gentoo.org>, 2002: maintainance
ebuild(5)
.TP
The \fI/usr/sbin/qpkg\fR script.
+.TP
diff --git a/app-admin/gentoolkit/gentoolkit-0.1.13.ebuild b/app-admin/gentoolkit/gentoolkit-0.1.14.ebuild
index 5ddd538f830c..d6c1f05178bf 100644
--- a/app-admin/gentoolkit/gentoolkit-0.1.13.ebuild
+++ b/app-admin/gentoolkit/gentoolkit-0.1.14.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2002 Gentoo Technologies, Inc.
# Distributed under the terms of the GNU General Public License, v2 or later
-# $Header: /var/cvsroot/gentoo-x86/app-admin/gentoolkit/gentoolkit-0.1.13.ebuild,v 1.1 2002/06/26 04:20:21 lostlogic Exp $
+# $Header: /var/cvsroot/gentoo-x86/app-admin/gentoolkit/gentoolkit-0.1.14.ebuild,v 1.1 2002/07/14 22:39:40 lostlogic Exp $
S=${WORKDIR}/${P}
DESCRIPTION="Collection of unofficial administration scripts for Gentoo"