summaryrefslogtreecommitdiffstats
path: root/misc-scripts/ftpdir-cleanup
AgeCommit message (Collapse)AuthorFilesLines
2010-08-08Move common function to db-functionsPierre Schmitz1-218/+0
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-08fix cleaning of any packages and ignore empty reposPierre Schmitz1-2/+3
2010-05-02ftpdir-cleanup: Add clean_pkgs functionAaron Griffin1-4/+14
This should remove files if they are symlinks (pooled packages) and move them to the cleanup dir if not
2010-04-28Change ftpdir-cleanup scripts for package poolingAaron Griffin1-9/+6
* The per repo script now simply removes files as they should all be symlinks at this time * The cron job script will do the extra job of checking the global pool. If there are no more symlinks, move the pooled package Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2010-04-28Remove FTP_OS_SUFFIX variableAaron Griffin1-1/+1
This isn't needed and if "os" ever changes, we have bigger changes. Won't save us any time and it's longer to type.
2010-04-11Do not overwrite TMPDIR defined in config20100411Pierre Schmitz1-6/+6
2010-04-11Fail if lock couldn't be obtained; Unlock the repos if ftpdir-cleanup failsPierre Schmitz1-1/+12
2010-03-03Make repo locking an atomic process and added timeout argumentEric Bélanger1-3/+7
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-23Hide 'file not found' message20100223Pierre Schmitz1-1/+1
2010-02-21remove unneeded and now broken checkPierre Schmitz1-1/+0
2010-02-21add dry run option to ftpdir-cleanupPierre Schmitz1-5/+7
Signed-off-by: Pierre Schmitz <pierre@archlinux.de>
2009-09-18ftpdir-cleanup: Additional getpkgname cleanupAaron Griffin1-2/+4
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18ftpdir-cleanup: get rid of local getpkgnameAaron Griffin1-19/+5
This is in the db-functions file, and does a better job. In order to do this, we had to change some path related code Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18Remove '$arch' from file loopAaron Griffin1-1/+1
This allows us to still remove older, non architecture prefixed packages Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-18Minor: remove unused variableAaron Griffin1-1/+0
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-09-14Be more careful with config file inclusionDan McGee1-0/+1
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-19More removal of DB_COMPRESSION from cron jobsAaron Griffin1-11/+5
Remove dependance on makepkg.conf Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-19More makepkg.conf removal - prefer toplevel configAaron Griffin1-7/+0
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-18Replace a string compare with a -f checkAaron Griffin1-1/+1
No real reason, this is just easier to understand, and checks like this should be the norm. If file does not exist, continue Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-08-16Add DB_COMPRESSION='gz', as this has been removed from makepkg.confThomas Bächler1-0/+1
2009-08-16Make ftpdir-cleanup NOT delete all packages if databas extraction failsThomas Bächler1-1/+12
2009-08-16Avoid confusing messages and potential problems when no packages are presentThomas Bächler1-0/+3
If no packages are present in the repository, a message like this will be generated, and the corresponding mv command will be issued. Prevent this by checking if *$arch$PKGEXT equals "*$arch$PKGEXT": Scan complete for core (i686) at /srv/ftp/core/os/i686 The following files are in the repo but not the db They will be moved to '/srv/package-cleanup' *i686.pkg.tar.gz
2009-07-23ftpdir-cleanup: Loop over arches for 'any' linksAaron Griffin1-8/+10
Remove the hardcoded i686/x86_64 and loop over the ARCHES array in the config file, checking for valid symlinks. If none are found, remove the 'any' package Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-23ftpdir-cleanup: Minimize outputAaron Griffin1-4/+2
Clean up some output so when we do nothing, we get no output This is preferred as the mailer will simply not send a mail in this case. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-21Very minor additionsFrancois Charette1-1/+2
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-21Bugfix: make TMPDIR within the for loopFrancois Charette1-2/+5
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-21Refactor ftpdir-cleanup to handle all archesFrancois Charette1-117/+150
This may look like a rather large patch, but the changes are mostly a reshuffling of the code to loop over all arches first, and then handle the arch-indep packages. The cronjob has been changed accordingly. Added new category DELETESYMLINKS, which are deleted instead of being moved to package-cleanup. I have also fixed the arch-specific issue with the ftppath, using parameters in config instead. Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-21any support: use relative symlinksAaron Griffin1-1/+1
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-21ftpdir-cleanup: Fix ARCHINDEP parsingAaron Griffin1-1/+2
Failed hard on empty 'any' directories Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-21ftpdir-cleanup: Fix the symlink restore loopAaron Griffin1-22/+7
Previous logic was stupid... let's just check the missing files. If it's missing and exists in the any dir, then common sense says we deleted a symlink somewhere... Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-21ftpdir-cleanup: Fixes for 'any' supportAaron Griffin1-10/+40
* Break out ftppath, base it on ftbpath_base * Only check ARCHINDEPFILES if the any dir exists * Attempt to restore symlinks before moving 'any' files out of the way Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-20ftpdir-cleanup: Corrections for 'any' packagesAaron Griffin1-2/+4
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-07-17ftpdir-cleanup: Allow configurable destination dirAaron Griffin1-8/+9
3rd argument to the script Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-06-12fixes for ftpdir-cleanupFrançois Charette1-2/+2
* don't add files with arch=any to EXTRAFILES * replace && by -a within [ ] Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-05-13use pkgext defined in makepkg.confPierre Schmitz1-2/+2
Signed-off-by: Pierre Schmitz <pierre@archlinux.de> Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2009-03-20ftpdir-cleanup: remove arch-independent packagesAbhishek Dasgupta1-1/+25
Removes architecture independent packages which are not symlinked in any of the architecture repositories.
2008-11-21Fix misc-scripts/ftpdir-cleanup pathing for /srvJan de Groot1-5/+5
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-06-20Make blank lines conditionalAaron Griffin1-2/+4
Mainly for output cleanup Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-06-20Make sure ftpdir-cleanup actually does work before outputtingAaron Griffin1-0/+6
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>
2008-05-29Move ftpdir-cleanup to misc-scriptsAaron Griffin1-0/+116
Signed-off-by: Aaron Griffin <aaronmgriffin@gmail.com>