summaryrefslogtreecommitdiffstats
path: root/scripts
AgeCommit message (Collapse)AuthorFilesLines
2009-07-12makepkg: allow spaces in source file namesAllan McRae1-4/+4
The download command failed with sources that contained spaces. Remainder of fix for FS#15323. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-12makepkg: fix breakage with '%' in source filenamesDan McGee1-1/+1
Ensure we don't pass a bare filename to printf that might contain a lookalike '%' escape sequence. Fixes part of FS#15323. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-12makepkg: quote filenames when extractingDan McGee1-6/+6
We currently fall apart on files with spaces in the names. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-10makepkg: check for package functions when package splittingAllan McRae1-3/+11
Makes sure the required package functions are present when using package splitting. Also moves setting of pkgbase variable outside the check_sanity function to somewhere more appropriate. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-10makepkg: fix pkgdesc restoration with split packagingAllan McRae1-0/+5
A pkgdesc with spaces in it would get restored to an array and thus only the first word would be restored (FS#15210). Convert that array back to a string. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-10makepkg: Exit on failure within build() or package() functionsAllan McRae1-3/+5
Errors in build() functions were only fatal, if "--log" was enabled. Errors in package() functions were never fatal. Piping these functions through "cat -" triggers error trapping. This prevents the need for "|| return 1" usage in PKGBUILDs. Original-patch-by: Juergen Hoetzel <juergen@archlinux.org> Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-10makepkg: fix check for previously built packages with package splittingAllan McRae1-9/+38
Checks if some or all packages are built before overwriting/installing. Adds some new strings for translation. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-10makepkg: clean up moving PKGINFO creation to a functionAllan McRae1-2/+1
Someone forgot to commit this when pulling in the original patch to his working branch... Signed-off-by: Allan McRae <allan@archlinux.org>
2009-07-01Update copyright headers and messagesDan McGee3-6/+12
Signed-off-by: Dan McGee <dan@archlinux.org>
2009-06-23Merge commit 'allan/working'Dan McGee1-25/+29
2009-06-23repo-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-06-22makepkg: Move .PKGINFO creation into a function.Loui Chang1-16/+20
Signed-off-by: Loui Chang <louipc.ist@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2009-06-21makepkg: Download sources and check checksums for any source package.Loui Chang1-9/+9
It wouldn't be very nice to ship a PKGBUILD with the wrong checksums. Signed-off-by: Loui Chang <louipc.ist@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org>
2009-06-13makepkg: fix variable backup/restore for splitpkgAllan McRae1-2/+2
The backup and restore of variables that can be overridden while making split packages only dealt with the first element, not the whole array (FS#15010). Adjust the bash voodoo to fix it... Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-06-13makepkg: fix PKGBUILD sanity checkAllan McRae1-4/+1
If PKGBUILD was good, the "insane" variable was not defined and so the if statement failed. Simplify and fix this check. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-06-07makepkg: refactor sanity checking into a functionDan McGee1-66/+76
No new checks, just move it into a function and return 1 rather than exit directly. This also allows the use of local variables. Signed-off-by: Dan McGee <dan@archlinux.org> Signed-off-by: Allan McRae <allan@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-18Add support for the xz archive formatPierre Schmitz2-0/+6
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-18repo-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-05-16makepkg: fix sourcing BUILDSCRIPT and PATH issuesAllan McRae1-2/+3
The bash source command looks in the users PATH for the file to source before the local directory. This causes issues when someone has a PKGBUILD somewhere in their path (for unknown some reason...). Fixes FS#14727. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-05-14makepkg: Document package splittingAllan McRae1-1/+1
Signed-off-by: Allan McRae <allan@archlinux.org>
2009-05-14makepkg: do not update pkgver when building source packageAllan McRae1-6/+5
When making a source package for a SCM PKGBUILD, makepkg should not update the pkgver/pkgrel. Noted in FS#14456. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-05-11makepkg: several small fixesAllan McRae1-1/+3
1) Do not attempt to strip compressed binaries Original-work-by: Marc - A. Dahlhaus <mad@wol.de> 2) Add "\" in "GPL\'ed" so quote mark does not break source code highlighting 3) Add local to docdir paths in makepkg.conf for consistency 4) Use full path to sed in MacOSX in case users have GNU sed earlier in path Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-04-26makepkg: make in-place sed portableAllan McRae2-2/+3
Do a sed replacement in-place is not very portable. On Mac OSX and BSDs, the syntax is "sed -i ''" where as with GNU sed the command is "sed -i''" or just "sed -i". This patch detects which command should be used during configure. Credit to Kevin Barry who researched this issue and provided a patch to work around this using temporary backup files. Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-04-11Merge branch 'xav/repo-add'Dan McGee5-148/+422
2009-04-11makepkg: fix double check on same pathDan McGee1-1/+1
Commit 142225fd typo-ed this one, as it should look like the rest of the checks similar to it. Signed-off-by: Dan McGee <dan@archlinux.org>
2009-04-11makepkg: Fix integrity check when files are missing.Loui Chang1-8/+11
The index in the for loop wasn't being incremented, so if the first file wasn't found, the second file would be compared to the first checksum, rather than the second. Signed-off-by: Loui Chang <louipc.ist@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-03-30makepkg: run tidy_install with no package() functionAllan McRae1-0/+1
After the splitpkg implementation, the tidy_install function was not being called in PKGBUILDs with only the build() function. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-03-29makepkg: do not bail on failure to install built packageAllan McRae1-2/+8
Fixes FS#13417. Do no exit makepkg on a failure to install the built package(s). This allows clean-up to still occur. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-03-26makepkg: adjust log clean-up for new filenamesAllan McRae1-1/+8
The log files now have -build or -package at the end and there are separate log files for each *_package() function. Alter clean_up() to deal with this. Also, move glob outside quotes so this actually works. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-03-25makepkg: adjust install_package for split packagesAllan McRae1-3/+14
Install all created packages when using the install option with package splitting. Signed-off-by: Allan McRae <allan@archlinux.org>
2009-03-16Refactor testing for color message outputAllan McRae1-5/+11
Signed-off-by: Allan McRae <allan@archlinux.org>
2009-03-16makepkg: add pkgbase variableAllan McRae1-21/+23
The pkgbase variable is added to improve informational output and source package naming when using split packages. Defaults to ${pkgname[0]} if not set. Also: - move splitpkg detection to after pkgname presence is verified - add "cd" line to package_foo() functions in splitpkg proto Signed-off-by: Allan McRae <allan@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-03-15Add pkgdelta script to create deltas.Xavier Chantry3-0/+169
This should obsolete the delta support in makepkg. Having a separate script should be more flexible. Example usage: $ pkgdelta repo/tzdata-2009a-1-x86_64.pkg.tar.gz repo/tzdata-2009b-1-x86_64.pkg.tar.gz ==> Generating delta from version 2009a-1 to version 2009b-1 ==> Generated delta : 'repo/tzdata-2009a-1_to_2009b-1-x86_64.delta' Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-03-15Fix several issues with xdeltaXavier Chantry1-7/+16
1) The changes to sync.c look big but there are mostly caused by the indentation. Fix a bug where download_size == 0 because the packages and deltas are already in the cache, but we still need to build the deltas list and apply the deltas to create the final package. 2) Fix the gzip / md5sum issue by switching to xdelta3, disabling external recompression and using gzip -n in pacman, and disable bsdtar compression and using gzip -n in makepkg. Signed-off-by: Xavier Chantry <shiningxc@gmail.com>
2009-03-15Only check checksums if there is a source fileAllan McRae1-0/+2
Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-28makepkg : remove xdelta supportXavier Chantry1-66/+0
The pkgdelta script can be used instead. Signed-off-by: Xavier Chantry <shiningxc@gmail.com> Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
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-23Merge branch 'maint'Dan McGee1-2/+0
2009-02-23makepkg: fix updating pkgrel with pkgver in SCM packagesAllan McRae1-2/+0
Commit 1e656c0a introduced the changing of pkgrel to 1 when the pkgver was updated in SCM PKGBUILDs. However, the output in the "Making package:" was wrong. Attempting to fix that created another bug (FS#13416). Interestingly, pkgver was only ever being updated in the fakeroot stage which caused this problem. Now both pkgver and pkgrel are updated after the first devel_check and devel_update. Enjoy the really long explaination for a two line fix... Signed-off-by: Allan McRae <allan@archlinux.org> Signed-off-by: Dan McGee <dan@archlinux.org>
2009-02-19repo-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-19repo-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>