Skip to content

Commit

Permalink
refactor: rename exiftool-bin to bin-ext
Browse files Browse the repository at this point in the history
Signed-off-by: Varun Patil <radialapps@gmail.com>
  • Loading branch information
pulsejet committed Oct 20, 2023
1 parent eb1e224 commit fd851b5
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 15 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,4 @@ memories.tar.gz
/playwright/.cache/
.cache/

exiftool-bin/
bin-ext/
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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/).
Expand Down
8 changes: 4 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -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:
Expand Down
8 changes: 4 additions & 4 deletions lib/Service/BinExt.php
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public static function getExiftoolPBin(): string
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()];
Expand All @@ -129,7 +129,7 @@ public static function getExiftool(): array
*/
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;
}

Expand All @@ -144,7 +144,7 @@ public static function detectExiftool(): false|string
// 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)) {
Expand Down Expand Up @@ -377,7 +377,7 @@ public static function detectGoVod(): false|string
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) {
Expand Down
6 changes: 3 additions & 3 deletions scripts/bundle.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/bin/bash

od=`pwd`
src=`pwd`

rm -rf /tmp/memories
mkdir -p /tmp/memories
Expand All @@ -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 .
6 changes: 3 additions & 3 deletions scripts/get-exiftool.sh → scripts/get-bin-ext.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down

0 comments on commit fd851b5

Please sign in to comment.