summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2003-02-14 21:55:18 +0000
committerMike Frysinger <vapier@gentoo.org>2003-02-14 21:55:18 +0000
commit5cb060dca992089625aa7427f36b5667afe84f65 (patch)
treeef61a3e26050fbf8f247af7c172832f83e2465d2 /app-admin
parentAdded install-programs to the ebuild (diff)
downloadhistorical-5cb060dca992089625aa7427f36b5667afe84f65.tar.gz
historical-5cb060dca992089625aa7427f36b5667afe84f65.tar.bz2
historical-5cb060dca992089625aa7427f36b5667afe84f65.zip
etc-update moved to portage
Diffstat (limited to 'app-admin')
-rw-r--r--app-admin/gentoolkit/files/etc-update/ChangeLog32
-rw-r--r--app-admin/gentoolkit/files/etc-update/etc-update328
-rw-r--r--app-admin/gentoolkit/files/etc-update/etc-update.127
-rw-r--r--app-admin/gentoolkit/files/etc-update/etc-update.conf63
4 files changed, 0 insertions, 450 deletions
diff --git a/app-admin/gentoolkit/files/etc-update/ChangeLog b/app-admin/gentoolkit/files/etc-update/ChangeLog
deleted file mode 100644
index f78b939bbd7e..000000000000
--- a/app-admin/gentoolkit/files/etc-update/ChangeLog
+++ /dev/null
@@ -1,32 +0,0 @@
-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
- * Automatically merges trivial CVS header changes
- * Handles multiple config file replacements for the same file gracefully
- * Code is prettier (IMVHO)
-
-2002-06-03 Karl Trygve Kalleberg <karltk@gentoo.org>
- * Added CONFIG_PROTECT patches from Avi Schwartz <avi@CFFtechnologies.com>
- * Changed man page to reflect changes.
-
-2002-03-22 Karl Trygve Kalleberg <karltk@gentoo.org>
- * Added /etc/etc-update.conf patches from Matthew Kennedy
- <mbkennedy@ieee.org>
- * Renamed CHANGES to ChangeLog to keep with Gentoo standards
- * Moved into separate dir (etc-update instead of scripts)
- * Added man page (from earlier)
-
-2002-02-05 Jochem Kossen <j.kossem@home.nl>
- * etc-update is now configured through a configuration file (default
- /etc/etc-updaterc)
- * added a default helpmessage for sdiff so users might understand how to
- use it
- * changed one menu option from the merge menu (menu2) from "Restart
- etc-update" to "Back to previous menu" since that's more correct
- * added this CHANGES file
diff --git a/app-admin/gentoolkit/files/etc-update/etc-update b/app-admin/gentoolkit/files/etc-update/etc-update
deleted file mode 100644
index e1d2f54a4c3f..000000000000
--- a/app-admin/gentoolkit/files/etc-update/etc-update
+++ /dev/null
@@ -1,328 +0,0 @@
-#!/bin/bash
-# Copyright 2002 Gentoo Technologies, Inc.
-# Distributed under the terms of the GNU Public License, v2 or later
-# Author Brandon Low <lostlogic@gentoo.org>
-#
-# Previous version (from which I've borrowed a few bits) by:
-# Jochem Kossen <j.kossen@home.nl>
-# 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.12 2002/07/15 14:37:32 lostlogic Exp $
-
-function get_config() {
- item=$1
-
- # First strip off comment lines, then grab the configuration
- # item. If there's more than one of the same configuration item,
- # then allow the last setting to take precedence.
- cut -d'#' -f1-1 /etc/etc-update.conf | \
- sed -ne "s/^\ *$item\ *=\ *\"\(.*\)\"/\1/p" |sed -e '$p;d'
-}
-
-function scan() {
-
- echo "Scanning Configuration files..."
- rm -rf ${TMP}/files > /dev/null 2>&1
- mkdir ${TMP}/files || die "Failed mkdir command!" 1
- count=0
- input=0
-
- for path in ${CONFIG_PROTECT}; do if [ -d ${path} ]; then
- ofile=""
- for file in `find ${path} -iname "._cfg????_*" |
- sed -e "s:\(^.*/\)\(._cfg*_\)\(/.*$\):\1\2\3\%\2\%\3:" |
- sort -t'%' -k3 -k2 | cut -f1 -d'%'`; do
- rpath=`echo "${file}" | sed -e "s:/[^/]*$::"`
- rfile=`echo "${file}" | sed -e "s:^.*/::"`
- for mpath in ${CONFIG_PROTECT_MASK}; do
- if [[ "${rpath}" == "${mpath}"* ]]; then
- mv ${rpath}/${rfile} ${rpath}/${rfile:10}
- break
- fi
- done
- [ ! -f ${file} ] && continue
- if [[ "${ofile:10}" != "${rfile:10}" ]] ||
- [[ ${opath} != ${rpath} ]]; then
- if [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${rfile:10}|
- 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}"
- opath="${rpath}"
- continue
- fi
- fi
- if [[ -z `diff -Nua ${rpath}/${rfile} ${rpath}/${ofile}|
- grep "^[+-][^+-]"|grep -v '# .Header:.*'` ]]; then
- mv ${rpath}/${rfile} ${rpath}/${ofile}
- continue
- else
- echo "${rpath}/${rfile}" >> ${TMP}/files/${count}
- ofile="${rfile}"
- opath="${rpath}"
- fi
- done
- fi; done
-
-}
-
-function sel_file() {
- local -i isfirst=0
- until [ -f ${TMP}/files/${input} ] || [ ${input} == -1 ]; do
- 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
- 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
-}
-
-function do_file() {
- echo
- local -i my_input
- local -i fcount=0
- until (( `cat ${TMP}/files/${input}|wc -l` < 2 )); do
- my_input=0
- if (( `cat ${TMP}/files/${input}|wc -l` == 2 )); then
- my_input=1
- fi
- until (( ${my_input} > 0 )) && (( ${my_input} < `cat ${TMP}/files/${input}|wc -l` )); do
- fcount=0
- for line in `cat ${TMP}/files/${input}`; do
- if (( ${fcount} > 0 )); then
- echo -n "${fcount}${PAR} "
- echo "${line}"
- else
- 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 > ${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
- if (( ${my_input} == ${fcount} )); then
- break
- fi
-
- fcount=${my_input}+1
-
- file=`cat ${TMP}/files/${input} | sed -e "${fcount}p;d"`
- ofile=`head -n1 ${TMP}/files/${input}`
-
- do_cfg "${file}" "${ofile}"
-
- cat ${TMP}/files/${input}|sed -e "${fcount}!p;d" > ${TMP}/files/sed
- mv ${TMP}/files/sed ${TMP}/files/${input}
-
- if (( ${my_input} == -1 )); then
- break
- fi
- done
- echo
- rm ${TMP}/files/${input}
- count=${count}-1
-}
-
-function do_cfg() {
-
- local file="${1}"
- local ofile="${2}"
- local -i my_input=0
-
- until (( ${my_input} == -1 )); do
- ( echo "Showing differences between ${ofile} and ${file}"
- `echo "${diff_command}" |
- sed -e "s:%file1:${ofile}:" \
- -e "s:%file2:${file}:"` )
- # | ${pager}
- 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 ignore this update): "
- read my_input
- case ${my_input} in
- 1) echo "Replacing ${ofile} with ${file}"
- mv ${mv_opts} ${file} ${ofile}
- break
- ;;
- 2) echo "Deleting ${file}"
- rm ${rm_opts} ${file}
- break
- ;;
- 3) do_merge "${file}" "${ofile}"
- my_input=${?}
- [ ${my_input} == 255 ] && my_input=-1
- ;;
- 4) continue
- ;;
- *) continue
- ;;
- esac
- done
-}
-
-function do_merge() {
-
- local file="${1}"
- local ofile="${2}"
- local mfile="${2}.merged"
- local -i my_input=0
- echo "${file} ${ofile} ${mfile}"
-
- if [ -e ${mfile} ] ; then
- echo "A previous version of the merged file exists, cleaning..."
- rm ${rm_opts} ${mfile}
- fi
-
- until (( ${my_input} == -1 )); do
- echo "Merging ${file} and ${ofile}"
- `echo "${merge_command}" |
- sed -e "s:%merged:${mfile}:g" \
- -e "s:%orig:${ofile}:g" \
- -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 original
-3) Remerge original with update
-4) Return to the previous menu
-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
- ;;
- 2) ( echo "Showing differences between ${ofile} and ${mfile}"
- `echo "${diff_command}" | \
- sed -e "s:%file1:${ofile}:" \
- -e "s:%file2:${mfile}:"` ) | ${pager}
- continue
- ;;
- 3) break
- ;;
- 4) rm ${rm_opts} ${mfile}
- return 0
- ;;
- *) continue
- ;;
- esac
- done
- done
- return 255
-}
-
-function die() {
- trap "" term
- trap "" kill
- echo "Exiting: ${1}"
- rm -rf ${TMP}
- exit ${2}
-}
-
-#
-# Run the script
-#
-scriptname=`basename $0`
-
-trap die term
-
-TMP=/tmp/$$
-rm -rf ${TMP} 2> /dev/null
-mkdir ${TMP} || die "failed mkdir command!" 1
-
-# I need the CONFIG_PROTECT value
-source /etc/make.globals
-
-# load etc-config's configuration
-rm_opts=`get_config rm_opts`
-mv_opts=`get_config mv_opts`
-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=""P
-fi
-
-declare -i count=0
-declare -i input=0
-declare title="Gentoolkit's etc-update tool!"
-
-scan
-
-until (( ${input} == -1 )); do
- if (( ${count} == 0 )); then
- die "No files to work on!" 0
- fi
- sel_file
- if (( ${input} != -1 )); then
- do_file
- fi
-done
-
-die "User termination!" 0
diff --git a/app-admin/gentoolkit/files/etc-update/etc-update.1 b/app-admin/gentoolkit/files/etc-update/etc-update.1
deleted file mode 100644
index 4f3287737c07..000000000000
--- a/app-admin/gentoolkit/files/etc-update/etc-update.1
+++ /dev/null
@@ -1,27 +0,0 @@
-.TH etc-update "1" "March 2002" "gentoolkit 0.1.4"
-.SH NAME
-etc-update \- manual page for the etc-update program, a program that traverses
-your /etc directory, looking for suitable config file updates
-.SH SYNOPSIS
-.B etc-update
-.SH DESCRIPTION
-.I etc-update
-is supposed to be run after merging a new package, to see if
-there are updates to the configuration files in /etc.
-If a new configuration file will override an old one,
-.I etc-update
-will prompt the user for a decision.
-.PP
-.I etc-update
-will check all directories in \fI/etc/make.global\fR's \fICONFIG_PROTECT\fR variable.
-.SH OPTIONS
-.TP
-None.
-.SH AUTHORS
-Jochem Kossen and Leo Lipelis, 2002: etc-update
-.br
-Karl Trygve Kalleberg <karltk@gentoo.org>, 2002: man page, fixes
-.SH "SEE ALSO"
-ebuild(5)
-.TP
-The \fI/usr/sbin/lintool\fR script.
diff --git a/app-admin/gentoolkit/files/etc-update/etc-update.conf b/app-admin/gentoolkit/files/etc-update/etc-update.conf
deleted file mode 100644
index a623e0ce7bf9..000000000000
--- a/app-admin/gentoolkit/files/etc-update/etc-update.conf
+++ /dev/null
@@ -1,63 +0,0 @@
-# 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"
-
-# arguments used whenever mv is called
-mv_opts="-i"
-
-# arguments used whenever cp is called
-cp_opts="-i"
-
-# pager for use with diff commands (see NOTE_2)
-pager="less"
-#pager=""
-
-# vim-users: you CAN use vimdiff for diff_command. (see NOTE_1)
-diff_command="diff -uN %file1 %file2"
-#diff_command="vim -d %file1 %file2"
-
-# vim-users: don't use vimdiff for merging (see NOTE_1)
-merge_command="sdiff -s -o %merged %orig %new"
-
-# EXPLANATION
-#
-# pager:
-#
-# Examples of pager usage:
-# pager="" # don't use a pager
-# pager="less -E" # less
-# pager="more" # more
-#
-#
-# diff_command:
-#
-# Arguments:
-# %file1 [REQUIRED]
-# %file2 [REQUIRED]
-#
-# Examples of diff_command:
-# diff_command="diff -uN %file1 %file2" # diff
-# diff_command="vim -d %file1 %file2" # vimdiff
-#
-#
-# merge_command:
-#
-# Arguments:
-# %orig [REQUIRED]
-# %new [REQUIRED]
-# %merged [REQUIRED]
-#
-# Examples of merge_command:
-# merge_command="sdiff -s -o %merged %old %new" # sdiff
-#
-
-# NOTE_1: Editors such as vim/vimdiff are not usable for the merge_command
-# because it is not known what filenames the produced files have (the user can
-# choose while using those programs)
-
-# NOTE_2: Make sure pager is set to "" when using an editor as diff_command!
-