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/ /playwright/.cache/
.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] ## [Unreleased]
- **Breaking**: Nextcloud 26+ and PHP 8.0 are now required. - **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)) - **Feature**: Folders view in shares ([#880](https://github.com/pulsejet/memories/pull/880))
- Significant improvements to code quality and maintainability. - Significant improvements to code quality and maintainability.
- Improvements to the [documentation](https://memories.gallery/install/). - Improvements to the [documentation](https://memories.gallery/install/).

View File

@ -1,10 +1,10 @@
all: dev-setup lint build-js-production test all: dev-setup lint build-js-production test
# Dev env management # 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: bin-ext:
sh scripts/get-exiftool.sh sh scripts/get-bin-ext.sh
install-tools: install-tools:
composer install composer install
@ -21,7 +21,7 @@ npm-init:
npm-update: npm-update:
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 # Building
build-js: build-js:

View File

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

View File

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

View File

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