[pacman-dev] [PATCH] remove --force option from repo-add.

Dan McGee dpmcgee at gmail.com
Sat Feb 2 18:11:53 EST 2008


Before I even dive into the patch, I asked Xavier to send this one
here for opinions from others. I am currently in favor of not removing
the --force option from repo-add, so that one would not have to
rebuild a package in order to mark it as force in a database that
might be on a different computer from where you built the package, so
makepkg -R is unavailable. But I would love to hear your thoughts.

With that said, I'll go ahead and review the patch as if it was going
to be included.

On Feb 2, 2008 4:50 PM, Chantry Xavier <shiningxc at gmail.com> wrote:
> 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 at gmail.com>
> ---
>  scripts/repo-add.sh.in |   13 +++----------
>  1 files changed, 3 insertions(+), 10 deletions(-)
>
> diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
> index efd3bc0..297eb15 100644
> --- a/scripts/repo-add.sh.in
> +++ b/scripts/repo-add.sh.in
> @@ -25,7 +25,6 @@ export TEXTDOMAINDIR='@localedir@'
>  myver='@PACKAGE_VERSION@'
>  confdir='@sysconfdir@'
>
> -FORCE=0
>  REPO_DB_FILE=""
>
>  # ensure we have a sane umask set
> @@ -54,14 +53,10 @@ error() {
>  # print usage instructions
>  usage() {
>         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 "\
>  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")"
> -       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")"
>  }
>
> @@ -209,7 +204,7 @@ db_write_entry()
>         [ -n "$builddate" ] && echo -e "%BUILDDATE%\n$builddate\n" >>desc
>         [ -n "$packager" ] && echo -e "%PACKAGER%\n$packager\n" >>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
>         msg2 "$(gettext "Creating 'depends' db entry...")"
> @@ -290,9 +285,7 @@ gstmpdir=$(mktemp -d /tmp/repo-add.XXXXXXXXXX) || (\
>  success=0
>  # parse arguments
>  for arg in "$@"; do
> -       if [ "$arg" == "--force" -o "$arg" == "-f" ]; then
> -               FORCE=1
> -       elif [ -z "$REPO_DB_FILE" ]; then
> +       if [ -z "$REPO_DB_FILE" ]; then
>                 REPO_DB_FILE=$(readlink -f "$arg")
>                 if ! test_repo_db_file; then
>                         error "$(gettext "Repository file '%s' is not a proper pacman database.")" "$REPO_DB_FILE"

My only thought would be to put in (temporarily) something that looks
for -f/--force and prints a big fat warning saying it won't be
recognized- not sure what repo-add after this patch if that flag was
passed.

-Dan




More information about the pacman-dev mailing list