Hello community, here is the log from the commit of package duperemove for openSUSE:Factory checked in at 2015-03-23 12:16:58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/duperemove (Old) and /work/SRC/openSUSE:Factory/.duperemove.new (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "duperemove" Changes: -------- --- /work/SRC/openSUSE:Factory/duperemove/duperemove.changes 2015-01-30 15:08:04.000000000 +0100 +++ /work/SRC/openSUSE:Factory/.duperemove.new/duperemove.changes 2015-03-23 12:16:59.000000000 +0100 @@ -1,0 +2,7 @@ +Thu Mar 19 16:29:24 UTC 2015 - [email protected] + +- Update to duperemove v0.09.1 + - Fallback to stat on filesystems that don't report file type from + readdir + +------------------------------------------------------------------- Old: ---- v0.09.tar.gz New: ---- v0.09.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ duperemove.spec ++++++ --- /var/tmp/diff_new_pack.a1DQ0S/_old 2015-03-23 12:17:00.000000000 +0100 +++ /var/tmp/diff_new_pack.a1DQ0S/_new 2015-03-23 12:17:00.000000000 +0100 @@ -16,10 +16,10 @@ # -%define tar_version 0.09 +%define tar_version 0.09.1 %define samename btrfs-extent-same Name: duperemove -Version: 0.09 +Version: 0.09.1 Release: 0 Summary: Software to find duplicate extents in files and remove them License: GPL-2.0 ++++++ v0.09.tar.gz -> v0.09.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/duperemove-0.09/Makefile new/duperemove-0.09.1/Makefile --- old/duperemove-0.09/Makefile 2015-01-29 20:27:52.000000000 +0100 +++ new/duperemove-0.09.1/Makefile 2015-03-19 17:25:09.000000000 +0100 @@ -1,4 +1,4 @@ -RELEASE=v0.09 +RELEASE=v0.09.1 CC = gcc CFLAGS = -Wall -ggdb diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/duperemove-0.09/duperemove.c new/duperemove-0.09.1/duperemove.c --- old/duperemove-0.09/duperemove.c 2015-01-29 20:27:52.000000000 +0100 +++ new/duperemove-0.09.1/duperemove.c 2015-03-19 17:25:09.000000000 +0100 @@ -539,9 +539,13 @@ g_dataset_set_data_full(tree, "mutex", &tree_mutex, (GDestroyNotify) g_mutex_clear); - if (!hash_threads) + if (!hash_threads) { +#if GLIB_CHECK_VERSION(2,36,0) hash_threads = g_get_num_processors(); - +#else + hash_threads = sysconf(_SC_NPROCESSORS_ONLN); +#endif + } pool = g_thread_pool_new((GFunc) csum_whole_file, tree, hash_threads, FALSE, &err); if (err != NULL) { @@ -601,6 +605,46 @@ printf("\nPlease see the duperemove(8) manpage for more options.\n"); } +static int get_dirent_type(struct dirent *entry, int fd) +{ + int ret; + struct stat st; + + if (entry->d_type != DT_UNKNOWN) + return entry->d_type; + + /* + * FS doesn't support file type in dirent, do this the old + * fashioned way. We translate mode to DT_* for the + * convenience of the caller. + */ + ret = fstatat(fd, entry->d_name, &st, 0); + if (ret) { + fprintf(stderr, + "Error %d: %s while getting type of file %s/%s. " + "Skipping.\n", + errno, strerror(errno), path, entry->d_name); + return DT_UNKNOWN; + } + + if (S_ISREG(st.st_mode)) + return DT_REG; + if (S_ISDIR(st.st_mode)) + return DT_DIR; + if (S_ISBLK(st.st_mode)) + return DT_BLK; + if (S_ISCHR(st.st_mode)) + return DT_CHR; + if (S_ISFIFO(st.st_mode)) + return DT_FIFO; + if (S_ISLNK(st.st_mode)) + return DT_LNK; + if (S_ISSOCK(st.st_mode)) + return DT_SOCK; + + return DT_UNKNOWN; +} + static int add_file(const char *name, int dirfd); static int walk_dir(const char *name) @@ -608,6 +652,7 @@ int ret = 0; struct dirent *entry; DIR *dirp; + int type; dirp = opendir(path); if (dirp == NULL) { @@ -624,12 +669,14 @@ || strcmp(entry->d_name, "..") == 0) continue; - if (entry->d_type == DT_REG || - (recurse_dirs && entry->d_type == DT_DIR)) + type = get_dirent_type(entry, dirfd(dirp)); + if (type == DT_REG || + (recurse_dirs && type == DT_DIR)) { if (add_file(entry->d_name, dirfd(dirp))) { ret = 1; goto out; } + } } } while (entry != NULL); -- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
