aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gnu/packages/video.scm4
1 files changed, 2 insertions, 2 deletions
diff --git a/gnu/packages/video.scm b/gnu/packages/video.scm
index 393d8d038d..765e39e956 100644
--- a/gnu/packages/video.scm
+++ b/gnu/packages/video.scm
@@ -1300,7 +1300,7 @@ be used for realtime video capture via Linux-specific APIs.")
(define-public obs
(package
(name "obs")
- (version "0.13.0")
+ (version "0.13.1")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/jp9000/obs-studio"
@@ -1308,7 +1308,7 @@ be used for realtime video capture via Linux-specific APIs.")
(file-name (string-append name "-" version ".tar.gz"))
(sha256
(base32
- "1rk5yfcqwjj4a8bj35fsfzk5qlsf5ylsy0z7kdrpl3fhnmla2izz"))))
+ "1vsn4r3wzfdwjrn69kgx3c5wfx17i72nxdv298pq772fp4j2iy2r"))))
(build-system cmake-build-system)
(arguments '(#:tests? #f)) ; no tests
(native-inputs
th % (st.st_nlink - 2)); return; } /* Hash the file. Note that hashPath() returns the hash over the NAR serialisation, which includes the execute bit on the file. Thus, executable and non-executable files with the same contents *won't* be linked (which is good because otherwise the permissions would be screwed up). Also note that if `path' is a symlink, then we're hashing the contents of the symlink (i.e. the result of readlink()), not the contents of the target (which may not even exist). */ Hash hash = hashPath(htSHA256, path).first; printMsg(lvlDebug, format("`%1%' has hash `%2%'") % path % printHash(hash)); /* Check if this is a known hash. */ Path linkPath = linksDir + "/" + printHash32(hash); retry: if (!pathExists(linkPath)) { /* Nope, create a hard link in the links directory. */ if (link(path.c_str(), linkPath.c_str()) == 0) { inodeHash.insert(st.st_ino); return; } switch (errno) { case EEXIST: /* Fall through if another process created ‘linkPath’ before we did. */ break; case ENOSPC: /* On ext4, that probably means the directory index is full. When that happens, it's fine to ignore it: we just effectively disable deduplication of this file. */ printMsg(lvlInfo, format("cannot link `%1%' to `%2%': %3%") % linkPath % path % strerror(ENOSPC)); return; default: throw SysError(format("cannot link `%1%' to `%2%'") % linkPath % path); } } /* Yes! We've seen a file with the same contents. Replace the current file with a hard link to that file. */ struct stat stLink; if (lstat(linkPath.c_str(), &stLink)) throw SysError(format("getting attributes of path `%1%'") % linkPath); if (st.st_ino == stLink.st_ino) { printMsg(lvlDebug, format("`%1%' is already linked to `%2%'") % path % linkPath); return; } if (st.st_size != stLink.st_size) { printMsg(lvlError, format("removing corrupted link ‘%1%’") % linkPath); unlink(linkPath.c_str()); goto retry; } printMsg(lvlTalkative, format("linking ‘%1%’ to ‘%2%’") % path % linkPath); /* Make the containing directory writable, but only if it's not the store itself (we don't want or need to mess with its permissions). */ bool mustToggle = !isStorePath(path); if (mustToggle) makeWritable(dirOf(path)); /* When we're done, make the directory read-only again and reset its timestamp back to 0. */ MakeReadOnly makeReadOnly(mustToggle ? dirOf(path) : ""); Path tempLink = (format("%1%/.tmp-link-%2%-%3%") % settings.nixStore % getpid() % rand()).str(); if (link(linkPath.c_str(), tempLink.c_str()) == -1) { if (errno == EMLINK) { /* Too many links to the same file (>= 32000 on most file systems). This is likely to happen with empty files. Just shrug and ignore. */ if (st.st_size) printMsg(lvlInfo, format("`%1%' has maximum number of links") % linkPath); return; } throw SysError(format("cannot link `%1%' to `%2%'") % tempLink % linkPath); } /* Atomically replace the old file with the new hard link. */ if (rename(tempLink.c_str(), path.c_str()) == -1) { int renameErrno = errno; if (unlink(tempLink.c_str()) == -1) printMsg(lvlError, format("unable to unlink `%1%'") % tempLink); if (renameErrno == EMLINK) { /* Some filesystems generate too many links on the rename, rather than on the original link. (Probably it temporarily increases the st_nlink field before decreasing it again.) */ if (st.st_size) printMsg(lvlInfo, format("`%1%' has maximum number of links") % linkPath); return; } throw SysError(format("cannot rename `%1%' to `%2%'") % tempLink % path); } stats.filesLinked++; stats.bytesFreed += st.st_size; stats.blocksFreed += st.st_blocks; } void LocalStore::optimiseStore(OptimiseStats & stats) { PathSet paths = queryAllValidPaths(); InodeHash inodeHash = loadInodeHash(); foreach (PathSet::iterator, i, paths) { addTempRoot(*i); if (!isValidPath(*i)) continue; /* path was GC'ed, probably */ startNest(nest, lvlChatty, format("hashing files in `%1%'") % *i); optimisePath_(stats, *i, inodeHash); } } static string showBytes(unsigned long long bytes) { return (format("%.2f MiB") % (bytes / (1024.0 * 1024.0))).str(); } void LocalStore::optimiseStore() { OptimiseStats stats; optimiseStore(stats); printMsg(lvlError, format("%1% freed by hard-linking %2% files") % showBytes(stats.bytesFreed) % stats.filesLinked); } void LocalStore::optimisePath(const Path & path) { OptimiseStats stats; InodeHash inodeHash; if (settings.autoOptimiseStore) optimisePath_(stats, path, inodeHash); } }