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:51 PM
Chantry Xavier
 
Default repo-remove: print an error in case of an empty db

When removing the last packages from a database, repo-remove silently
failed. Now an error is printed.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
---
scripts/repo-remove.sh.in | 3 ++-
1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/scripts/repo-remove.sh.in b/scripts/repo-remove.sh.in
index 05bec39..a2c4095 100644
--- a/scripts/repo-remove.sh.in
+++ b/scripts/repo-remove.sh.in
@@ -25,7 +25,6 @@ export TEXTDOMAINDIR='@localedir@'
myver='@PACKAGE_VERSION@'
confdir='@sysconfdir@'

-FORCE=0
REPO_DB_FILE=""

msg() {
@@ -169,6 +168,8 @@ if [ $success -eq 1 ]; then
esac

bsdtar -c${TAR_OPT}f "$REPO_DB_FILE" *
+ else
+ error "$(gettext "Cannot create an empty archive... Aborting")"
fi

popd 2>&1 >/dev/null
--
1.5.4.rc4


_______________________________________________
pacman-dev mailing list
pacman-dev@archlinux.org
http://archlinux.org/mailman/listinfo/pacman-dev
 
Old 02-02-2008, 10:04 PM
"Dan McGee"
 
Default repo-remove: print an error in case of an empty db

On Feb 2, 2008 4:51 PM, Chantry Xavier <shiningxc@gmail.com> wrote:
> When removing the last packages from a database, repo-remove silently
> failed. Now an error is printed.
>
> Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
> ---
> scripts/repo-remove.sh.in | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/scripts/repo-remove.sh.in b/scripts/repo-remove.sh.in
> index 05bec39..a2c4095 100644
> --- a/scripts/repo-remove.sh.in
> +++ b/scripts/repo-remove.sh.in
> @@ -25,7 +25,6 @@ export TEXTDOMAINDIR='@localedir@'
> myver='@PACKAGE_VERSION@'
> confdir='@sysconfdir@'
>
> -FORCE=0
> REPO_DB_FILE=""
>
> msg() {
> @@ -169,6 +168,8 @@ if [ $success -eq 1 ]; then
> esac
>
> bsdtar -c${TAR_OPT}f "$REPO_DB_FILE" *
> + else
> + error "$(gettext "Cannot create an empty archive... Aborting")"

This still doesn't quite explain why it is creating an empty archive
(and 'empty database' would probably be better as well). I guess I'd
still prefer we spit a warning *and* deleted the DB (or touched an
empty file in its place). Otherwise we are left with an unwanted DB
entry in our database, especially in the case of wrapper scripts that
aren't going to read error messages.

> fi
>
> popd 2>&1 >/dev/null
> --
> 1.5.4.rc4

_______________________________________________
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 repo-remove: print an error in case of an empty db

When removing the last packages from a database, repo-remove silently
failed. Now an error is printed.

Signed-off-by: Chantry Xavier <shiningxc@gmail.com>
---
scripts/repo-remove.sh.in | 4 +++-
1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/scripts/repo-remove.sh.in b/scripts/repo-remove.sh.in
index 05bec39..fe230b0 100644
--- a/scripts/repo-remove.sh.in
+++ b/scripts/repo-remove.sh.in
@@ -25,7 +25,6 @@ export TEXTDOMAINDIR='@localedir@'
myver='@PACKAGE_VERSION@'
confdir='@sysconfdir@'

-FORCE=0
REPO_DB_FILE=""

msg() {
@@ -169,6 +168,9 @@ if [ $success -eq 1 ]; then
esac

bsdtar -c${TAR_OPT}f "$REPO_DB_FILE" *
+ else
+ error "$(gettext "All packages have been removed from the database. Deleting '%s'.")" "$REPO_DB_FILE"
+ rm "$REPO_DB_FILE"
fi

popd 2>&1 >/dev/null
--
1.5.4


_______________________________________________
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 03:04 PM.

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