summaryrefslogtreecommitdiff
path: root/db-functions
AgeCommit message (Collapse)Author
2010-08-13Use common functions to print messages, warnings and errorsPierre Schmitz
These functions are copied from makepkg
2010-08-13Check permission before any actionPierre Schmitz
Added a function to check if user has permission to alter the repos and db files.
2010-08-10Use more consitent naming for package poolPierre Schmitz
There are no longer architecture-specific subdirs and the structure was switch to this: ftp └── pool ├── community └── packages packages contains all packages from core, extra and testing; this naming is in sync with the svn repo naming: svn-packages and svn-community
2010-08-08Fix typoPierre Schmitz
2010-08-08Cleanup db-functionsPierre Schmitz
* fix indention * use consistent output * set vars local
2010-08-08Move common function to db-functionsPierre Schmitz
db-functions now sets an individual $WORKDIR and implements trap functinos that remove locks on exit or error. There are new functions to lock and unlock the running script. misc-scripts/ftpdir-cleanup was renamed to ftpdir-cleanup-repo as the cron-job had the same name. Script names have to be unique when using db-functions.
2010-08-08use common workdirPierre Schmitz
2010-06-20Replace PKGPOOL_DIR by a function callPierre Schmitz
The package pool dir depends on the host; so we solve this similar to get_repos_for_host() Note: There is no "os" subdir for the package pool.
2010-04-11Fail if lock couldn't be obtained; Unlock the repos if ftpdir-cleanup failsPierre Schmitz
2010-03-13sourceballs: Make cleanup more efficientEric Bélanger
Moved all cleanup related code in sourceballs-cleanup script and moved, now common, functions in db-functions. The cleanup script is now ran after all the new sourceballs have been fetched. Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
2010-03-03Make repo locking an atomic process and added timeout argumentEric Bélanger
The repo locking function now use a lock directory instead of a lock file. This makes the lock checking and creation an atomic process. The repo_lock function will now try to obtain a lock every $LOCK_DELAY seconds until it is successful. An optional third argument can be use to give a timeout in seconds; this is intended for scripts that runs unattended. Repo locking is now used in the ftpdir-cleanup script. This should fix the problem of the ftpdir-cleanup script removing the new package instead of the old one (FS#17058). Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com>
2010-02-21Accept any *.pkg.tar.* package file namePierre Schmitz
With this patch packages with different compressions are accepted. It is ensured that one cannot have the same package with different compression extensions. The new functions getpkgfile{,s} are used to sanitize globed filenames. Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2009-10-29Echo pkginfo parsing errors to stderrAaron Griffin
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-10-26Moved chk_license to db-functions fileEric Bélanger
Signed-off-by: Eric Bélanger <snowmaniscool@gmail.com> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-13Add new get_repos_for_host() functionDan McGee
And use it. This allows us to have server-specific behavior in our scripts without further patching, and it also allows us to simplify some of our scripts a fair amount. Signed-off-by: Dan McGee <dan@archlinux.org>
2009-09-13Be more careful with config file inclusionDan McGee
We can't really do the basedir magic from db-functions as it is just being sourced and is not the currently executing script. Although a bit repetitive, it is a lot safer to just include the config file everywhere. Noticed this when trying to run the latest available scripts on sigurd. Signed-off-by: Dan McGee <dan@archlinux.org>
2009-08-17Remove dependence on makepkg.confAaron Griffin
Removed the need for makepkg.conf * Killed off CARCH * Added PKGEXT to the config file * Remove source_makepkg function * Source config file where makepkg.conf was needed Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-22remove support for different svn reposPierre Schmitz
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-20db-functions: minor cleanup - remove echoAaron Griffin
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-20db-scripts: getpkgbase: return pkgbase by defaultPierre Schmitz
Check for pkgbase first. If and only if this doesn't exist, return pkgname. This fixes potential ordering issues. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-20Minor syntactic improvements in db-updateFrancois Charette
* also added error msg for repo_lock in db-functions [Aaron: keep quotes around $WORKDIR] Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-20Bugfix in db-functions for _grep_pkginfoFrancois Charette
* undefined argument $pattern changed to $2 Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-14Refactor PKGINFO reading into a functionAaron Griffin
This is just for readability and cleanup Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-14Read meta data from .PKGINFO instead of filenamePierre Schmitz
Prefer pkgbase over pkgname in getpkgbase() Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-14fix syntax errorPierre Schmitz
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-06-12fix redirection to stderr in get_svnpathFrancois Charette
[Aaron: Use >&2 instead of /dev/stderr, just in the offchance that /dev is missing for some reason] Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-05-13use pkgext defined in makepkg.confPierre Schmitz
Signed-off-by: Pierre Schmitz <pierre@archlinux.de> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-05-12fixed redirection of error msgs in get_svnpathFrancois Charette
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-03-11Add per-repo SVN configsAaron Griffin
This could be useful if we move community to a separate SVN repo Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-02-13Correct the sourceball removal stepAaron Griffin
Only remove sourceballs that do NOT exist in any repo This code is experimental Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-01-09Add support for altername BASEDIRs in db-functionsAaron Griffin
This is needed because we do lots of things via relative paths, and scripts in the misc-scripts dir may need some of these functions too Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-11-23Ensure we keep track of our initial umaskAaron Griffin
If we call set_umask more than once, make sure we don't overwrite our initial umask, so we can restore it right Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-11-22Set the umask to allow g+wAaron Griffin
This should hopefully cover all our permission bases with regard to new files Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-11-22Remove 'copy_helper' as chmodding is failAaron Griffin
The chmod doesn't work unless the user is the owner of the file Resorting to umask changes here Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-11-21Add umask setting/restoring helper functionsAaron Griffin
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-11-21Fix patching for chmod callAaron Griffin
dirname was failing if the target was a dir Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-11-20Move everything to /srv to support new server confAaron Griffin
Additionally, make TMPDIR configurable so we can move that Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-11-11Move as much as we can out to a config fileAaron Griffin
This should allow us to move FTP and SVN placement around Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-10-21Add copy_helper function to ensure correct permissionsAaron Griffin
This will force all files copied back and forth to have 0664 permissions so that we can attempt to do away with this permission adjusting cron job Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-10-21Remove some goofy debugging messages from db-functionsAaron Griffin
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-09-13Validate a package file's architectureAaron Griffin
Apparently, people seem to be renaming files as a "hack" and breaking things. Let's make sure they edited the PKGINFO too Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-09-02Correctly remove old sourceballs without removing the wrong filesAaron Griffin
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-09-02Forgot the db-functions file. WhoopsAaron Griffin
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>