mirror of https://github.com/PCSX2/pcsx2.git
Misc: Remove linux_various subdirectory
Again, nothing in here has been used in a long time.
This commit is contained in:
parent
c911738b5c
commit
9d23da226f
|
@ -1,15 +0,0 @@
|
|||
[Desktop Entry]
|
||||
Version=1.0
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Name=PCSX2
|
||||
StartupWMClass=PCSX2
|
||||
GenericName=PlayStation 2 Emulator
|
||||
GenericName[zh_CN]=PlayStation 2 模拟器
|
||||
Comment=Sony PlayStation 2 emulator
|
||||
Comment[ru]=Эмулятор Sony PlayStation 2
|
||||
Comment[zh_CN]=索尼 PlayStation 2 模拟器
|
||||
Exec=env GDK_BACKEND=x11 MESA_NO_ERROR=1 pcsx2
|
||||
Icon=PCSX2
|
||||
Keywords=game;emulator;
|
||||
Categories=@PCSX2_MENU_CATEGORIES@
|
File diff suppressed because it is too large
Load Diff
|
@ -1,69 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
set -x
|
||||
# -e => need to handle empty $files variable
|
||||
|
||||
ret=0
|
||||
|
||||
if command -v clang-format-3.8 > /dev/null ; then
|
||||
clang_format=clang-format-3.8
|
||||
else
|
||||
if command -v clang-format > /dev/null ; then
|
||||
clang_format=clang-format
|
||||
else
|
||||
return 2;
|
||||
fi
|
||||
fi
|
||||
|
||||
$clang_format -version
|
||||
|
||||
# Doesn't work as travis only populate a single branch history
|
||||
|
||||
#branch=`git rev-parse --abbrev-ref HEAD`
|
||||
#if [ x$branch = "xmaster" ]
|
||||
#then
|
||||
# # check the last 20 commits. It ought to be enough even for big push
|
||||
# diff_range=HEAD~20
|
||||
#else
|
||||
# # check filed updated in the branch
|
||||
# diff_range=master...HEAD
|
||||
#fi
|
||||
|
||||
# Get the number of commits that share a linear history with the HEAD. Limit the value to 20
|
||||
# Solution isn't perfect but it ough to be close enough of the current branch size
|
||||
#
|
||||
# Picking more commits might hurt during the conversion. When everything will be ready, we
|
||||
# could get back to 20
|
||||
br_commit=`git log --oneline --decorate --graph -n 20 | grep "^\* [[:alnum:]]" -c`
|
||||
if [ $br_commit -lt 1 ]; then
|
||||
# Something got wrong
|
||||
diff_range=HEAD~20
|
||||
else
|
||||
diff_range=HEAD~$br_commit
|
||||
fi
|
||||
|
||||
# get updates and blacklist directories that don't use yet the clang-format syntax
|
||||
files=`git diff --name-only --diff-filter=ACMRT $diff_range -- $PWD | \
|
||||
grep "\.\(c\|h\|inl\|cpp\|hpp\)$" | \
|
||||
grep -v "${1}pcsx2/" | \
|
||||
\
|
||||
grep -v "/resource.h" | \
|
||||
grep -v "3rdparty/" | \
|
||||
grep -v "bin/" | \
|
||||
grep -v "cmake/" | \
|
||||
grep -v "tools/" | \
|
||||
grep -v "tests/"
|
||||
`
|
||||
|
||||
# Check remaining files are clang-format compliant
|
||||
for f in $files
|
||||
do
|
||||
$clang_format -style=file -output-replacements-xml $f | grep "<replacement " >/dev/null
|
||||
if [ $? -ne 1 ]
|
||||
then
|
||||
echo "file $f did not match clang-format"
|
||||
ret=1;
|
||||
fi
|
||||
done
|
||||
|
||||
exit $ret;
|
|
@ -1,101 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
# git pre-commit hook that runs an clang-format stylecheck.
|
||||
# Features:
|
||||
# - abort commit when commit does not comply with the style guidelines
|
||||
# - create a patch of the proposed style changes
|
||||
|
||||
# modifications for clang-format by rene.milk@wwu.de
|
||||
# This file is part of a set of unofficial pre-commit hooks available
|
||||
# at GitHub.
|
||||
# Link: https://github.com/githubbrowser/Pre-commit-hooks
|
||||
# Contact: David Martin, david.martin.mailbox@googlemail.com
|
||||
|
||||
|
||||
##################################################################
|
||||
# SETTINGS
|
||||
# set path to clang-format binary
|
||||
CLANG_FORMAT="/usr/bin/clang-format"
|
||||
|
||||
# remove any older patches from previous commits. Set to true or false.
|
||||
DELETE_OLD_PATCHES=false
|
||||
|
||||
# only parse files with the extensions in FILE_EXTS. Set to true or false.
|
||||
# if false every changed file in the commit will be parsed with clang-format.
|
||||
# if true only files matching one of the extensions are parsed with clang-format.
|
||||
PARSE_EXTS=true
|
||||
|
||||
# file types to parse. Only effective when PARSE_EXTS is true.
|
||||
FILE_EXTS=".c .h .cpp .hpp .inl"
|
||||
|
||||
ALLOWED_ROOT_DIR="./common"
|
||||
|
||||
##################################################################
|
||||
# There should be no need to change anything below this line.
|
||||
|
||||
# exit on error
|
||||
set -e
|
||||
|
||||
# check whether the given file matches any of the set extensions
|
||||
matches_extension() {
|
||||
local filename=$(basename "$1")
|
||||
local extension=".${filename##*.}"
|
||||
local ext
|
||||
|
||||
for ext in $FILE_EXTS; do [[ "$ext" == "$extension" ]] && return 0; done
|
||||
|
||||
return 1
|
||||
}
|
||||
|
||||
if [ ! -x "$CLANG_FORMAT" ] ; then
|
||||
printf "Error: clang-format executable ($CLANG_FORMAT) not found.\n"
|
||||
printf "Set the correct path in $0.\n"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# create a random filename to store our generated patch
|
||||
prefix="pre-commit-clang-format"
|
||||
suffix="$(date +%s)"
|
||||
patch="/tmp/$prefix-${suffix}.patch"
|
||||
|
||||
# clean up any older clang-format patches
|
||||
$DELETE_OLD_PATCHES && rm -f /tmp/$prefix*.patch
|
||||
|
||||
# create one patch containing all changes to the files
|
||||
git diff-index --cached --diff-filter=ACMR --name-only HEAD -- $ALLOWED_ROOT_DIR | while read file;
|
||||
do
|
||||
# ignore file if we do check for file extensions and the file
|
||||
# does not match any of the extensions specified in $FILE_EXTS
|
||||
if $PARSE_EXTS && ! matches_extension "$file"; then
|
||||
continue;
|
||||
fi
|
||||
|
||||
# clang-format our sourcefile, create a patch with diff and append it to our $patch
|
||||
# The sed call is necessary to transform the patch from
|
||||
# --- $file timestamp
|
||||
# +++ - timestamp
|
||||
# to both lines working on the same file and having a a/ and b/ prefix.
|
||||
# Else it can not be applied with 'git apply'.
|
||||
"$CLANG_FORMAT" -style=file "$file" | \
|
||||
diff -u "$file" - | \
|
||||
sed -e "1s|--- |--- a/|" -e "2s|+++ -|+++ b/$file|" >> "$patch"
|
||||
done
|
||||
|
||||
# if no patch has been generated all is ok, clean up the file stub and exit
|
||||
if [ ! -s "$patch" ] ; then
|
||||
printf "Files in this commit comply with the clang-format rules.\n"
|
||||
rm -f "$patch"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# a patch has been created, notify the user and exit
|
||||
printf "\nThe following differences were found between the code to commit "
|
||||
printf "and the clang-format rules:\n\n"
|
||||
cat "$patch"
|
||||
|
||||
printf "\nYou can apply these changes with:\n git apply $patch\n"
|
||||
printf "(may need to be called from the root directory of your repository)\n"
|
||||
printf "Aborting commit. Apply changes and commit again or skip checking with"
|
||||
printf " --no-verify (not recommended).\n"
|
||||
|
||||
exit 1
|
Loading…
Reference in New Issue