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 01-11-2011, 10:19 PM
Dan McGee
 
Default repo-add: Create/modify files databases

From: PyroPeter <abi1789@googlemail.com>

Implements FS#11302.

Dan: updated docs to not reference pkgfile.

Signed-off-by: PyroPeter <abi1789@googlemail.com>
Signed-off-by: Dan McGee <dan@archlinux.org>
---
doc/repo-add.8.txt | 8 ++++++--
scripts/repo-add.sh.in | 13 ++++++++++++-
2 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/doc/repo-add.8.txt b/doc/repo-add.8.txt
index 81bf837..2500ab8 100644
--- a/doc/repo-add.8.txt
+++ b/doc/repo-add.8.txt
@@ -10,7 +10,7 @@ repo-add - package database maintenance utility

Synopsis
--------
-repo-add [-q] <path-to-db> <package1> [<package2> ...]
+repo-add [-f] [-q] <path-to-db> <package1> [<package2> ...]

repo-remove [-q] <path-to-db> <packagename> [<packagename2> ...]

@@ -30,11 +30,15 @@ on the command line.

Options
-------
+*-f, --files*::
+ Tells repo-add also to create and include a list of the files in the
+ specified packages. This is useful for creating databases listing all files
+ in a given sync repository for tools that may use this information.
+
*-q, --quiet*::
Force this program to keep quiet and run silent except for warning and
error messages.

-
See Also
--------
linkman:makepkg[8], linkmanacman[8]
diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in
index 1933950..7aeb505 100644
--- a/scripts/repo-add.sh.in
+++ b/scripts/repo-add.sh.in
@@ -29,6 +29,7 @@ confdir='@sysconfdir@'

QUIET=0
DELTA=0
+WITHFILES=0
REPO_DB_FILE=
LOCKFILE=
CLEAN_LOCK=0
@@ -61,7 +62,7 @@ error() {
# print usage instructions
usage() {
printf "repo-add, repo-remove (pacman) %s

" "$myver"
- printf "$(gettext "Usage: repo-add [-d] [-q] <path-to-db> <package|delta> ...
")"
+ printf "$(gettext "Usage: repo-add [-d] [-f] [-q] <path-to-db> <package|delta> ...
")"
printf "$(gettext "Usage: repo-remove [-q] <path-to-db> <packagename|delta> ...

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

@@ -77,6 +78,8 @@ and errors.

")"
Use the -d/--delta flag to automatically generate and add a delta file

between the old entry and the new one, if the old package file is found

next to the new one.

")"
+ printf "$(gettext "
+Use the -f/--files flag to update a database including file entries.

")"
echo "$(gettext "Example: repo-add /path/to/repo.db.tar.gz pacman-3.0.0.pkg.tar.gz")"
echo "$(gettext "Example: repo-remove /path/to/repo.db.tar.gz kernel26")"
}
@@ -287,6 +290,13 @@ db_write_entry()
write_list_entry "PROVIDES" "$_provides" "depends"
write_list_entry "OPTDEPENDS" "$_optdepends" "depends"

+ # create files file if wanted
+ if (( WITHFILES )); then
+ msg2 "$(gettext "Creating 'files' db entry...")"
+ echo "%FILES%" > files
+ bsdtar --exclude='.*' -tf "$pkgfile" >> files
+ fi
+
popd >/dev/null
popd >/dev/null

@@ -472,6 +482,7 @@ for arg in "$@"; do
case "$arg" in
-q|--quiet) QUIET=1;;
-d|--delta) DELTA=1;;
+ -f|--files) WITHFILES=1;;
*)
if [[ -z $REPO_DB_FILE ]]; then
REPO_DB_FILE="$arg"
--
1.7.3.5
 

Thread Tools




All times are GMT. The time now is 02:48 PM.

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