FAQ Search Today's Posts Mark Forums Read
» Video Reviews

» Linux Archive

Linux-archive is a website aiming to archive linux email lists and to make them easily accessible for linux users/developers.


» Sponsor

» Partners

» Sponsor

Go Back   Linux Archive > ArchLinux > ArchLinux Pacman Development

 
 
LinkBack Thread Tools
 
Old 02-02-2008, 09:50 PM
Chantry Xavier
 
Default 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>
---
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

" "$myver"
- printf "$(gettext "Usage: %s <path-to-db> [--force] <package> ...

")" "$0"
+ printf "$(gettext "Usage: %s <path-to-db> <package> ...

")" "$0"
printf "$(gettext "
repo-add will update a package database by reading a package file.

Multiple packages to add can be specified on the command line.

")"
- printf "$(gettext "
-The --force flag will add a 'force' entry to the sync database, which

-tells pacman to skip its internal version number checking and update

-the package regardless.

")"
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%
$builddate
" >>desc
[ -n "$packager" ] && echo -e "%PACKAGER%
$packager
" >>desc
write_list_entry "REPLACES" "$_replaces" "desc"
- [ $FORCE -eq 1 -o -n "$force" ] && echo -e "%FORCE%
" >>desc
+ [ -n "$force" ] && echo -e "%FORCE%
" >>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"
--
1.5.4.rc4


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 02-02-2008, 10:11 PM
"Dan McGee"
 
Default remove --force option from repo-add.

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@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@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

" "$myver"
> - printf "$(gettext "Usage: %s <path-to-db> [--force] <package> ...

")" "$0"
> + printf "$(gettext "Usage: %s <path-to-db> <package> ...

")" "$0"
> printf "$(gettext "
> repo-add will update a package database by reading a package file.

> Multiple packages to add can be specified on the command line.

")"
> - printf "$(gettext "
> -The --force flag will add a 'force' entry to the sync database, which

> -tells pacman to skip its internal version number checking and update

> -the package regardless.

")"
> 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%
$builddate
" >>desc
> [ -n "$packager" ] && echo -e "%PACKAGER%
$packager
" >>desc
> write_list_entry "REPLACES" "$_replaces" "desc"
> - [ $FORCE -eq 1 -o -n "$force" ] && echo -e "%FORCE%
" >>desc
> + [ -n "$force" ] && echo -e "%FORCE%
" >>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

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 02-02-2008, 10:32 PM
Xavier
 
Default remove --force option from repo-add.

Dan McGee wrote:
> 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.
>

Just for clarifying my point of view, I didn't like this special
handling of the force flag. There are many other options you can get
wrong in the PKGBUILD, and these aren't fixed by using repo-add flags.
They are fixed in the PKGBUILD itself.
I just like the idea of having everything in a single place

Secondly, is there anyone who uses that option?
If I understood correctly, repo-add is only used by the community repo.
And they don't even seem to know about the force flag.
$ find /var/abs/community -name PKGBUILD | xargs grep "options.*force" |
wc -l
8
$ find /var/abs/community -name PKGBUILD | xargs grep "force=y" |wc -l
12
$ grep -r FORCE /var/lib/pacman/sync/community
<nothing>

However, with my repo-add change, only the first 8 PKGBUILD who uses the
options=(force) syntax would be supported. The force=y syntax used by
the 12 others wouldn't work.

> 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@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@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

" "$myver"
>> - printf "$(gettext "Usage: %s<path-to-db> [--force]<package> ...

")" "$0"
>> + printf "$(gettext "Usage: %s<path-to-db> <package> ...

")" "$0"
>> printf "$(gettext "
>> repo-add will update a package database by reading a package file.

>> Multiple packages to add can be specified on the command line.

")"
>> - printf "$(gettext "
>> -The --force flag will add a 'force' entry to the sync database, which

>> -tells pacman to skip its internal version number checking and update

>> -the package regardless.

")"
>> 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%
$builddate
">>desc
>> [ -n "$packager" ]&& echo -e "%PACKAGER%
$packager
">>desc
>> write_list_entry "REPLACES" "$_replaces" "desc"
>> - [ $FORCE -eq 1 -o -n "$force" ]&& echo -e "%FORCE%
">>desc
>> + [ -n "$force" ]&& echo -e "%FORCE%
">>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.
>

As I said earlier, I thought no one used that option, so that it would
be alright to simply remove it.
But having a warning temporarily seems acceptable.

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 02-02-2008, 11:20 PM
Chantry Xavier
 
Default 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>
---
scripts/repo-add.sh.in | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)

diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index efd3bc0..00eec7e 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

" "$myver"
- printf "$(gettext "Usage: %s <path-to-db> [--force] <package> ...

")" "$0"
+ printf "$(gettext "Usage: %s <path-to-db> <package> ...

")" "$0"
printf "$(gettext "
repo-add will update a package database by reading a package file.

Multiple packages to add can be specified on the command line.

")"
- printf "$(gettext "
-The --force flag will add a 'force' entry to the sync database, which

-tells pacman to skip its internal version number checking and update

-the package regardless.

")"
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%
$builddate
" >>desc
[ -n "$packager" ] && echo -e "%PACKAGER%
$packager
" >>desc
write_list_entry "REPLACES" "$_replaces" "desc"
- [ $FORCE -eq 1 -o -n "$force" ] && echo -e "%FORCE%
" >>desc
+ [ -n "$force" ] && echo -e "%FORCE%
" >>desc

# create depends entry
msg2 "$(gettext "Creating 'depends' db entry...")"
@@ -291,7 +286,8 @@ success=0
# parse arguments
for arg in "$@"; do
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
REPO_DB_FILE=$(readlink -f "$arg")
if ! test_repo_db_file; then
--
1.5.4


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 02-02-2008, 11:58 PM
"Dan McGee"
 
Default remove --force option from repo-add.

On Feb 2, 2008 6:20 PM, Chantry Xavier <shiningxc@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@gmail.com>

Forgot to add one more thing when I reviewed this patch too- the
manpage will need updating.

-Dan

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 02-03-2008, 07:33 AM
Chantry Xavier
 
Default 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>
---
doc/repo-add.8.txt | 10 ----------
scripts/repo-add.sh.in | 12 ++++--------
2 files changed, 4 insertions(+), 18 deletions(-)

diff --git a/doc/repo-add.8.txt b/doc/repo-add.8.txt
index 5664949..495e553 100644
--- a/doc/repo-add.8.txt
+++ b/doc/repo-add.8.txt
@@ -34,16 +34,6 @@ specified on the command line. Multiple packages to remove can be specified
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
--------
linkman:makepkg[8], linkmanacman[8]
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index efd3bc0..00eec7e 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

" "$myver"
- printf "$(gettext "Usage: %s <path-to-db> [--force] <package> ...

")" "$0"
+ printf "$(gettext "Usage: %s <path-to-db> <package> ...

")" "$0"
printf "$(gettext "
repo-add will update a package database by reading a package file.

Multiple packages to add can be specified on the command line.

")"
- printf "$(gettext "
-The --force flag will add a 'force' entry to the sync database, which

-tells pacman to skip its internal version number checking and update

-the package regardless.

")"
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%
$builddate
" >>desc
[ -n "$packager" ] && echo -e "%PACKAGER%
$packager
" >>desc
write_list_entry "REPLACES" "$_replaces" "desc"
- [ $FORCE -eq 1 -o -n "$force" ] && echo -e "%FORCE%
" >>desc
+ [ -n "$force" ] && echo -e "%FORCE%
" >>desc

# create depends entry
msg2 "$(gettext "Creating 'depends' db entry...")"
@@ -291,7 +286,8 @@ success=0
# parse arguments
for arg in "$@"; do
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
REPO_DB_FILE=$(readlink -f "$arg")
if ! test_repo_db_file; then
--
1.5.4


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 02-03-2008, 10:30 PM
"Aaron Griffin"
 
Default remove --force option from repo-add.

On Feb 2, 2008 5:32 PM, Xavier <shiningxc@gmail.com> wrote:
> Dan McGee wrote:
> > 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.
> >
>
> Just for clarifying my point of view, I didn't like this special
> handling of the force flag. There are many other options you can get
> wrong in the PKGBUILD, and these aren't fixed by using repo-add flags.
> They are fixed in the PKGBUILD itself.
> I just like the idea of having everything in a single place

I agree with Xavier here. The special force handling was annoying, and
should be deleted no that the force metadata is in the package

_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 

Thread Tools




All times are GMT. The time now is 02:59 AM.

VBulletin, Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO ©2007, Crawlability, Inc.
Copyright 2007 - 2008, www.linux-archive.org