remove --force option from repo-add.

The force option should only be specified in the PKGBUILD with
options=(force).  This information should be handled like any other meta
info, and there is no need to have a special repo-add option for it.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
[Dan: fix up a few more references in contrib/ scripts, etc]
Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
Chantry Xavier 2008-02-02 23:24:49 +01:00 committed by Dan McGee
parent eca30ed66a
commit e81dec9b8c
4 changed files with 8 additions and 54 deletions

View file

@ -59,17 +59,6 @@ die () {
exit 1 exit 1
} }
check_force () {
local i
for i in ${options[@]}; do
local lc=$(echo $i | tr [:upper:] [:lower:])
if [ "$lc" = "force" ]; then
true
fi
done
false
}
# PROGRAM START # PROGRAM START
if [ "$1" = "-h" -o "$1" = "--help" ]; then if [ "$1" = "-h" -o "$1" = "--help" ]; then
@ -115,7 +104,6 @@ echo "gensync: building database entries, generating md5sums..." >&2
cd "$destdir" cd "$destdir"
pkgs="" pkgs=""
forcepkgs=""
for file in $(find "$rootdir"/* -name "$BUILDSCRIPT"); do for file in $(find "$rootdir"/* -name "$BUILDSCRIPT"); do
unset pkgname pkgver pkgrel options unset pkgname pkgver pkgrel options
@ -132,19 +120,15 @@ for file in $(find "$rootdir"/* -name "$BUILDSCRIPT"); do
if [ ! -f "$pkgfile" ]; then if [ ! -f "$pkgfile" ]; then
error "could not find %s-%s-%s-%s%s - skipping" $pkgname $pkgver $pkgrel $CARCH $PKGEXT error "could not find %s-%s-%s-%s%s - skipping" $pkgname $pkgver $pkgrel $CARCH $PKGEXT
else
if check_force; then
forcepkgs="$forcepkgs $pkgfile"
else else
pkgs="$pkgs $pkgfile" pkgs="$pkgs $pkgfile"
fi fi
fi
done done
echo "creating repo DB..." echo "creating repo DB..."
# we'll trim the output just a tad, as gensync may be used on large repos # we'll trim the output just a tad, as gensync may be used on large repos
repo-add $destfile $pkgs --force $force_pkgs \ repo-add $destfile $pkgs \
| grep -e "package" -e "database" | grep -e "package" -e "database"
# vim: set ts=2 sw=2 noet: # vim: set ts=2 sw=2 noet:

View file

@ -58,17 +58,6 @@ die () {
exit 1 exit 1
} }
check_force () {
local i
for i in ${options[@]}; do
local lc=$(echo $i | tr [:upper:] [:lower:])
if [ "$lc" = "force" ]; then
true
fi
done
false
}
# PROGRAM START # PROGRAM START
if [ "$1" = "-h" -o "$1" = "--help" ]; then if [ "$1" = "-h" -o "$1" = "--help" ]; then
@ -109,7 +98,6 @@ pkgdir="$(pwd)"
if [ "$4" != "" ]; then if [ "$4" != "" ]; then
pkgdir="$4" pkgdir="$4"
fi fi
opt_force=""
if [ "$action" = "upd" ]; then # INSERT / UPDATE if [ "$action" = "upd" ]; then # INSERT / UPDATE
if [ ! -f "$option" ]; then if [ ! -f "$option" ]; then
@ -128,11 +116,7 @@ if [ "$action" = "upd" ]; then # INSERT / UPDATE
die "could not find %s-%s-%s-%s%s - aborting" $pkgname $pkgver $pkgrel $CARCH $PKGEXT die "could not find %s-%s-%s-%s%s - aborting" $pkgname $pkgver $pkgrel $CARCH $PKGEXT
fi fi
if check_force; then repo-add "$pkgdb" "$pkgfile"
opt_force="--force"
fi
repo-add "$pkgdb" $opt_force "$pkgfile"
else # DELETE else # DELETE
fname="$(basename $option)" fname="$(basename $option)"
if [ "$fname" = "PKGBUILD" ]; then if [ "$fname" = "PKGBUILD" ]; then

View file

@ -16,7 +16,7 @@ repo-add - package database maintenance utility
Synopsis Synopsis
-------- --------
repo-add <path-to-db> [--force] <package> ... repo-add <path-to-db> <package> ...
repo-remove <path-to-db> <packagename> ... repo-remove <path-to-db> <packagename> ...
@ -34,16 +34,6 @@ specified on the command line. Multiple packages to remove can be specified
on the command line. on the command line.
Options
-------
*--force* (repo-add only)::
Add a force entry to the sync database, which tells pacman to skip version
number comparison and update the package regardless. This flag can be
specified in the middle of the command line, with any packages listed
before the flag being added as normal entries, and any specified after
being marked as force upgrades.
See Also See Also
-------- --------
linkman:makepkg[8], linkman:pacman[8] linkman:makepkg[8], linkman:pacman[8]

View file

@ -25,7 +25,6 @@ export TEXTDOMAINDIR='@localedir@'
myver='@PACKAGE_VERSION@' myver='@PACKAGE_VERSION@'
confdir='@sysconfdir@' confdir='@sysconfdir@'
FORCE=0
REPO_DB_FILE="" REPO_DB_FILE=""
# ensure we have a sane umask set # ensure we have a sane umask set
@ -54,14 +53,10 @@ error() {
# print usage instructions # print usage instructions
usage() { usage() {
printf "repo-add (pacman) %s\n\n" "$myver" printf "repo-add (pacman) %s\n\n" "$myver"
printf "$(gettext "Usage: %s <path-to-db> [--force] <package> ...\n\n")" "$0" printf "$(gettext "Usage: %s <path-to-db> <package> ...\n\n")" "$0"
printf "$(gettext "\ printf "$(gettext "\
repo-add will update a package database by reading a package file.\n\ repo-add will update a package database by reading a package file.\n\
Multiple packages to add can be specified on the command line.\n\n")" Multiple packages to add can be specified on the command line.\n\n")"
printf "$(gettext "\
The --force flag will add a 'force' entry to the sync database, which\n\
tells pacman to skip its internal version number checking and update\n\
the package regardless.\n\n")"
echo "$(gettext "Example: repo-add /path/to/repo.db.tar.gz pacman-3.0.0.pkg.tar.gz")" echo "$(gettext "Example: repo-add /path/to/repo.db.tar.gz pacman-3.0.0.pkg.tar.gz")"
} }
@ -209,7 +204,7 @@ db_write_entry()
[ -n "$builddate" ] && echo -e "%BUILDDATE%\n$builddate\n" >>desc [ -n "$builddate" ] && echo -e "%BUILDDATE%\n$builddate\n" >>desc
[ -n "$packager" ] && echo -e "%PACKAGER%\n$packager\n" >>desc [ -n "$packager" ] && echo -e "%PACKAGER%\n$packager\n" >>desc
write_list_entry "REPLACES" "$_replaces" "desc" write_list_entry "REPLACES" "$_replaces" "desc"
[ $FORCE -eq 1 -o -n "$force" ] && echo -e "%FORCE%\n" >>desc [ -n "$force" ] && echo -e "%FORCE%\n" >>desc
# create depends entry # create depends entry
msg2 "$(gettext "Creating 'depends' db entry...")" msg2 "$(gettext "Creating 'depends' db entry...")"
@ -291,7 +286,8 @@ success=0
# parse arguments # parse arguments
for arg in "$@"; do for arg in "$@"; do
if [ "$arg" == "--force" -o "$arg" == "-f" ]; then if [ "$arg" == "--force" -o "$arg" == "-f" ]; then
FORCE=1 warning "$(gettext "the -f and --force options are no longer recognized")"
msg2 "$(gettext "use options=(force) in the PKGBUILD instead")"
elif [ -z "$REPO_DB_FILE" ]; then elif [ -z "$REPO_DB_FILE" ]; then
REPO_DB_FILE=$(readlink -f "$arg") REPO_DB_FILE=$(readlink -f "$arg")
if ! test_repo_db_file; then if ! test_repo_db_file; then