From 02f1b503f4822f4738584cf712da078cce47d3bd Mon Sep 17 00:00:00 2001 From: Tomas Chvatal Date: Thu, 12 Mar 2009 13:43:22 +0100 Subject: Cleanup in root folder --- CMakeLists.txt | 2 +- clean.sh | 29 ----------------------------- cmake/cmake_uninstall.cmake.in | 21 +++++++++++++++++++++ cmake_uninstall.cmake.in | 21 --------------------- generate_gettext_pot.sh | 4 ---- kr.sh | 12 ------------ scripts/clean.sh | 29 +++++++++++++++++++++++++++++ scripts/generate_gettext_pot.sh | 6 ++++++ scripts/kr.sh | 12 ++++++++++++ 9 files changed, 69 insertions(+), 67 deletions(-) delete mode 100755 clean.sh create mode 100644 cmake/cmake_uninstall.cmake.in delete mode 100644 cmake_uninstall.cmake.in delete mode 100755 generate_gettext_pot.sh delete mode 100755 kr.sh create mode 100755 scripts/clean.sh create mode 100755 scripts/generate_gettext_pot.sh create mode 100755 scripts/kr.sh diff --git a/CMakeLists.txt b/CMakeLists.txt index 7cfc546..10005e3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -71,7 +71,7 @@ SET ( CMAKE_INSTALL_LIBDIR ${LIB_INSTALL_DIR} ) SET ( CMAKE_INSTALL_DOCDIR ${CMAKE_DOC_PATH} ) # uninstall CONFIGURE_FILE ( - "${CMAKE_CURRENT_SOURCE_DIR}/cmake_uninstall.cmake.in" + "${CMAKE_CURRENT_SOURCE_DIR}/cmake/cmake_uninstall.cmake.in" "${CMAKE_CURRENT_BINARY_DIR}/cmake_uninstall.cmake" IMMEDIATE @ONLY ) ADD_CUSTOM_TARGET ( uninstall "${CMAKE_COMMAND}" diff --git a/clean.sh b/clean.sh deleted file mode 100755 index 2fa707b..0000000 --- a/clean.sh +++ /dev/null @@ -1,29 +0,0 @@ -#!/usr/bin/env bash - -# remove compiled files -[ -e "[Mm]akefile" ] && make clean - -# remove folders -find ./ -type d -name CMakeFiles -print | xargs -i rm {} -rf -# some people build Tuxanci in speacial folder -rm -rf ./build - -# remove cmake files -find ./ \( -type f -name \*.so -print , -type f -name \*.cmake -print , -type f -name CMakeCache.txt -print , -type f -name Makefile -print \) | grep -v "./cmake" | xargs -i rm {} -f -find ./ \( -type f -name install_manifest.txt -print , -type f -name cmake_install.cmake -print \) | xargs -i rm {} -f - -# remove precompiled in files -find ./ -name \*.in -print | while read r; do rm -f ${r/\.in/}; done - -# remove compiled binaries -find src -name tuxanci -print | xargs -i rm {} -f -find src -name tuxanci-server -print | xargs -i rm {} -f - -# remove compiled gettext files -find ./ -name \*.gmo -print | xargs -i rm {} -f - -# remove temporary backup files -find ./ -type f -name \*~ -print | xargs -i rm {} -f - -# remove so libraries -find ./src/modules -type f -name mod\*.so\* | xargs -i rm {} -f diff --git a/cmake/cmake_uninstall.cmake.in b/cmake/cmake_uninstall.cmake.in new file mode 100644 index 0000000..cd4c9d8 --- /dev/null +++ b/cmake/cmake_uninstall.cmake.in @@ -0,0 +1,21 @@ +IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") +ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") + +FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) +STRING(REGEX REPLACE "\n" ";" files "${files}") +FOREACH(file ${files}) + MESSAGE(STATUS "Uninstalling: \"$ENV{DESTDIR}${file}\"") + IF(EXISTS "$ENV{DESTDIR}${file}") + EXEC_PROGRAM( + "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" + OUTPUT_VARIABLE rm_out + RETURN_VALUE rm_retval + ) + IF(NOT "${rm_retval}" STREQUAL 0) + MESSAGE(FATAL_ERROR "Problem when removing: \"$ENV{DESTDIR}${file}\"") + ENDIF(NOT "${rm_retval}" STREQUAL 0) + ELSE(EXISTS "$ENV{DESTDIR}${file}") + MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") + ENDIF(EXISTS "$ENV{DESTDIR}${file}") +ENDFOREACH(file) diff --git a/cmake_uninstall.cmake.in b/cmake_uninstall.cmake.in deleted file mode 100644 index cd4c9d8..0000000 --- a/cmake_uninstall.cmake.in +++ /dev/null @@ -1,21 +0,0 @@ -IF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - MESSAGE(FATAL_ERROR "Cannot find install manifest: \"@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt\"") -ENDIF(NOT EXISTS "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt") - -FILE(READ "@CMAKE_CURRENT_BINARY_DIR@/install_manifest.txt" files) -STRING(REGEX REPLACE "\n" ";" files "${files}") -FOREACH(file ${files}) - MESSAGE(STATUS "Uninstalling: \"$ENV{DESTDIR}${file}\"") - IF(EXISTS "$ENV{DESTDIR}${file}") - EXEC_PROGRAM( - "@CMAKE_COMMAND@" ARGS "-E remove \"$ENV{DESTDIR}${file}\"" - OUTPUT_VARIABLE rm_out - RETURN_VALUE rm_retval - ) - IF(NOT "${rm_retval}" STREQUAL 0) - MESSAGE(FATAL_ERROR "Problem when removing: \"$ENV{DESTDIR}${file}\"") - ENDIF(NOT "${rm_retval}" STREQUAL 0) - ELSE(EXISTS "$ENV{DESTDIR}${file}") - MESSAGE(STATUS "File \"$ENV{DESTDIR}${file}\" does not exist.") - ENDIF(EXISTS "$ENV{DESTDIR}${file}") -ENDFOREACH(file) diff --git a/generate_gettext_pot.sh b/generate_gettext_pot.sh deleted file mode 100755 index 60d750c..0000000 --- a/generate_gettext_pot.sh +++ /dev/null @@ -1,4 +0,0 @@ -#!/bin/bash -xgettext --default-domain=tuxanci --add-comments=/// -k_ `find ./ -name \*.c | grep -v .git | tr '\n' ' '` -o ./po/tuxanci.pot -cd po/ -find ./ -name \*.po -print | xargs -i msgmerge -U {} tuxanci.pot diff --git a/kr.sh b/kr.sh deleted file mode 100755 index dbc1842..0000000 --- a/kr.sh +++ /dev/null @@ -1,12 +0,0 @@ -#!/bin/sh - -if [ ! "$1" ]; then - echo "Help: this script indents code according to the K&R standard" - echo "Usage: $0 path/to/file.c" - exit 1 -elif [ ! -e "$1" ]; then - echo "Error: file '$1' doesn't exist!" - exit 1 -fi - -indent -kr -l79 -ts4 -ip4 -ppi 4 "$1" diff --git a/scripts/clean.sh b/scripts/clean.sh new file mode 100755 index 0000000..6304b57 --- /dev/null +++ b/scripts/clean.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash + +# remove compiled files +[ -e "[Mm]akefile" ] && make clean + +# remove folders +find ../ -type d -name CMakeFiles -print | xargs -i rm {} -rf +# some people build Tuxanci in speacial folder +rm -rf ../build + +# remove cmake files +find ../ \( -type f -name \*.so -print , -type f -name \*.cmake -print , -type f -name CMakeCache.txt -print , -type f -name Makefile -print \) | grep -v "./cmake" | xargs -i rm {} -f +find ../ \( -type f -name install_manifest.txt -print , -type f -name cmake_install.cmake -print \) | xargs -i rm {} -f + +# remove precompiled in files +find ../ -name \*.in -print | while read r; do rm -f ${r/\.in/}; done + +# remove compiled binaries +find ../src -name tuxanci -print | xargs -i rm {} -f +find ../src -name tuxanci-server -print | xargs -i rm {} -f + +# remove compiled gettext files +find ../ -name \*.gmo -print | xargs -i rm {} -f + +# remove temporary backup files +find ../ -type f -name \*~ -print | xargs -i rm {} -f + +# remove so libraries +find ../src/modules -type f -name mod\*.so\* | xargs -i rm {} -f diff --git a/scripts/generate_gettext_pot.sh b/scripts/generate_gettext_pot.sh new file mode 100755 index 0000000..8a0ffb8 --- /dev/null +++ b/scripts/generate_gettext_pot.sh @@ -0,0 +1,6 @@ +#!/bin/bash +pushd ../ > /dev/null +xgettext --default-domain=tuxanci --add-comments=/// -k_ `find ./ -name \*.c | grep -v .git | tr '\n' ' '` -o ./po/tuxanci.pot +cd po/ +find ./ -name \*.po -print | xargs -i msgmerge -U {} tuxanci.pot +popd > /dev/null diff --git a/scripts/kr.sh b/scripts/kr.sh new file mode 100755 index 0000000..dbc1842 --- /dev/null +++ b/scripts/kr.sh @@ -0,0 +1,12 @@ +#!/bin/sh + +if [ ! "$1" ]; then + echo "Help: this script indents code according to the K&R standard" + echo "Usage: $0 path/to/file.c" + exit 1 +elif [ ! -e "$1" ]; then + echo "Error: file '$1' doesn't exist!" + exit 1 +fi + +indent -kr -l79 -ts4 -ip4 -ppi 4 "$1" -- cgit v1.2.3