summaryrefslogtreecommitdiffstats
path: root/scripts/repo-add.sh.in
AgeCommit message (Collapse)AuthorFilesLines
2009-08-03repo-add: clarify one messageXavier Chantry1-1/+1
Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-07-22makepkg: add pkgbase to .PKGINFO and database for split packagesAllan McRae1-0/+1
With split packages, the pkgbase variable provides a useful way to find out which packages were build from the same PKGBUILD. Add it to the packages .PKGINFO file and the repo database only when package splitting is used. Original-patch-by: Pierre Schmitz <pierre@archlinux.de> [Allan: restrict to including only with spilt packages and include after pkgname] Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-06-24repo-add: use bsdtar optimization for better performanceDan McGee1-3/+3
When unzipping packages and the database archives, we don't need to look through the entire archive to do what we need to do. For packages, .PKGINFO should only be found once and should be the first file in the package. For the database check, we only really need to look for one desc file. The bsdtar -q option is very similar to the GNU tar --occurrence=1 option. Example of speedup: $ time repo-add junkdb.db.tar.gz *.pkg.tar.gz >/dev/null real 0m16.159s user 0m14.836s sys 0m2.277s $ time ./scripts/repo-add junkdb.db.tar.gz *.pkg.tar.gz >/dev/null real 0m4.949s user 0m3.730s sys 0m2.093s Signed-off-by: Dan McGee <dan@archlinux.org>
2009-05-23repo-add: fail early if repo can not be createdXavier Chantry1-2/+12
Before this commit, the repo creation could fail after all packages have been added to the database. Now this will be detected before adding anything. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-05-19Add support for the xz archive formatPierre Schmitz1-0/+1
This simple patch adds support for the xz archive format to makepkg and repo- add. Xz can be used as source, package and package db file type. Signed-off-by: Pierre Schmitz <pierre@archlinux.de> [Dan: fixed a few alignment issues] Signed-off-by: Dan McGee <dan@archlinux.org>
2009-05-19repo-add: fix -n tests which are applicable only to stringsCedric Staniewski1-2/+2
Signed-off-by: Cedric Staniewski <cedric@gmx.ca> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-03-15repo-add : rename gstmpdir to tmpdirXavier Chantry1-9/+9
What does gstmpdir mean? Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-03-15repo-add : don't change the modification time on depends and descXavier Chantry1-5/+2
The modification time on depends and desc file were changed to match the modification time of the package file. I don't see why and we are actualling losing information here. If we want to know the date of the package file, we can just look inside the depends file. If we want to know when the entry was created, we should not alter the modification time of depends and desc. Besides, this had the non-obvious and undocumented side effect that the depends file was always created, even if it was empty. And pacman actually does require that. So I added a "touch depends" to always create the file. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-03-15repo-add : new locking systemXavier Chantry1-13/+45
Weird things could happen if several repo-add were run concurrently on the same database. The introduced locking system will prevent this to happen. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-03-15repo-add : fix package variables declarationXavier Chantry1-8/+4
- arch was missing - backup is not used by repo-add. However makepkg still needs to put it in PKGINFO because pacman uses it - startdir is no longer used after the new delta implementation - the declaration of group, depend, backup, etc is not needed because these variables are always declared before being used : declare $var="$val" case "$var" in group) _groups="$_groups$group\n" ;; - reorder the variables declaration to follow the same order than they are written to the depends and desc file, for making future checks easier Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-03-15repo-add : rewrite delta supportXavier Chantry1-5/+97
Use the correct database format Use xdelta3 to get the source and destination files from the delta itself Allow delta files to be added with repo-add just like package files. delta files can also be removed with repo-remove. This is simply done by looking for a .delta extension in the arguments, and calling the appropriate db_write_delta or db_remove_delta functions. Example usage: repo-add repo/test.db.tar.gz repo/libx11-1.1.99.2-2-x86_64.pkg.tar.gz repo-add repo/test.db.tar.gz repo/libx11-1.1.5-2_to_1.1.99.2-2-x86_64.delta repo-remove repo/test.db.tar.gz libx11-1.1.5-2_to_1.1.99.2-2-x86_64.delta Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-03-15repo-add : drop delta support to rewrite it from scratchXavier Chantry1-59/+0
The current implementation has several problems : Wrong database format All the info is taken from the filename, which is a bit ugly It looks for .delta files in the current directory when adding a package, which is not very flexible Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-03-15repo-add.sh.in : repo-remove improvementsXavier Chantry1-12/+38
* report when a package entry to be removed is not found * backup and restore eventual "deltas" files * slight optimization when looking for an entry : only look at the entries starting with $pkgname Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-03-15repo-add cleanupXavier Chantry1-53/+65
Refactor the main loop, which was difficult to read. Use case instead of if when appropriate. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-02-28repo-add: print warning if same version already existsXavier Chantry1-3/+7
Simple fix for FS#13414. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-20repo-add : remove realpath usageXavier Chantry1-24/+19
Rework slightly db_write_entry so that $pkgfile is no longer referenced from the temporary dir. This means $pkgfile can be a relative path and does not need to be converted with realpath anymore. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-20repo-add : remove the need of realpath for REPO_DB_FILEXavier Chantry1-17/+16
REPO_DB_FILE does not need to be an absolute path anymore so no need to call realpath. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-19Merge branch 'maint'Dan McGee1-13/+16
2009-02-19repo-add : remove useless test_repo_db_file functionXavier Chantry1-10/+1
This function was used only once, was basically just one line, and was also called with an unused argument. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-16repo-add: fix eval and quote issuesDan McGee1-13/+16
eval was ugly and dirty, and bit us here. Instead, use a safer form of variable declaration to ensure quotes don't foil us in pkgdesc or any other fields. This fixes FS#10837. Signed-off-by: Dan McGee <dan@archlinux.org>
2009-01-15Make the repo-add quiet flag less quietAaron Griffin1-3/+2
Considering one can easily run: repo-add .... >/dev/null to get only warnings and errors, the -q flag is mostly useless. Make the -q flag silence only level 2 messages. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-10-29Merge branch 'maint'Dan McGee1-2/+2
2008-10-19repo-add: Use openssl instead of md5sumDan McGee1-2/+2
This is similar to the change we made in makepkg so it is cross-platform compatible and doesn't require coreutils. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-24Remove DB_COMPRESSION and DB_CHECKSUMS from makepkg.confXavier Chantry1-16/+5
DB_COMPRESSION was only used in repo-add and DB_CHECKSUMS was not used anywhere. This also removes the dependency on makepkg.conf in repo-add, so repo-add no longer needs to source makepkg.conf And instead of DB_COMPRESSION, it seems better to just check the extension of the repository file. It does not make sense to have a tar.gz file with a tar.bz2 extension or whatever. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-20Factor shell script size command into configure scriptDan McGee1-2/+2
Commit 149839c5391e9a93 introduced a small behavior regression as a drawback for a better portability. repo-add now includes the approximate size (to the nearest KB) rather than an exact size due to the switching of the du command to a more portable form. Instead of sacrificing the exact size, use configure to help us determine a valid command to acquire our filesize and place it in the sync database. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-20repo-add: add optdepends to the sync database.Xavier Chantry1-1/+3
See FS#10630. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-08-20repo-add: Fix whitespaces handling in variables.Nagy Gabor1-9/+8
repo-add didn't handle whitespaces nicely in fields value, and this has hurt us several times, first with provision version (FS#9171) and then with optdepends (FS#10630), so it is time to fix it. Signed-off-by: Nagy Gabor <ngaba@bibl.u-szeged.hu> Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-30repo-add cleanup.Xavier Chantry1-14/+14
* change ln -s to ln -sf in the Makefile to prevent a failure when the link already exists. * make test_repo_db_file simpler and more natural, move the complexity out of it. * remove one $cmd = repo-remove check that wasn't needed Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14Combine repo-add and repo-remove into one scriptDan McGee1-26/+67
They shared about 75% of their code, so there is no real reason we should maintain them separately. Merge the differences accordingly and add a check based on the basename of the command used to decide what behavior to follow. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-06-14repo-*: allow use of readlink or realpathDan McGee1-6/+17
Linux coreutils provides readlink, and BSD systems tend to have realpath available. Both commands provide similar functionality but of course have different names. Add a check for either and use what is available. While doing this, also unify some of the differences that have cropped up between repo-add and repo-remove. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-29du -b is not available on BSD, use du -k instead.Xavier Chantry1-2/+2
This fixes FS#10459. There is apparently no portable ways to get the apparent size of a file, like du -b does. So the best compromise seems to get the block size in kB, and then convert that to byte so that we keep compatibility. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-05-10scripts: add -q/--quiet option to repo-add and repo-removeDan McGee1-4/+12
They are pretty noisy scripts in their normal course of operations, so allow all messages to be squashed except for warning and error messages with this new flag. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-21Merge branch 'maint'Dan McGee1-0/+7
Remove gettext() function addition from gensync and updatesync in master as gettext is no longer used in them anyway.
2008-02-18scripts: allow usage when gettext is not installedDan McGee1-0/+7
Address the issue of our scripts not working so great when gettext is not available. This has come up in multiple bug reports, and is relatively easy to address by adding a simple check and a stub function if gettext was not found that simply echos the original message. Addresses concerns from FS#9214 and FS#9607. Signed-off-by: Dan McGee <dan@archlinux.org>
2008-02-06remove --force option from repo-add.Chantry Xavier1-8/+4
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>
2008-02-03add 'force' to PKGINFO, have repo-add respect it.Chantry Xavier1-2/+2
Ref: http://www.archlinux.org/pipermail/pacman-dev/2008-January/011023.html Also see FS#9347 and FS#9349. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-14Fix typos in code commentsDan McGee1-4/+4
Signed-off-by: Dan McGee <dan@archlinux.org>
2008-01-13Ensure correct dir permissions in the database.Chantry Xavier1-0/+3
Fix for FS#9176. A previous commit (6e8daa553bbd5) already forced all database files to 644. Now the directories are also forced to 755. Additionally, repo-add now sets the umask to 022, just like makepkg does, to fix the problem at its root. Signed-off-by: Chantry Xavier <shiningxc@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-12-11Update GNU GPL boilerplate and copyright datesDan McGee1-3/+1
Update the GPL boilerplate to direct people to the GNU website for a copy of the license, as well as bump all of Judd's copyrights to 2007. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-11-13repo-add: Ensure only adding package's deltas.Nathan Jones1-1/+7
repo-add was adding the delta files of any package that started with the same package name plus a hyphen. In this example, deltatest-libs delta files were added to the deltatest package: $ repo-add deltatest.db.tar.gz deltatest-1.0.2-1-i686.pkg.tar.gz ==> Extracting database to a temporary location... ==> Adding package 'deltatest-1.0.2-1-i686.pkg.tar.gz' -> Removing existing package 'deltatest-1.0.2-1'... -> Creating 'desc' db entry... -> Computing md5 checksums... -> Creating 'depends' db entry... -> Creating 'deltas' db entry... -> Added delta 'deltatest-1.0.2rc3-1_to_1.0.2-1-i686.delta' -> Added delta 'deltatest-libs-1.0.0-1_to_1.0.1-1-i686.delta' ==> Creating updated database file /tmp/deltatest.db.tar.gz Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-10-20Add delta information to the repository database.Nathan Jones1-1/+55
(Dan: cleaned up one if statement) Signed-off-by: Nathan Jones <nathanj@insightbb.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-09-07scripts/*.sh.in: Clean up and fix a few bugsAndrew Fyfe1-154/+129
repo-add, repo-remove: 'bsdtar -c * | ...' doesn't work (you need '-f -'). Code clean up eliminated this bug. Removed the multiple checksum support, pacman now only supports MD5, so there's no need for the database to contain multiple checksums. Quote all variables containing file/dir names to prevent paths containing spaces from causing problems. Add msg, warning and error functions. General code clean up. pacman-optimize: Use a sub-directory in /tmp for working files to make it easier to clean up at the end. Add quotes round $@ in die and die_r, otherwise printf can't display the message correctly. makepkg: Disable colour output if stderr is not a tty. Signed-off-by: Andrew Fyfe <andrew@neptune-one.net>
2007-07-27Fix gettext output in repo-{add,remove}Andrew Fyfe1-15/+14
Signed-off-by: Andrew Fyfe <andrew@neptune-one.net> Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-15Switch repo-add, repo-remove, and pacman-optimize to bsdtarDan McGee1-7/+7
Relatively straightforward fixes (s/tar/bsdtar/g, add hyphens to options). Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-07Make paragraph text in scripts single stringsDan McGee1-19/+14
It is much easier for translators to deal with paragraphs as strings rather than by lines. Take all usage and version information and convert it to this format. Signed-off-by: Dan McGee <dan@archlinux.org>
2007-07-07Move scripts from *.in to *.sh.in so gettext can determine typeDan McGee1-0/+317
If we move the scripts from *.in to *.sh.in and *.py.in, gettext can pull the required strings to translate a whole lot easier. Do this. Signed-off-by: Dan McGee <dan@archlinux.org>