Debian Codegraph @

project/bundles/homebrew/tools/update-models.sh

raw
1 #! /bin/bash
2
3 # Script to bundle data using previously-built digiKam installation.
4 # and create a PKG file with Packages application (http://s.sudre.free.fr/Software/Packages/about.html)
5 # This script must be run as sudo
6 #
7 # SPDX-FileCopyrightText: 2015 by Shanti, <listaccount at revenant dot org>
8 # SPDX-FileCopyrightText: 2015-2026 by Gilles Caulier <caulier dot gilles at gmail dot com>
9 # SPDX-FileCopyrightText: 2024 by Michael Miller, <michael underscore miller at msn dot com>
10 #
11 # SPDX-License-Identifier: BSD-3-Clause
12 #
13 # This script is used to move binaries from a local build directory (I use temp.digikam) to the bundle
14 # directory for testing. This can be run only after steps 01-04 have been completed.
15 #
16
17 # Ask to run as root
18 (( EUID != 0 )) && exec sudo -- "$0" "$@"
19
20 # Halt and catch errors
21 set -eE
22 trap 'PREVIOUS_COMMAND=$THIS_COMMAND; THIS_COMMAND=$BASH_COMMAND' DEBUG
23 trap 'echo "FAILED COMMAND: $PREVIOUS_COMMAND"' ERR
24
25 ORIG_WD="`pwd`"
26
27 cd ..
28 . ./config.sh
29 . ./common.sh
30
31 StartScript
32
33 # Directory where this script is located (default - current directory)
34 BUILDDIR="$PWD"
35
36 # Directory where Packages project files are located
37 PROJECTDIR="$BUILDDIR/installer"
38
39 # Staging area where files to be packaged will be copied
40 TEMPROOT="$BUILDDIR/$RELOCATE_PREFIX"
41
42 DK_APP_CONTENTS="digikam.app/Contents"
43
44 # local binary directory
45 LOCAL_BINS="temp.digikam"
46
47 cp $PWD/../../../core/data//dnnmodels/dnnmodels.conf $TEMPROOT/$DK_APP_CONTENTS/Resources/digikam/dnnmodels
48 cp $PWD/../../../core/data//dnnmodels/dnnmodels.conf "$HOME/Library/Application Support/digikam/dnnmodels/"
49
50 TerminateScript
51
52 cd "$ORIG_WD"
53
54 date