From 7a7c7572ea16950f65ecf753339f1d4f0329cf79 Mon Sep 17 00:00:00 2001 From: Takeshi Nakatani Date: Sun, 7 Sep 2014 15:08:27 +0000 Subject: [PATCH] Cleaned up codes for next packaging. --- Makefile.am | 20 ++++++++++++++++++++ README | 2 ++ doc/Makefile.am | 20 ++++++++++++++++++++ src/Makefile.am | 19 +++++++++++++++++++ src/cache.cpp | 8 ++++++++ src/cache.h | 28 ++++++++++++++++++++++++++++ src/common.h | 28 ++++++++++++++++++++++++++++ src/common_auth.cpp | 9 ++++++++- src/curl.cpp | 9 ++++++++- src/curl.h | 28 ++++++++++++++++++++++++++++ src/fdcache.cpp | 9 ++++++++- src/fdcache.h | 28 ++++++++++++++++++++++++++++ src/gnutls_auth.cpp | 9 ++++++++- src/nss_auth.cpp | 9 ++++++++- src/openssl_auth.cpp | 9 ++++++++- src/s3fs.cpp | 9 ++++++++- src/s3fs.h | 28 ++++++++++++++++++++++++++++ src/s3fs_auth.h | 28 ++++++++++++++++++++++++++++ src/s3fs_util.cpp | 9 ++++++++- src/s3fs_util.h | 28 ++++++++++++++++++++++++++++ src/string_util.cpp | 9 +++++++++ src/string_util.h | 28 ++++++++++++++++++++++++++++ test/Makefile.am | 19 +++++++++++++++++++ 23 files changed, 385 insertions(+), 8 deletions(-) diff --git a/Makefile.am b/Makefile.am index 4b315ec..6f92068 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,3 +1,22 @@ +###################################################################### +# s3fs - FUSE-based file system backed by Amazon S3 +# +# Copyright 2007-2008 Randy Rizun +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +###################################################################### SUBDIRS=src test doc EXTRA_DIST=doc @@ -8,3 +27,4 @@ dist-hook: release : dist ../utils/release.sh ../utils/release.sh $(DIST_ARCHIVES) + diff --git a/README b/README index 013d288..fe8e641 100644 --- a/README +++ b/README @@ -14,6 +14,8 @@ In order to compile s3fs, You'll need the following requirements: * FUSE (>= 2.8.4) * FUSE Kernel module installed and running (RHEL 4.x/CentOS 4.x users - read below) * OpenSSL-devel (0.9.8) + GnuTLS(gcrypt and nettle) + NSS * Git If you're using YUM or APT to install those packages, then it might require additional packaging, allow it to be installed. diff --git a/doc/Makefile.am b/doc/Makefile.am index 5d74873..18e8e1b 100644 --- a/doc/Makefile.am +++ b/doc/Makefile.am @@ -1 +1,21 @@ +###################################################################### +# s3fs - FUSE-based file system backed by Amazon S3 +# +# Copyright 2007-2008 Randy Rizun +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +###################################################################### dist_man1_MANS = man/s3fs.1 + diff --git a/src/Makefile.am b/src/Makefile.am index b8085d7..0d9aaac 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -1,3 +1,22 @@ +###################################################################### +# s3fs - FUSE-based file system backed by Amazon S3 +# +# Copyright 2007-2008 Randy Rizun +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +###################################################################### bin_PROGRAMS=s3fs AM_CPPFLAGS = $(DEPS_CFLAGS) diff --git a/src/cache.cpp b/src/cache.cpp index 6e63c95..f9957c1 100644 --- a/src/cache.cpp +++ b/src/cache.cpp @@ -440,3 +440,11 @@ bool convert_header_to_stat(const char* path, headers_t& meta, struct stat* pst, return true; } +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/cache.h b/src/cache.h index 716589b..d0d8195 100644 --- a/src/cache.h +++ b/src/cache.h @@ -1,3 +1,22 @@ +/* + * s3fs - FUSE-based file system backed by Amazon S3 + * + * Copyright 2007-2008 Randy Rizun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #ifndef S3FS_CACHE_H_ #define S3FS_CACHE_H_ @@ -105,3 +124,12 @@ class StatCache bool convert_header_to_stat(const char* path, headers_t& meta, struct stat* pst, bool forcedir = false); #endif // S3FS_CACHE_H_ + +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/common.h b/src/common.h index 6f32a7c..dfc0343 100644 --- a/src/common.h +++ b/src/common.h @@ -1,3 +1,22 @@ +/* + * s3fs - FUSE-based file system backed by Amazon S3 + * + * Copyright 2007-2008 Randy Rizun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #ifndef S3FS_COMMON_H_ #define S3FS_COMMON_H_ @@ -77,3 +96,12 @@ extern std::string bucket; extern std::string mount_prefix; #endif // S3FS_COMMON_H_ + +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/common_auth.cpp b/src/common_auth.cpp index 82e793c..9dd4828 100644 --- a/src/common_auth.cpp +++ b/src/common_auth.cpp @@ -102,4 +102,11 @@ string s3fs_md5sum(int fd, off_t start, ssize_t size) return string(md5); } -/// END +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/curl.cpp b/src/curl.cpp index 1c968c2..b6613a8 100644 --- a/src/curl.cpp +++ b/src/curl.cpp @@ -3624,4 +3624,11 @@ bool MakeUrlResource(const char* realpath, string& resourcepath, string& url) return true; } -/// END +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/curl.h b/src/curl.h index f368122..2896e63 100644 --- a/src/curl.h +++ b/src/curl.h @@ -1,3 +1,22 @@ +/* + * s3fs - FUSE-based file system backed by Amazon S3 + * + * Copyright 2007-2008 Randy Rizun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #ifndef S3FS_CURL_H_ #define S3FS_CURL_H_ @@ -405,3 +424,12 @@ struct curl_slist* curl_slist_sort_insert(struct curl_slist* list, const char* d bool MakeUrlResource(const char* realpath, std::string& resourcepath, std::string& url); #endif // S3FS_CURL_H_ + +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/fdcache.cpp b/src/fdcache.cpp index 44adb7c..7215bcd 100644 --- a/src/fdcache.cpp +++ b/src/fdcache.cpp @@ -1196,4 +1196,11 @@ bool FdManager::Close(FdEntity* ent) return false; } -/// END +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/fdcache.h b/src/fdcache.h index 5a97878..3d7aac2 100644 --- a/src/fdcache.h +++ b/src/fdcache.h @@ -1,3 +1,22 @@ +/* + * s3fs - FUSE-based file system backed by Amazon S3 + * + * Copyright 2007-2008 Randy Rizun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #ifndef FD_CACHE_H_ #define FD_CACHE_H_ @@ -154,3 +173,12 @@ class FdManager }; #endif // FD_CACHE_H_ + +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/gnutls_auth.cpp b/src/gnutls_auth.cpp index 8052398..72de2df 100644 --- a/src/gnutls_auth.cpp +++ b/src/gnutls_auth.cpp @@ -256,4 +256,11 @@ unsigned char* s3fs_md5hexsum(int fd, off_t start, ssize_t size) #endif // USE_GNUTLS_NETTLE -/// END +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/nss_auth.cpp b/src/nss_auth.cpp index 9fff70d..f820426 100644 --- a/src/nss_auth.cpp +++ b/src/nss_auth.cpp @@ -193,4 +193,11 @@ unsigned char* s3fs_md5hexsum(int fd, off_t start, ssize_t size) return result; } -/// END +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/openssl_auth.cpp b/src/openssl_auth.cpp index d56db29..6108f7e 100644 --- a/src/openssl_auth.cpp +++ b/src/openssl_auth.cpp @@ -253,4 +253,11 @@ unsigned char* s3fs_md5hexsum(int fd, off_t start, ssize_t size) return result; } -/// END +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/s3fs.cpp b/src/s3fs.cpp index dc36081..b4a1585 100644 --- a/src/s3fs.cpp +++ b/src/s3fs.cpp @@ -4005,4 +4005,11 @@ int main(int argc, char* argv[]) exit(fuse_res); } -/// END +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/s3fs.h b/src/s3fs.h index 8913f27..9ff40e5 100644 --- a/src/s3fs.h +++ b/src/s3fs.h @@ -1,3 +1,22 @@ +/* + * s3fs - FUSE-based file system backed by Amazon S3 + * + * Copyright 2007-2008 Randy Rizun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #ifndef S3FS_S3_H_ #define S3FS_S3_H_ @@ -68,3 +87,12 @@ char* get_object_sseckey_md5(const char* path); #endif // S3FS_S3_H_ + +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/s3fs_auth.h b/src/s3fs_auth.h index d66ef8e..ad1f060 100644 --- a/src/s3fs_auth.h +++ b/src/s3fs_auth.h @@ -1,3 +1,22 @@ +/* + * s3fs - FUSE-based file system backed by Amazon S3 + * + * Copyright 2007-2008 Randy Rizun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #ifndef S3FS_AUTH_H_ #define S3FS_AUTH_H_ @@ -24,3 +43,12 @@ size_t get_md5_digest_length(void); unsigned char* s3fs_md5hexsum(int fd, off_t start, ssize_t size); #endif // S3FS_AUTH_H_ + +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/s3fs_util.cpp b/src/s3fs_util.cpp index 2c15b1c..0729e2a 100644 --- a/src/s3fs_util.cpp +++ b/src/s3fs_util.cpp @@ -1049,4 +1049,11 @@ void show_version(void) return; } -/// END +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/s3fs_util.h b/src/s3fs_util.h index 36833e2..bb1de05 100644 --- a/src/s3fs_util.h +++ b/src/s3fs_util.h @@ -1,3 +1,22 @@ +/* + * s3fs - FUSE-based file system backed by Amazon S3 + * + * Copyright 2007-2008 Randy Rizun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #ifndef S3FS_S3FS_UTIL_H_ #define S3FS_S3FS_UTIL_H_ @@ -117,3 +136,12 @@ void show_help(void); void show_version(void); #endif // S3FS_S3FS_UTIL_H_ + +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/string_util.cpp b/src/string_util.cpp index bc208fc..43940e9 100644 --- a/src/string_util.cpp +++ b/src/string_util.cpp @@ -217,3 +217,12 @@ string get_date() strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S GMT", gmtime(&t)); return buf; } + +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/src/string_util.h b/src/string_util.h index 2ad3bfe..595942d 100644 --- a/src/string_util.h +++ b/src/string_util.h @@ -1,3 +1,22 @@ +/* + * s3fs - FUSE-based file system backed by Amazon S3 + * + * Copyright 2007-2008 Randy Rizun + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public License + * as published by the Free Software Foundation; either version 2 + * of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * 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, write to the Free Software + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ #ifndef S3FS_STRING_UTIL_H_ #define S3FS_STRING_UTIL_H_ @@ -32,3 +51,12 @@ std::string prepare_url(const char* url); bool get_keyword_value(std::string& target, const char* keyword, std::string& value); #endif // S3FS_STRING_UTIL_H_ + +/* +* Local variables: +* tab-width: 4 +* c-basic-offset: 4 +* End: +* vim600: noet sw=4 ts=4 fdm=marker +* vim<600: noet sw=4 ts=4 +*/ diff --git a/test/Makefile.am b/test/Makefile.am index ea50956..e841fd6 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -1,3 +1,22 @@ +###################################################################### +# s3fs - FUSE-based file system backed by Amazon S3 +# +# Copyright 2007-2008 Randy Rizun +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# 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, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. +###################################################################### TESTS=small-integration-test.sh EXTRA_DIST = \