summaryrefslogtreecommitdiff
path: root/Command/AddUrl.hs
Commit message (Collapse)AuthorAge
* fix inversion of control in CommandSeek (no behavior changes)Gravatar Joey Hess2014-01-20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | I've been disliking how the command seek actions were written for some time, with their inversion of control and ugly workarounds. The last straw to fix it was sync --content, which didn't fit the Annex [CommandStart] interface well at all. I have not yet made it take advantage of the changed interface though. The crucial change, and probably why I didn't do it this way from the beginning, is to make each CommandStart action be run with exceptions caught, and if it fails, increment a failure counter in annex state. So I finally remove the very first code I wrote for git-annex, which was before I had exception handling in the Annex monad, and so ran outside that monad, passing state explicitly as it ran each CommandStart action. This was a real slog from 1 to 5 am. Test suite passes. Memory usage is lower than before, sometimes by a couple of megabytes, and remains constant, even when running in a large repo, and even when repeatedly failing and incrementing the error counter. So no accidental laziness space leaks. Wall clock speed is identical, even in large repos. This commit was sponsored by an anonymous bitcoiner.
* also check diskreserve for quvi downloadsGravatar Joey Hess2014-01-04
|
* addurl, importfeed: Honor annex.diskreserve as long as the size of the url ↵Gravatar Joey Hess2014-01-04
| | | | | | | | can be checked. This adds a http HEAD before the download is done. That was already the case when the assistant was running, and it seems worth it to avoid filling up the whole disk, like happened to my server today.
* importfeed: Support youtube playlists.Gravatar Joey Hess2013-12-29
|
* url size fixesGravatar Joey Hess2013-10-11
| | | | | | | | | | addurl: Improve message when adding url with wrong size to existing file. Before the message suggested the url didn't exist. Fixed handling of URL keys that have no recorded size. Before, if the key has no size, the url also had to not declare any size, which was unlikely and wrong, or it was taken to not exist. This probably would mostly affect keys that were added to the annex with addurl --relaxed.
* honor fileNameLengthLimit for quviGravatar Joey Hess2013-10-05
|
* addurl: Better sanitization of generated filenames.Gravatar Joey Hess2013-10-05
| | | | Use sanitizeFilePath rather than rolling our own sanitizer.
* Send a git-annex user-agent when downloading urls.Gravatar Joey Hess2013-09-28
| | | | | | | | | Overridable with --user-agent option. Not yet done for S3 or WebDAV due to limitations of libraries used -- nether allows a user-agent header to be specified. This commit sponsored by Michael Zehrer.
* add, import, assistant: Better preserve the mtime of symlinks, when when ↵Gravatar Joey Hess2013-09-25
| | | | | | | adding content that gets deduplicated. Note that this turned out to remove a syscall, not add any expense. Otherwise, I would not have done it.
* addurl: Fix quvi audodetection, broken in last release.Gravatar Joey Hess2013-09-15
|
* Allow building without quvi support.Gravatar Joey Hess2013-09-09
|
* better casesGravatar Joey Hess2013-08-22
|
* Youtube support! (And 53 other video hosts)Gravatar Joey Hess2013-08-22
| | | | | | | | | | When quvi is installed, git-annex addurl automatically uses it to detect when an page is a video, and downloads the video file. web special remote: Also support using quvi, for getting files, or checking if files exist in the web. This commit was sponsored by Mark Hepburn. Thanks!
* improve error messageGravatar Joey Hess2013-08-02
|
* Fix a few bugs involving filenames that are at or near the filesystem's ↵Gravatar Joey Hess2013-07-30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | maximum filename length limit. Started with a problem when running addurl on a really long url, because the whole url is munged into the filename. Ended up doing a fairly extensive review for places where filenames could get too large, although it's hard to say I'm not missed any.. Backend.Url had a 128 character limit, which is fine when the limit is 255, but not if it's a lot shorter on some systems. So check the pathconf() limit. Note that this could result in fromUrl creating different keys for the same url, if run on systems with different limits. I don't see this is likely to cause any problems. That can already happen when using addurl --fast, or if the content of an url changes. Both Command.AddUrl and Backend.Url assumed that urls don't contain a lot of multi-byte unicode, and would fail to truncate an url that did properly. A few places use a filename as the template to make a temp file. While that's nice in that the temp file name can be easily related back to the original filename, it could lead to `git annex add` failing to add a filename that was at or close to the maximum length. Note that in Command.Add.lockdown, the template is still derived from the filename, just with enough space left to turn it into a temp file. This is an important optimisation, because the assistant may lock down a bunch of files all at once, and using the same template for all of them would cause openTempFile to iterate through the same set of names, looking for an unused temp file. I'm not very happy with the relatedTemplate hack, but it avoids that slowdown. Backend.WORM does not limit the filename stored in the key. I have not tried to change that; so git annex add will fail on really long filenames when using the WORM backend. It seems better to preserve the invariant that a WORM key always contains the complete filename, since the filename is the only unique material in the key, other than mtime and size. Since nobody has complained about add failing (I think I saw it once?) on WORM, probably it's ok, or nobody but me uses it. There may be compatability problems if using git annex addurl --fast or the WORM backend on a system with the 255 limit and then trying to use that repo in a system with a smaller limit. I have not tried to deal with those. This commit was sponsored by Alexander Brem. Thanks!
* importfeed: git-annex becomes a podcatcher in 150 LOCGravatar Joey Hess2013-07-28
|
* addurl --pathdepth: Fix failure when the pathdepth specified is deeper than ↵Gravatar Joey Hess2013-07-05
| | | | the urls's path.
* expose Control.Monad.joinGravatar Joey Hess2013-04-22
| | | | | I think I've been looking for that function for some time. Ie, I remember wanting to collapse Just Nothing to Nothing.
* connect existing meters to the transfer log for downloadsGravatar Joey Hess2013-04-11
| | | | | | | | | | | | | | Most remotes have meters in their implementations of retrieveKeyFile already. Simply hooking these up to the transfer log makes that information available. Easy peasy. This is particularly valuable information for encrypted remotes, which otherwise bypass the assistant's polling of temp files, and so don't have good progress bars yet. Still some work to do here (see progressbars.mdwn changes), but this is entirely an improvement from the lack of progress bars for encrypted downloads.
* addurl: Register transfer so the webapp can see it.Gravatar Joey Hess2013-04-11
| | | | | | * addurl: Register transfer so the webapp can see it. * addurl: Automatically retry downloads that fail, as long as some additional content was downloaded.
* addurl: Bugfix: Did not properly add file in direct mode.Gravatar Joey Hess2013-04-11
|
* add section metadata to all commandsGravatar Joey Hess2013-03-24
| | | | Not yet used .. mindless train work.
* fix relaxed with existing fileGravatar Joey Hess2013-03-12
|
* addurl: Add --relaxed option.Gravatar Joey Hess2013-03-11
|
* add: Improved detection of files that are modified while being added.Gravatar Joey Hess2013-02-14
| | | | | | | | | | | | | In indirect mode, now checks the inode cache to detect changes to a file. Note that a file can still be changed if a process has it open for write, after landing in the annex. In direct mode, some checking of the inode cache was done before, but from a much later point, so fewer modifications could be detected. Now it's as good as indirect mode. On crippled filesystems, no lock down is done before starting to add a file, so checking the inode cache is the only protection we have.
* addurl in direct modeGravatar Joey Hess2013-01-06
|
* convert notBareRepo to a CommandCheckGravatar Joey Hess2012-12-29
| | | | | | This avoids some small overhead by only running the check once per command; it also ensures that, even if the command doesn't find anything to run on, it still fails to run when in a bare repo.
* block all commands that don't work in direct modeGravatar Joey Hess2012-12-29
| | | | | I left status working in direct mode, although it doesn't show correct stats for known annex keys.
* where indentationGravatar Joey Hess2012-11-12
|
* maintain set of files pendingAddGravatar Joey Hess2012-06-20
| | | | | | | | Kqueue needs to remember which files failed to be added due to being open, and retry them. This commit gets the data in place for such a retry thread. Broke KeySource out into its own file, and added Eq and Ord instances so it can be stored in a Set.
* addurl: Was broken by a typo introduced 2 released ago, now fixed. Closes: ↵Gravatar Joey Hess2012-06-14
| | | | #677576
* separate source of content from the filename associated with the key when ↵Gravatar Joey Hess2012-06-05
| | | | | | generating a key This already made migrate's code a lot simpler.
* Add annex.httpheaders and annex.httpheader-command config settingsGravatar Joey Hess2012-04-22
| | | | | | Allow custom headers to be sent with all HTTP requests. (Requested by the Internet Archive)
* added ifM and nuked 11 lines of codeGravatar Joey Hess2012-03-14
| | | | no behavior changes
* more robustness fixesGravatar Joey Hess2012-02-18
|
* don't fail with --pathdepth when file already existsGravatar Joey Hess2012-02-18
|
* don't error out entirely if an url cannot be downloadedGravatar Joey Hess2012-02-18
|
* fix filename limit when using --pathdepthGravatar Joey Hess2012-02-16
|
* zero still badGravatar Joey Hess2012-02-16
|
* allow pathdepth to drop from the front or take from the end (negative)Gravatar Joey Hess2012-02-16
|
* improve usageGravatar Joey Hess2012-02-16
|
* addurl: Add --pathdepth option.Gravatar Joey Hess2012-02-16
|
* avoid too long filename when making up a filename for addurl tooGravatar Joey Hess2012-02-16
|
* create parent directories as needed for addurl --fileGravatar Joey Hess2012-02-16
|
* rework git check-attr interfaceGravatar Joey Hess2012-02-13
| | | | | | | | | | | | | | | Now gitattributes are looked up, efficiently, in only the places that really need them, using the same approach used for cat-file. The old CheckAttr code seemed very fragile, in the way it streamed files through git check-attr. I actually found that cad8824852aa0623dc41eac02a9e2bae47d88ec4 was still deadlocking with ghc 7.4, at the end of adding a lot of files. This should fix that problem, and avoid future ones. The best part is that this removes withAttrFilesInGit and withNumCopies, which were complicated Seek methods, as well as simplfying the types for several other Seek methods that had a Backend tupled in.
* also verify new urls when adding them to existing filesGravatar Joey Hess2012-02-10
|
* addurl --fast: Verifies that the url can be downloaded (only getting its ↵Gravatar Joey Hess2012-02-10
| | | | head), and records the size in the key.
* addurl: Normalize badly encoded urls.Gravatar Joey Hess2012-02-09
|
* improve error messageGravatar Joey Hess2012-02-08
|
* addurl: Added a --file optionGravatar Joey Hess2012-02-08
| | | | | | | Can be used to specify what file the url is added to. This can be used to override the default filename that is used when adding an url, which is based on the url. Or, when the file already exists, the url is recorded as another location of the file.