make README symlinks; modify build-related files

A cluster of changes related to creating symlinks in the
  /etc/{renames,repos}.d directories that point to the corresponding
  README in sbopkg's docdir and then generally updating most
  build-related files and getting it all documented.

  * 50-default: renamed to 50-default.renames

  * NEWS: note symlink docs and rename issues

  * README-renames: update to reflect new default filename and the fact
    that the files must end in '.renames'.

  * sbopkg.conf.5, sbopkg.8: update to reflect the new renames stuff
    (and the earlier repo file/dir-related changes I forgot to document
    there).

  * sbopkg: get_new_name(), get_old_name(): have grep only look through
    *.renames files and not, say, symlinks to READMEs.

  * doinst.sh: bring into alignment with the current SBo template.

  * tools/sbopkg.SlackBuild: make links from README-repos and
    README-renames to READMEs in the corresponding /etc/sbopkg/*.d
    directories.

  * tools/slack-desc: bring into alignment with the current SBo
    template.

  * tools/sspm: update address, add printe() and use it.
This commit is contained in:
slakmagik 2011-03-10 04:17:52 +00:00
parent 68c8b94414
commit 76e6c5ddb1
10 changed files with 61 additions and 60 deletions

View File

@ -34,6 +34,12 @@ sbopkg xxxVERSIONxxx (xxxDATExxx)
block in README describing all the plain text documents, added
a note about making corrections to THANKS, etc.
* Note also that symlinks are now made from README-repos and
README-renames to READMEs in the corresponding /etc/sbopkg/*.d
directories. NOTE that renames files must now end in .rename
so, if you have custom files in renames.d, you'll need to
rename them.
* The 'Choose a repository' dialog widget is now titled
'Repository Selection' and the widget text was revised. Also,
the menu itself used to say 'BRANCH (REPO) DESCRIPTION' and

View File

@ -1,28 +1,28 @@
README-renames
Packages which are renamed in a repository are handled by adding them to
a rename file and placing that file in the /etc/sbopkg/renames.d
directory.
a file whose name ends in '.renames' which is stored in the
/etc/sbopkg/renames.d directory.
Renames are written, one per line, in the following format:
oldname=newname
The default file that is installed with sbopkg is '50-default'. This
file is kept in sync with the SBo repository and will be overwritten
each time sbopkg is upgraded, so do not make local edits to it. Instead,
create other files with a higher or lower number than 50-default and
list your renamed files in those local files.
The default file that is installed with sbopkg is '50-default.renames'.
This file is kept in sync with the SBo repository and will be
overwritten each time sbopkg is upgraded, so do not make local edits to
it. Instead, create other files with a higher or lower number than 50
and list your renamed files in those local files.
The files are loaded in alphanumeric order (like the files in, e.g.,
/etc/fonts/conf.d) so 'priority' is determined from low number to high
and the first match wins, so:
$ cat /etc/sbopkg/renames.d/10-local
$ cat /etc/sbopkg/renames.d/10-local.renames
foo=bar
will override anything in a higher-numbered file, including anything in
50-default, such as:
50-default.renames, such as:
$ cat /etc/sbopkg/renames.d/50-default
foo=baz

View File

@ -281,7 +281,7 @@ Note: all of the
variables are affected by the repository files maintained in
.I /etc/sbopkg/repos.d.
Please see the
.I README-repos.d
.I README-repos
document in the
.B sbopkg
documentation directory.
@ -550,21 +550,20 @@ File to specify configuration options.
.I ~/.sbopkg.conf
File to override system configuration options.
.TP
.I /etc/sbopkg/renames.d/50-default
Default file that lists software in the SBo repository that has been
renamed.
.I /etc/sbopkg/renames.d/*.renames
Files that list software in the SBo repository that has been renamed.
See the
.I README-renames.d
.I README-renames
document in the
.B sbopkg
documentation directory for more information.
.TP
.I /etc/sbopkg/repos.d/{40-sbo.repo,50-sb64.repo,60-local.repo}
Three default files for various types of
.I /etc/sbopkg/repos.d/*.repo
Files for various types of
.B sbopkg
repositories.
See the
.I README-repos.d
.I README-repos
document in the
.B sbopkg
documentation directory for more information.

View File

@ -473,21 +473,20 @@ Default system-wide file to specify configuration options.
.I ~/.sbopkg.conf
File to override system configuration options.
.TP
.I /etc/sbopkg/renames.d/50-default
Default file that lists software in the SBo repositories that has been
renamed.
.I /etc/sbopkg/renames.d/*.renames
Files that list software in the SBo repositories that has been renamed.
See the
.I README-renames.d
.I README-renames
document in the
.B sbopkg
documentation directory for more information.
.TP
.I /etc/sbopkg/repos.d/{40-sbo.repo,50-sb64.repo,60-local.repo}
Three default files for various types of
.I /etc/sbopkg/repos.d/*.repo
Files for various types of
.B sbopkg
repositories.
See the
.I README-repos.d
.I README-repos
document in the
.B sbopkg
documentation directory for more information.

View File

@ -644,7 +644,9 @@ get_new_name() {
local NEW_NAME_VAR="$1"
local OLD_NAME="$2"
local CANDIDATE=$(grep -hr "^$OLD_NAME=" $SBOPKG_RENAMES_D | head -n1)
local CANDIDATE=$(
grep -h "^$OLD_NAME=" $SBOPKG_RENAMES_D/*.renames | head -n1
)
if [[ -z "$CANDIDATE" ]]; then
# No rename occurred
@ -666,7 +668,7 @@ get_old_name() {
local NEW_NAME="$2"
local CANDIDATE INSTALLED
local SUBSTITUTIONS=$(
grep -hr "=$NEW_NAME\$" $SBOPKG_RENAMES_D | cut -d= -f1
grep -h "=$NEW_NAME\$" $SBOPKG_RENAMES_D/*.renames | cut -d= -f1
)
# By default, the old name is the new name

View File

@ -1,16 +1,11 @@
#!/bin/sh
#
# $Id$
#
# Sbopkg doinst.sh
config() {
NEW="$1"
OLD="`dirname $NEW`/`basename $NEW .new`"
OLD="$(dirname $NEW)/$(basename $NEW .new)"
# If there's no config file by that name, mv it over:
if [ ! -r $OLD ]; then
mv $NEW $OLD
elif [ "`cat $OLD | md5sum`" = "`cat $NEW | md5sum`" ]; then # toss the redundant copy
elif [ "$(cat $OLD | md5sum)" = "$(cat $NEW | md5sum)" ]; then
# toss the redundant copy
rm $NEW
fi
# Otherwise, we leave the .new copy for the admin to consider...

View File

@ -47,6 +47,9 @@ find $PKG/usr/man -type f -exec gzip -9 {} \;
mkdir -p $PKG/usr/doc/$PRGNAM-$VERSION
cp -a usr/doc/* $PKG/usr/doc/$PRGNAM-$VERSION
ln -s /usr/doc/$PRGNAM-$VERSION/README-repos $PKG/etc/$PRGNAM/repos.d/README
ln -s /usr/doc/$PRGNAM-$VERSION/README-renames \
$PKG/etc/$PRGNAM/renames.d/README
cp -a $CWD/sbopkg.SlackBuild $PKG/usr/doc/$PRGNAM-$VERSION
chown root:root $PKG/usr/doc/$PRGNAM-$VERSION/sbopkg.SlackBuild

View File

@ -1,19 +1,19 @@
# $Id: slack-desc 110 2008-03-23 03:50:27Z chess $
#
## HOW TO EDIT THIS FILE:
# HOW TO EDIT THIS FILE:
# The "handy ruler" below makes it easier to edit a package description. Line
# up the first '|' above the ':' following the base package name, and the '|'
# on the right side marks the last column you can put a character in. You must
# make exactly 11 lines for the formatting to be correct. It's also
# customary to leave one space after the ':'.
# customary to leave one space after the ':' except on otherwise blank lines.
|-----handy-ruler------------------------------------------------------|
sbopkg: sbopkg (SlackBuilds.org Package Browser)
sbopkg:
sbopkg: Sbopkg is a command-line and dialog-based tool to
sbopkg: interact with the SlackBuilds.org repository, a
sbopkg: collection of third-party SlackBuild scripts to
sbopkg: build Slackware packages.
sbopkg: Sbopkg is a command-line and dialog-based tool to interact with the
sbopkg: SlackBuilds.org repository, a collection of third-party SlackBuild
sbopkg: scripts to build Slackware packages.
sbopkg:
sbopkg: Homepage: http://www.sbopkg.org
sbopkg:
sbopkg:
sbopkg:
sbopkg:

View File

@ -1,6 +1,6 @@
#!/bin/bash
# $Id$
# Written by slakmagik <jsun freeshell org> (usual symbols in spaces)
# Written by slakmagik <slakmagik@gmail.com>
# Released under the WTFPL
script=${0##*/}
@ -25,6 +25,11 @@ EOF
exit
}
printe() {
printf "$script: $@" | tr -s ' ' | fmt -sw78 >&2
exit 1
}
if (( $# == 0 )); then
build="yes"
inst="yes"
@ -46,19 +51,15 @@ done
# Make sure we are root.
if (( $(id -u) != 0 )); then
echo "$script: $script must be run by the root user." 1>&2
exit 1
printe "$script must be run by the root user."
fi
if [[ $sync == yes ]]; then
if [[ -w $repo ]] || [[ ! -e $repo && -w ${repo%/*} ]]; then
svn checkout $remote_repo $repo ||
{ echo "$script: checkout failed" 1>&2; exit 1; }
svn checkout $remote_repo $repo || printe "checkout failed"
else
printf "$script: $repo is not writable.\n" 1>&2
printf "Change your privileges or the value of the \"repo\" " 1>&2
printf "variable.\n" 1>&2
exit 1
printe "$repo is not writable.\nChange your privileges or the \
value of the \"repo\" variable.\n"
fi
fi
@ -71,23 +72,19 @@ if [[ $build == yes || $inst == yes ]]; then
if [ -r $svn_script ]; then
export VERSION=svn$(svnversion $repo)
else
echo "$script: unable to find $svn_script." 1>&2
echo "Please check your repository." 1>&2
exit 1
printe "unable to find $svn_script.\nPlease check your repository."
fi
if [[ $OUTPUT =~ "$repo/(sbopkg-$VERSION|root-tools)" ]]; then
printf "$script: the OUTPUT variable is set to a path that will " 1>&2
printf "be removed.\n" 1>&2
printf "Please alter the value of the variable.\n" 1>&2
exit 1
printe "the OUTPUT variable is set to a path that will be \
removed.\nPlease alter the value of the variable.\n"
fi
output_pkg=$OUTPUT/sbopkg-$VERSION-noarch-1_cng.tgz
if [[ $build == yes ]]; then
cd $repo
if [ -d sbopkg-$VERSION ] || [ -d root-tools ]; then
echo "$script: director(y|ies) exist" 1>&2; exit 1
printe "director(y|ies) exist(s)"
fi
cp -r src sbopkg-$VERSION
cp -r tools root-tools
@ -104,7 +101,7 @@ if [[ $build == yes || $inst == yes ]]; then
if [ -r $output_pkg ]; then
upgradepkg --install-new --reinstall $output_pkg
else
echo "$script: $output_pkg not found." 1>&2; exit 1
printe "$output_pkg not found."
fi
fi
fi