Hello community,

here is the log from the commit of package f3 for openSUSE:Factory checked in 
at 2019-01-21 10:59:26
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/f3 (Old)
 and      /work/SRC/openSUSE:Factory/.f3.new.28833 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "f3"

Mon Jan 21 10:59:26 2019 rev:6 rq:666795 version:7.1

Changes:
--------
--- /work/SRC/openSUSE:Factory/f3/f3.changes    2018-02-07 18:41:38.195555666 
+0100
+++ /work/SRC/openSUSE:Factory/.f3.new.28833/f3.changes 2019-01-21 
11:01:12.739208502 +0100
@@ -1,0 +2,9 @@
+Thu Jan 17 14:44:25 UTC 2019 - [email protected]
+
+- update to 7.1:
+    * fix compilation issues on non-Linux OSs
+    * f3write: make parameter --max-write-rate work precisely
+    * f3probe: change default reset type to RT_NONE
+- remove remove-ownership-setting.patch (accepted upstream, pull request #75) 
+
+-------------------------------------------------------------------

Old:
----
  f3-7.0.tar.gz
  remove-ownership-setting.patch

New:
----
  f3-7.1.tar.gz

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ f3.spec ++++++
--- /var/tmp/diff_new_pack.xoYabs/_old  2019-01-21 11:01:13.867207044 +0100
+++ /var/tmp/diff_new_pack.xoYabs/_new  2019-01-21 11:01:13.879207028 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package f3
 #
-# Copyright (c) 2018 SUSE LINUX GmbH, Nuernberg, Germany.
+# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany.
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -17,14 +17,13 @@
 
 
 Name:           f3
-Version:        7.0
+Version:        7.1
 Release:        0
 Summary:        Fight Flash Fraud / Fight Fake Flash
-License:        GPL-3.0
+License:        GPL-3.0-only
 Group:          Hardware/Other
 Url:            http://oss.digirati.com.br/f3/
 Source:         
https://github.com/AltraMayor/f3/archive/v%{version}.tar.gz#/%{name}-%{version}.tar.gz
-Patch0:         remove-ownership-setting.patch
 BuildRequires:  libudev-devel
 BuildRequires:  parted-devel
 
@@ -42,7 +41,6 @@
 
 %prep
 %setup -q
-%patch0
 
 %build
 # workaround for libargp problem. see:
@@ -60,15 +58,15 @@
 
 %install
 %make_install PREFIX=%{_prefix} install-extra
-# 
 
 %files
-%doc changelog README.rst LICENSE examples
+%doc changelog README.rst examples
+%license LICENSE
 %{_bindir}/f3read
 %{_bindir}/f3write
-%{_sbindir}/f3probe
-%{_sbindir}/f3brew
-%{_sbindir}/f3fix
+%{_bindir}/f3probe
+%{_bindir}/f3brew
+%{_bindir}/f3fix
 %{_mandir}/man1/f3read.1%{ext_man}
 %{_mandir}/man1/f3write.1%{ext_man}
 

++++++ f3-7.0.tar.gz -> f3-7.1.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/f3-7.0/Makefile new/f3-7.1/Makefile
--- old/f3-7.0/Makefile 2017-12-21 20:32:02.000000000 +0100
+++ new/f3-7.1/Makefile 2018-07-27 10:10:35.000000000 +0200
@@ -8,19 +8,28 @@
 INSTALL = install
 LN = ln
 
+ifndef OS
+       OS = $(shell uname -s)
+endif
+ifneq ($(OS), Linux)
+       ARGP = /usr/local
+       CFLAGS += -I$(ARGP)/include
+       LDFLAGS += -L$(ARGP)/lib -largp
+endif
+
 all: $(TARGETS)
 extra: $(EXTRA_TARGETS)
 
 install: all
        $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
-       $(INSTALL) -oroot -groot -m755 $(TARGETS) $(DESTDIR)$(PREFIX)/bin
+       $(INSTALL) -m755 $(TARGETS) $(DESTDIR)$(PREFIX)/bin
        $(INSTALL) -d $(DESTDIR)$(PREFIX)/share/man/man1
-       $(INSTALL) -oroot -groot -m644 f3read.1 
$(DESTDIR)$(PREFIX)/share/man/man1
+       $(INSTALL) -m644 f3read.1 $(DESTDIR)$(PREFIX)/share/man/man1
        $(LN) -sf f3read.1 $(DESTDIR)$(PREFIX)/share/man/man1/f3write.1
 
 install-extra: extra
        $(INSTALL) -d $(DESTDIR)$(PREFIX)/bin
-       $(INSTALL) -oroot -groot -m755 $(EXTRA_TARGETS) $(DESTDIR)$(PREFIX)/bin
+       $(INSTALL) -m755 $(EXTRA_TARGETS) $(DESTDIR)$(PREFIX)/bin
 
 f3write: utils.o f3write.o
        $(CC) -o $@ $^ $(LDFLAGS) -lm
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/f3-7.0/README.rst new/f3-7.1/README.rst
--- old/f3-7.0/README.rst       2017-12-21 20:32:02.000000000 +0100
+++ new/f3-7.1/README.rst       2018-07-27 10:10:35.000000000 +0200
@@ -63,7 +63,7 @@
 `here <https://github.com/AltraMayor/f3/releases>`__. The
 following command uncompresses the files::
 
-    $ unzip f3-7.0.zip
+    $ unzip f3-7.1.zip
 
 
 Compile stable software on Linux or FreeBSD
@@ -80,7 +80,13 @@
 Compile stable software on Windows/Cygwin
 -----------------------------------------
 
-On Cygwin, you need special flags::
+If you haven't already, install the following Cygwin packages and their 
dependencies:
+
+- `gcc-core`
+- `make`
+- `libargp-devel`
+
+To build, you need special flags::
 
     export LDFLAGS="$LDFLAGS -Wl,--stack,4000000 -largp"
     make
@@ -107,8 +113,8 @@
 
     port install f3
 
-Compiling the lastest development version from the source code
-~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Compiling the latest development version from the source code
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
 
 Most of the f3 source code builds fine using XCode, the only dependency
 missing is the GNU C library "argp". You can build argp from scratch, or
@@ -148,22 +154,16 @@
    See https://trac.macports.org/browser/trunk/dports/sysutils/f3/Portfile
    for more information.
 
-4) Set compilation flags. These following environment variables are used
-   in the Makefile to locate the argp library:
-
-   HomeBrew::
+4) Build F3::
 
-     export CFLAGS="$CFLAGS -I/usr/local/include/"
-     export LDFLAGS="$LDFLAGS -L/usr/local/lib/ -largp"
+   When using Homebrew, you can just run::
 
-   MacPorts::
-
-     export CFLAGS="$CFLAGS -I/opt/local/include/"
-     export LDFLAGS="$LDFLAGS -L/opt/local/lib/ -largp"
+       make
 
-5) Build F3::
+   When using MacPorts, you will need to pass the location where MacPorts
+   installed argp-standalone::
 
-       make
+       make ARGP=/opt/local
 
 The extra applications for Linux
 --------------------------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/f3-7.0/changelog new/f3-7.1/changelog
--- old/f3-7.0/changelog        2017-12-21 20:32:02.000000000 +0100
+++ new/f3-7.1/changelog        2018-07-27 10:10:35.000000000 +0200
@@ -1,3 +1,9 @@
+Version 7.1 - Jul 27, 2018
+
+    * fix compilation issues on non-Linux OSs
+    * f3write: make parameter --max-write-rate work precisely
+    * f3probe: change default reset type to RT_NONE
+
 Version 7.0 - Dec 21, 2017
 
     * stable version of f3probe, f3fix, and f3brew (Linux only)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/f3-7.0/doc/conf.py new/f3-7.1/doc/conf.py
--- old/f3-7.0/doc/conf.py      2017-12-21 20:32:02.000000000 +0100
+++ new/f3-7.1/doc/conf.py      2018-07-27 10:10:35.000000000 +0200
@@ -58,9 +58,9 @@
 # built documents.
 #
 # The short X.Y version.
-version = '7.0'
+version = '7.1'
 # The full version, including alpha/beta/rc tags.
-release = '7.0'
+release = '7.1'
 
 # The language for content autogenerated by Sphinx. Refer to documentation
 # for a list of supported languages.
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/f3-7.0/doc/usage.rst new/f3-7.1/doc/usage.rst
--- old/f3-7.0/doc/usage.rst    2017-12-21 20:32:02.000000000 +0100
+++ new/f3-7.1/doc/usage.rst    2018-07-27 10:10:35.000000000 +0200
@@ -598,7 +598,7 @@
 
     $ sudo ./f3probe --destructive --time-ops /dev/sdb
     [sudo] password for michel: 
-    F3 probe 7.0
+    F3 probe 7.1
     Copyright (C) 2010 Digirati Internet LTDA.
     This is free software; see the source for copying conditions.
 
@@ -673,7 +673,7 @@
 
     $ sudo ./f3probe --time-ops /dev/sdc
     [sudo] password for michel: 
-    F3 probe 7.0
+    F3 probe 7.1
     Copyright (C) 2010 Digirati Internet LTDA.
     This is free software; see the source for copying conditions.
 
@@ -733,7 +733,7 @@
 ::
 
     $ sudo ./f3fix --last-sec=16477878 /dev/sdb
-    F3 fix 7.0
+    F3 fix 7.1
     Copyright (C) 2010 Digirati Internet LTDA.
     This is free software; see the source for copying conditions.
 
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/f3-7.0/f3probe.c new/f3-7.1/f3probe.c
--- old/f3-7.0/f3probe.c        2017-12-21 20:32:02.000000000 +0100
+++ new/f3-7.1/f3probe.c        2018-07-27 10:10:35.000000000 +0200
@@ -520,7 +520,24 @@
                .keep_file      = false,
                .save           = true,
                .min_mem        = false,
-               .reset_type     = RT_USB,
+
+               /* RT_NONE is the only reliable reset type against fake flash.
+                * See issue #81 for details:
+                * https://github.com/AltraMayor/f3/issues/81
+                *
+                * A side benefit of this reset type is that it works on
+                * non-USB-backed drives, such as card readers that are
+                * commonly built in laptops.
+                * See issue #79 for details:
+                * https://github.com/AltraMayor/f3/issues/79
+                *
+                * A negative side effect is that f3probe runs slower
+                * for cases in which RT_USB would work. But users can
+                * still request the reset type RT_USB by
+                * passing --reset-type=1
+                */
+               .reset_type     = RT_NONE,
+
                .time_ops       = false,
                .real_size_byte = 1ULL << 31,
                .fake_size_byte = 1ULL << 34,
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/f3-7.0/f3read.1 new/f3-7.1/f3read.1
--- old/f3-7.0/f3read.1 2017-12-21 20:32:02.000000000 +0100
+++ new/f3-7.1/f3read.1 2018-07-27 10:10:35.000000000 +0200
@@ -1,5 +1,5 @@
 .\"Text automatically generated by txt2man
-.TH F3 "1"  "December 2017" "F3 7.0" "test real flash memory capacity"
+.TH F3 "1"  "July 2018" "F3 7.1" "test real flash memory capacity"
 .SH NAME
 \fBf3write, f3read \fP- test real flash memory capacity
 .SH SYNOPSIS
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/f3-7.0/f3write.c new/f3-7.1/f3write.c
--- old/f3-7.0/f3write.c        2017-12-21 20:32:02.000000000 +0100
+++ new/f3-7.1/f3write.c        2018-07-27 10:10:35.000000000 +0200
@@ -8,6 +8,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <limits.h>
+#include <float.h>
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <sys/statvfs.h>
@@ -148,12 +149,10 @@
        int             step;
        /* Blocks to write before measurement. */
        int             blocks_per_delay;
-       /* Maximum number of blocks to write before measurement.
-        * This parameter is used to bound the write rate.
-        */
-       int             max_blocks_per_delay;
        /* Delay in miliseconds. */
        int             delay_ms;
+       /* Maximum write rate in bytes per second. */
+       double          max_write_rate;
        /* Number of measurements after reaching FW_STEADY state. */
        uint64_t        measurements;
        /* Number of measured blocks. */
@@ -190,26 +189,17 @@
        fw->total_size          = total_size;
        fw->total_written       = 0;
        fw->progress            = progress;
-       fw->block_size          = 1024; /* 1KB          */
-       fw->blocks_per_delay    = 1;    /* 1KB/s        */
+       fw->block_size          = 512;  /* Bytes        */
+       fw->blocks_per_delay    = 1;    /* 512B/s       */
        fw->delay_ms            = 1000; /* 1s           */
+       fw->max_write_rate      = max_write_rate <= 0
+               ? DBL_MAX : max_write_rate * 1024.;
        fw->measurements        = 0;
        fw->measured_blocks     = 0;
        fw->erase               = 0;
        assert(fw->block_size > 0);
        assert(fw->block_size % SECTOR_SIZE == 0);
 
-       /* Derive @fw->max_blocks_per_delay from @max_write_rate. */
-       if (max_write_rate <= 0) {
-               /* This is the most common case. */
-               fw->max_blocks_per_delay = INT_MAX;
-       } else {
-               fw->max_blocks_per_delay =
-                       /* Units: KB/s * ms / B/block = block */
-                       round((double)max_write_rate * fw->delay_ms
-                               / fw->block_size);
-       }
-
        move_to_inc_at_start(fw);
 }
 
@@ -320,8 +310,6 @@
 static inline void inc_step(struct flow *fw)
 {
        fw->blocks_per_delay += fw->step;
-       if (fw->blocks_per_delay > fw->max_blocks_per_delay)
-               fw->blocks_per_delay = fw->max_blocks_per_delay;
        fw->step *= 2;
 }
 
@@ -338,10 +326,25 @@
        dec_step(fw);
 }
 
+static inline int is_rate_above(const struct flow *fw,
+       long delay, double inst_speed)
+{
+       /* We use logical or here to enforce the lowest limit. */
+       return delay > fw->delay_ms || inst_speed > fw->max_write_rate;
+}
+
+static inline int is_rate_below(const struct flow *fw,
+       long delay, double inst_speed)
+{
+       /* We use logical and here to enforce both limist. */
+       return delay < fw->delay_ms && inst_speed < fw->max_write_rate;
+}
+
 static int measure(int fd, struct flow *fw, ssize_t written)
 {
        long delay;
        div_t result = div(written, fw->block_size);
+       double inst_speed;
        bool slow_down = false;
 
        assert(result.rem == 0);
@@ -359,23 +362,26 @@
        assert(!posix_fadvise(fd, 0, 0, POSIX_FADV_DONTNEED));
        delay = delay_ms(&fw->t1, &fw->t2);
 
+       /* Instantaneous speed in bytes per second. */
+       inst_speed = (double)fw->blocks_per_delay * fw->block_size * 1000 /
+               fw->delay_ms;
+
        switch (fw->state) {
        case FW_INC:
-               if (delay > fw->delay_ms) {
+               if (is_rate_above(fw, delay, inst_speed)) {
                        move_to_search(fw,
                                fw->blocks_per_delay - fw->step / 2,
                                fw->blocks_per_delay);
-               } else if (delay < fw->delay_ms
-                       && fw->blocks_per_delay < fw->max_blocks_per_delay) {
+               } else if (is_rate_below(fw, delay, inst_speed)) {
                        inc_step(fw);
                } else
                        move_to_steady(fw);
                break;
 
        case FW_DEC:
-               if (delay > fw->delay_ms) {
+               if (is_rate_above(fw, delay, inst_speed)) {
                        dec_step(fw);
-               } else if (delay < fw->delay_ms) {
+               } else if (is_rate_below(fw, delay, inst_speed)) {
                        move_to_search(fw, fw->blocks_per_delay,
                                fw->blocks_per_delay + fw->step / 2);
                } else
@@ -388,10 +394,10 @@
                        break;
                }
 
-               if (delay > fw->delay_ms) {
+               if (is_rate_above(fw, delay, inst_speed)) {
                        fw->bpd2 = fw->blocks_per_delay;
                        fw->blocks_per_delay = (fw->bpd1 + fw->bpd2) / 2;
-               } else if (delay < fw->delay_ms) {
+               } else if (is_rate_below(fw, delay, inst_speed)) {
                        fw->bpd1 = fw->blocks_per_delay;
                        fw->blocks_per_delay = (fw->bpd1 + fw->bpd2) / 2;
                } else
@@ -402,8 +408,10 @@
                update_mean(fw);
 
                if (delay <= fw->delay_ms) {
-                       if (fw->blocks_per_delay < fw->max_blocks_per_delay) {
+                       if (inst_speed < fw->max_write_rate) {
                                move_to_inc(fw);
+                       } if (inst_speed > fw->max_write_rate) {
+                               move_to_dec(fw);
                        } else {
                                /* Since we are already writing at
                                 * maximum allowed rate, wait until next cycle.
@@ -420,10 +428,6 @@
        }
 
        if (fw->progress) {
-               /* Instantaneous speed. */
-               double inst_speed =
-                       (double)fw->blocks_per_delay * fw->block_size * 1000 /
-                       fw->delay_ms;
                const char *unit = adjust_unit(&inst_speed);
                double percent;
                /* The following shouldn't be necessary, but sometimes
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' 
'--exclude=.svnignore' old/f3-7.0/version.h new/f3-7.1/version.h
--- old/f3-7.0/version.h        2017-12-21 20:32:02.000000000 +0100
+++ new/f3-7.1/version.h        2018-07-27 10:10:35.000000000 +0200
@@ -1,6 +1,6 @@
 #ifndef HEADER_VERSION_H
 #define HEADER_VERSION_H
 
-#define F3_STR_VERSION "7.0"
+#define F3_STR_VERSION "7.1"
 
 #endif /* HEADER_VERSION_H */


Reply via email to