mirror of
https://github.com/keepassxreboot/keepassxc.git
synced 2024-10-01 01:26:01 -04:00
Minor documentation and script cleanups (#6868)
* Remove mention of no longer used IRC network Channels exist on matrix, and on libera.chat now. * Correctly match only files with .png extension The current search would match files such as 'createpng'. * Fix comparison in script The result was always false, due to comparing a literal string instead of a variable. * Use correct license files from upstream Correct license files obtained from: https://www.gnu.org/licenses/old-licenses/gpl-2.0.txt https://www.gnu.org/licenses/gpl-3.0.txt https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt https://www.gnu.org/licenses/lgpl-3.0.txt * Refresh several shell scripts This fixes several shellcheck warnings, as well as makes the code more robust and have consistent codestyle between all the files. * Trim excess whitespace
This commit is contained in:
parent
9aec84dee7
commit
e3c7b570ae
@ -85,4 +85,3 @@ Standard: Cpp11
|
||||
TabWidth: 4
|
||||
UseTab: Never
|
||||
...
|
||||
|
||||
|
2
.github/CONTRIBUTING.md
vendored
2
.github/CONTRIBUTING.md
vendored
@ -63,7 +63,7 @@ Before submitting a bug report, check if the problem has already been reported.
|
||||
|
||||
### Discuss with the team
|
||||
|
||||
As with feature requests, you can talk to the KeePassXC team about bugs, new features, other issues and pull requests on the dedicated issue tracker, or in the IRC channel on Freenode (`#keepassxc-dev` on `irc.freenode.net`, or use a [webchat link](https://webchat.freenode.net/?channels=%23keepassxc-dev)).
|
||||
As with feature requests, you can talk to the KeePassXC team about bugs, new features, other issues and pull requests on the dedicated issue tracker, on the [Matrix development channel](https://matrix.to/#/!RhJPJPGwQIFVQeXqZa:matrix.org?via=matrix.org), or in the IRC channel on Libera.Chat (`#keepassxc-dev` on `irc.libera.chat`, or use a [webchat link](https://web.libera.chat/#keepassxc-dev)).
|
||||
|
||||
### Your first code contribution
|
||||
|
||||
|
@ -1,8 +1,7 @@
|
||||
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
@ -646,7 +645,7 @@ the "copyright" line and a pointer to where the full notice is found.
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
@ -665,12 +664,11 @@ might be different; for a GUI interface, you would use an "about box".
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
<https://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
||||
|
||||
<https://www.gnu.org/licenses/why-not-lgpl.html>.
|
||||
|
@ -55,7 +55,7 @@ modified by someone else and passed on, the recipients should know
|
||||
that what they have is not the original version, so that the original
|
||||
author's reputation will not be affected by problems that might be
|
||||
introduced by others.
|
||||
|
||||
|
||||
Finally, software patents pose a constant threat to the existence of
|
||||
any free program. We wish to make sure that a company cannot
|
||||
effectively restrict the users of a free program by obtaining a
|
||||
@ -111,7 +111,7 @@ modification follow. Pay close attention to the difference between a
|
||||
"work based on the library" and a "work that uses the library". The
|
||||
former contains code derived from the library, whereas the latter must
|
||||
be combined with the library in order to run.
|
||||
|
||||
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
|
||||
|
||||
@ -158,7 +158,7 @@ Library.
|
||||
You may charge a fee for the physical act of transferring a copy,
|
||||
and you may at your option offer warranty protection in exchange for a
|
||||
fee.
|
||||
|
||||
|
||||
2. You may modify your copy or copies of the Library or any portion
|
||||
of it, thus forming a work based on the Library, and copy and
|
||||
distribute such modifications or work under the terms of Section 1
|
||||
@ -216,7 +216,7 @@ instead of to this License. (If a newer version than version 2 of the
|
||||
ordinary GNU General Public License has appeared, then you can specify
|
||||
that version instead if you wish.) Do not make any other change in
|
||||
these notices.
|
||||
|
||||
|
||||
Once this change is made in a given copy, it is irreversible for
|
||||
that copy, so the ordinary GNU General Public License applies to all
|
||||
subsequent copies and derivative works made from that copy.
|
||||
@ -267,7 +267,7 @@ Library will still fall under Section 6.)
|
||||
distribute the object code for the work under the terms of Section 6.
|
||||
Any executables containing that work also fall under Section 6,
|
||||
whether or not they are linked directly with the Library itself.
|
||||
|
||||
|
||||
6. As an exception to the Sections above, you may also combine or
|
||||
link a "work that uses the Library" with the Library to produce a
|
||||
work containing portions of the Library, and distribute that work
|
||||
@ -329,7 +329,7 @@ restrictions of other proprietary libraries that do not normally
|
||||
accompany the operating system. Such a contradiction means you cannot
|
||||
use both them and the Library together in an executable that you
|
||||
distribute.
|
||||
|
||||
|
||||
7. You may place library facilities that are a work based on the
|
||||
Library side-by-side in a single library together with other library
|
||||
facilities not covered by this License, and distribute such a combined
|
||||
@ -370,7 +370,7 @@ subject to these terms and conditions. You may not impose any further
|
||||
restrictions on the recipients' exercise of the rights granted herein.
|
||||
You are not responsible for enforcing compliance by third parties with
|
||||
this License.
|
||||
|
||||
|
||||
11. If, as a consequence of a court judgment or allegation of patent
|
||||
infringement or for any other reason (not limited to patent issues),
|
||||
conditions are imposed on you (whether by court order, agreement or
|
||||
@ -422,7 +422,7 @@ conditions either of that version or of any later version published by
|
||||
the Free Software Foundation. If the Library does not specify a
|
||||
license version number, you may choose any version ever published by
|
||||
the Free Software Foundation.
|
||||
|
||||
|
||||
14. If you wish to incorporate parts of the Library into other free
|
||||
programs whose distribution conditions are incompatible with these,
|
||||
write to the author to ask for permission. For software which is
|
||||
@ -456,7 +456,7 @@ SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
|
||||
DAMAGES.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
|
||||
How to Apply These Terms to Your New Libraries
|
||||
|
||||
If you develop a new library, and you want it to be of the greatest
|
||||
|
@ -1,7 +1,7 @@
|
||||
GNU LESSER GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
|
@ -48,7 +48,7 @@ Detailed instructions are available in the [Build and Install](./INSTALL.md) pag
|
||||
|
||||
## Contributing
|
||||
|
||||
We are always looking for suggestions on how to improve KeePassXC. If you find any bugs or have an idea for a new feature, please let us know by opening a report in the [issue tracker](https://github.com/keepassxreboot/keepassxc/issues) on GitHub or join us on IRC in [freenode](https://webchat.freenode.net/) channels #keepassxc and #keepassxc-dev.
|
||||
We are always looking for suggestions on how to improve KeePassXC. If you find any bugs or have an idea for a new feature, please let us know by opening a report in the [issue tracker](https://github.com/keepassxreboot/keepassxc/issues) on GitHub, or join us on [Matrix community channel](https://matrix.to/#/!zUxwGnFkUyycpxeHeM:matrix.org?via=matrix.org) or [Matrix development channel](https://matrix.to/#/!RhJPJPGwQIFVQeXqZa:matrix.org?via=matrix.org), or on IRC in [Libera.Chat](https://web.libera.chat/) channels #keepassxc and #keepassxc-dev.
|
||||
|
||||
You may directly contribute your own code by submitting a pull request. Please read the [CONTRIBUTING](.github/CONTRIBUTING.md) document for further information.
|
||||
|
||||
|
@ -47,4 +47,3 @@ mark_as_advanced(
|
||||
Readline_INCLUDE_DIR
|
||||
Readline_LIBRARY
|
||||
)
|
||||
|
||||
|
@ -62,7 +62,7 @@ printUsage() {
|
||||
cmd="COMMAND"
|
||||
fi
|
||||
|
||||
printf "\e[1mUsage:\e[0m $(basename $0) $cmd [options]\n"
|
||||
printf "\e[1mUsage:\e[0m $(basename "$0") $cmd [options]\n"
|
||||
|
||||
if [ "COMMAND" == "$cmd" ]; then
|
||||
cat << EOF
|
||||
|
@ -18,4 +18,4 @@ minify -o icons/database --match=.svg icons/database
|
||||
|
||||
# Crush PNG's
|
||||
echo "Crushing PNG's..."
|
||||
find "." -iname '*png' -exec pngcrush -ow -brute {} \;
|
||||
find . -iname '*.png' -exec pngcrush -ow -brute {} \;
|
||||
|
@ -16,23 +16,23 @@
|
||||
# along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
BASEDIR="$(dirname $0)"
|
||||
BASEDIR=$(dirname "$0")
|
||||
|
||||
PUSH=true
|
||||
PULL=true
|
||||
UPDATE=true
|
||||
|
||||
if [ "$1" == "push" ]; then
|
||||
if [[ $1 == "push" ]]; then
|
||||
PULL=false
|
||||
elif [ "$1" == "pull" ]; then
|
||||
elif [[ $1 == "pull" ]]; then
|
||||
PUSH=false
|
||||
UPDATE=false
|
||||
elif [ "$1" == "update" ]; then
|
||||
elif [[ $1 == "update" ]]; then
|
||||
PUSH=false
|
||||
PULL=false
|
||||
elif [ "$1" != "" ]; then
|
||||
elif [[ $1 != "" ]]; then
|
||||
echo "Unknown command '${1}'"
|
||||
echo "Usage: $(basename $0) [update|pull|push] [additional tx options]"
|
||||
echo "Usage: $(basename "$0") [update|pull|push] [additional tx options]"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
@ -45,7 +45,7 @@ if $UPDATE; then
|
||||
|
||||
LUPDATE=lupdate-qt5
|
||||
command -v $LUPDATE > /dev/null
|
||||
if [ $? -ne 0 ]; then
|
||||
if [[ $? -ne 0 ]]; then
|
||||
LUPDATE=lupdate
|
||||
fi
|
||||
$LUPDATE -no-ui-lines -disable-heuristic similartext -locations none -no-obsolete src -ts share/translations/keepassx_en.ts
|
||||
|
@ -4,28 +4,28 @@ NC='\033[0m'
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[0;33m'
|
||||
|
||||
if [[ -z "$1" ]]; then
|
||||
if [[ -z $1 ]]; then
|
||||
echo -e "${RED}You must include an SVG file to convert!${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
outfile=$2
|
||||
if [[ -z "outfile" ]]; then
|
||||
if [[ -z $outfile ]]; then
|
||||
outfile="logo.ico"
|
||||
fi
|
||||
|
||||
if ! command -v "inkscape" &> /dev/null; then
|
||||
if ! command -v inkscape &> /dev/null; then
|
||||
echo -e "${YELLOW}Could not find inkscape; $outfile not built!${NC}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
echo "Generating $outfile from $1..."
|
||||
size_list=(16 24 32 48 64 128 256)
|
||||
for size in ${size_list[@]}; do
|
||||
for size in "${size_list[@]}"; do
|
||||
inkscape -z -e $size.png -w $size -h $size "$1" >/dev/null 2>/dev/null
|
||||
done
|
||||
|
||||
images=`printf "%s.png " "${size_list[@]}"`
|
||||
images=$(printf "%s.png " "${size_list[@]}")
|
||||
convert $images $outfile
|
||||
|
||||
rm $images
|
||||
|
@ -8,4 +8,3 @@ apps:
|
||||
_app_name_:
|
||||
command: foo-launch bar-launch _app_command_
|
||||
```
|
||||
|
||||
|
@ -4,10 +4,10 @@
|
||||
### change the path to suit your installation or set KDBX_SEARCH before calling ###
|
||||
: ${KDBX_SEARCH:=~/.KeePass/*.kdbx}
|
||||
|
||||
PROG="${0##*/}"
|
||||
PROG=${0##*/}
|
||||
KEEPASSXC=$(which -a keepassxc | sed -e "\\,$0,d" -e 'q')
|
||||
|
||||
function daemon_main {
|
||||
daemon_main() {
|
||||
# open kdewallet
|
||||
handle=$(qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.open kdewallet 0 "$PROG")
|
||||
while [[ true != $(qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.isOpen kdewallet) ]]; do
|
||||
@ -27,7 +27,7 @@ function daemon_main {
|
||||
qdbus org.kde.kwalletd5 /modules/kwalletd5 org.kde.KWallet.close "$handle" "false" "$PROG"
|
||||
}
|
||||
|
||||
if [[ '-d' = "$1" ]]; then
|
||||
if [[ $1 == '-d' ]]; then
|
||||
exec >&~/tmp/$PROG.log
|
||||
set -vx
|
||||
daemon_main
|
||||
|
@ -4,10 +4,10 @@
|
||||
### change the path to suit your installation or set KDBX_SEARCH before calling ###
|
||||
: ${KDBX_SEARCH:=~/.KeePass/*.kdbx}
|
||||
|
||||
PROG="$(basename $0)"
|
||||
PROG=$(basename "$0")
|
||||
KeePassXC=$(ls -f {/usr/local,/Applications}/KeePassXC.app/Contents/MacOS/KeePassXC 2>/dev/null | head -1)
|
||||
|
||||
function daemon_main {
|
||||
daemon_main() {
|
||||
declare -A DBs
|
||||
for DBPATH in $KDBX_SEARCH; do
|
||||
DBs[$(python -c "import os; print os.path.realpath('$DBPATH')")]=$(security find-generic-password -a $USER -s "${DBPATH##*/}" -w)
|
||||
@ -18,7 +18,7 @@ function daemon_main {
|
||||
$KeePassXC --pw-stdin "${!DBs[@]}" <<<"${DBs[*]}" &
|
||||
}
|
||||
|
||||
if [[ '-d' = "$1" ]]; then
|
||||
if [[ $1 == '-d' ]]; then
|
||||
exec >&~/tmp/$PROG.log
|
||||
set -vx
|
||||
daemon_main
|
||||
|
@ -118,9 +118,9 @@ BROWSER=$(whiptail \
|
||||
clear
|
||||
|
||||
exitstatus=$?
|
||||
if [ $exitstatus = 0 ]; then
|
||||
if [[ $exitstatus == 0 ]]; then
|
||||
# Configure settings for the chosen browser
|
||||
case "$BROWSER" in
|
||||
case $BROWSER in
|
||||
1) setupFirefox ;;
|
||||
2) setupChrome ;;
|
||||
3) setupChromium ;;
|
||||
@ -132,7 +132,7 @@ if [ $exitstatus = 0 ]; then
|
||||
# Install the JSON file
|
||||
cd ~
|
||||
mkdir -p "$INSTALL_DIR"
|
||||
echo "$JSON_OUT" > ${INSTALL_DIR}/${INSTALL_FILE}
|
||||
echo "$JSON_OUT" > "${INSTALL_DIR}/${INSTALL_FILE}"
|
||||
|
||||
whiptail \
|
||||
--title "Installation Complete" \
|
||||
|
@ -42,22 +42,22 @@ NC='\033[0m'
|
||||
RED='\033[0;31m'
|
||||
YELLOW='\033[0;33m'
|
||||
|
||||
if [ $# != 1 ];then
|
||||
if [[ $# != 1 ]]; then
|
||||
echo "Usage: $0 MATERIAL"
|
||||
echo "MATERIAL is the directory containing the material icons repository"
|
||||
echo "(git clone https://github.com/Templarian/MaterialDesign.git)".
|
||||
exit
|
||||
fi
|
||||
|
||||
MATERIAL="$1"
|
||||
if [ ! -d "$MATERIAL" ];then
|
||||
MATERIAL=$1
|
||||
if [[ ! -d $MATERIAL ]]; then
|
||||
echo -e "${RED}Material Icons directory does not exist: ${MATERIAL}${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check destination dir
|
||||
DSTDIR=share/icons/application
|
||||
if [ ! -d "$DSTDIR" ];then
|
||||
if [[ ! -d $DSTDIR ]]; then
|
||||
echo -e "${RED}Please invoke this script from the KeePassXC source root directory.${NC}"
|
||||
exit 1
|
||||
fi
|
||||
@ -69,7 +69,7 @@ fi
|
||||
# extension, e. g. "folder-plus") to stdout.
|
||||
# If the icon name is unknown, outputs nothing.
|
||||
map() {
|
||||
case "$1" in
|
||||
case $1 in
|
||||
application-exit) echo exit-run ;;
|
||||
auto-type) echo keyboard-variant ;;
|
||||
bugreport) echo bug-outline ;;
|
||||
@ -148,13 +148,13 @@ map() {
|
||||
}
|
||||
|
||||
# Now do the actual work
|
||||
find $DSTDIR -type f -name "*.svg" | while read -r DST;do
|
||||
find "$DSTDIR" -type f -name "*.svg" | while read -r DST; do
|
||||
|
||||
# Find the icon name (base name without extender)
|
||||
NAME=$(basename $DST .svg)
|
||||
NAME=$(basename "$DST" .svg)
|
||||
|
||||
# Find the base name of the svg file for this icon
|
||||
MAT=$(map $NAME)
|
||||
MAT=$(map "$NAME")
|
||||
if [[ -z $MAT ]]; then
|
||||
echo -e "${YELLOW}Warning: No MaterialDesign mapping for ${NAME}${NC}"
|
||||
continue
|
||||
@ -162,13 +162,13 @@ find $DSTDIR -type f -name "*.svg" | while read -r DST;do
|
||||
|
||||
# So the source file is:
|
||||
SRC="$MATERIAL/svg/$MAT.svg"
|
||||
if [ ! -f "$SRC" ];then
|
||||
if [[ ! -f $SRC ]]; then
|
||||
echo -e "${RED}Error: Source for ${NAME} doesn't exist: ${SRC}${NC}"
|
||||
continue
|
||||
fi
|
||||
|
||||
# Replace the icon file with the source file
|
||||
cp "$SRC" "$DST" || exit
|
||||
cp -- "$SRC" "$DST" || exit
|
||||
echo "Copied icon for ${NAME}"
|
||||
|
||||
done
|
||||
|
@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/env bash
|
||||
# Assemble database icons from the icons8 collection
|
||||
# by Wolfram Rösler 2020-04-30
|
||||
|
||||
@ -15,15 +15,15 @@ if [[ $# != 1 ]];then
|
||||
fi
|
||||
|
||||
# Check source directory
|
||||
SRCDIR="$1"
|
||||
if [ ! -d "$SRCDIR" ];then
|
||||
SRCDIR=$1
|
||||
if [[ ! -d $SRCDIR ]]; then
|
||||
echo -e "${RED}icons8 directory doesn't exist: ${SRCDIR}${NC}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check destination directory
|
||||
DSTDIR=share/icons/database
|
||||
if [ ! -d "$DSTDIR" ];then
|
||||
if [[ ! -d $DSTDIR ]]; then
|
||||
echo -e "${RED}Please invoke this script from the KeePassXC source root directory.${NC}"
|
||||
exit 1
|
||||
fi
|
||||
@ -39,7 +39,7 @@ fi
|
||||
copy() {
|
||||
# The source file is:
|
||||
SRC="${SRCDIR}/svg/${1}.svg"
|
||||
if [ ! -f "$SRC" ];then
|
||||
if [[ ! -f $SRC ]]; then
|
||||
echo -e "${RED}Cannot find source icon for ${2} (${SRC})${NC}"
|
||||
return
|
||||
fi
|
||||
@ -47,7 +47,7 @@ copy() {
|
||||
# Copy the source file to the destination, keeping
|
||||
# the source file's extension
|
||||
DST="$DSTDIR/${2}.svg"
|
||||
cp $SRC $DST
|
||||
cp -- "$SRC" "$DST"
|
||||
echo "Copied icon for ${1} to ${DST}"
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user