refactor: rename exiftool-bin to bin-ext

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/888/head
Varun Patil 2023-10-20 12:35:35 -07:00
parent eb1e224bfa
commit fd851b5e34
6 changed files with 16 additions and 15 deletions

2
.gitignore vendored
View File

@ -26,4 +26,4 @@ memories.tar.gz
/playwright/.cache/
.cache/
exiftool-bin/
bin-ext/

View File

@ -5,6 +5,7 @@ All notable changes to this project will be documented in this file.
## [Unreleased]
- **Breaking**: Nextcloud 26+ and PHP 8.0 are now required.
- **Breaking**: The directory containing the `exiftool` and `go-vod` binaries was renamed from `exiftool-bin` to `bin-ext`
- **Feature**: Folders view in shares ([#880](https://github.com/pulsejet/memories/pull/880))
- Significant improvements to code quality and maintainability.
- Improvements to the [documentation](https://memories.gallery/install/).

View File

@ -1,10 +1,10 @@
all: dev-setup lint build-js-production test
# Dev env management
dev-setup: clean clean-dev npm-init exiftool install-tools
dev-setup: clean clean-dev npm-init bin-ext install-tools
exiftool:
sh scripts/get-exiftool.sh
bin-ext:
sh scripts/get-bin-ext.sh
install-tools:
composer install
@ -21,7 +21,7 @@ npm-init:
npm-update:
npm update
.PHONY: dev-setup exiftool install-tools php-lint psalm npm-init npm-update
.PHONY: dev-setup bin-ext install-tools php-lint psalm npm-init npm-update
# Building
build-js:

View File

@ -118,7 +118,7 @@ class BinExt
public static function getExiftool(): array
{
if (Util::getSystemConfig('memories.exiftool_no_local')) {
return ['perl', realpath(__DIR__.'/../../exiftool-bin/exiftool/exiftool')];
return ['perl', realpath(__DIR__.'/../../bin-ext/exiftool/exiftool')];
}
return [self::getExiftoolPBin()];
@ -129,7 +129,7 @@ class BinExt
*/
public static function detectExiftool(): false|string
{
if (!empty($path = Util::getSystemConfig('memories.exiftool'))) {
if (!empty($path = Util::getSystemConfig('memories.exiftool')) && file_exists($path)) {
return $path;
}
@ -144,7 +144,7 @@ class BinExt
// Get static binary if available
if ($arch && $libc) {
// get target file path
$path = realpath(__DIR__."/../../exiftool-bin/exiftool-{$arch}-{$libc}");
$path = realpath(__DIR__."/../../bin-ext/exiftool-{$arch}-{$libc}");
// make sure it exists
if ($path && file_exists($path)) {
@ -377,7 +377,7 @@ class BinExt
if (empty($goVodPath) || !file_exists($goVodPath)) {
// Detect architecture
$arch = \OCA\Memories\Util::getArch();
$path = __DIR__."/../../exiftool-bin/go-vod-{$arch}";
$path = __DIR__."/../../bin-ext/go-vod-{$arch}";
$goVodPath = realpath($path);
if (!$goVodPath) {

View File

@ -1,6 +1,6 @@
#!/bin/bash
od=`pwd`
src=`pwd`
rm -rf /tmp/memories
mkdir -p /tmp/memories
@ -10,11 +10,11 @@ cd /tmp
rm -rf memories.tar.gz
cd memories
sh "$od/scripts/get-exiftool.sh"
sh "$src/scripts/get-bin-ext.sh"
cd ..
tar --no-same-owner -p -zcf memories.tar.gz memories/
rm -rf memories
cd $od
cd $src
mv /tmp/memories.tar.gz .

View File

@ -12,9 +12,9 @@ binExtVar() {
EXIFTOOL_VER=$(binExtVar EXIFTOOL_VER)
GOVOD_VER=$(binExtVar GOVOD_VER)
rm -rf exiftool-bin
mkdir -p exiftool-bin
cd exiftool-bin
rm -rf bin-ext
mkdir -p bin-ext
cd bin-ext
echo "Getting exiftool $EXIFTOOL_VER"
wget -q "https://github.com/pulsejet/exiftool-bin/releases/download/$EXIFTOOL_VER/exiftool-amd64-musl"
wget -q "https://github.com/pulsejet/exiftool-bin/releases/download/$EXIFTOOL_VER/exiftool-amd64-glibc"