Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fsarchiver 0.8.7 (new formula) #192565

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions Formula/f/fsarchiver.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
class Fsarchiver < Formula
desc "File system archiver for linux"
homepage "https://www.fsarchiver.org"
url "https://github.com/fdupoux/fsarchiver/releases/download/0.8.7/fsarchiver-0.8.7.tar.gz"
sha256 "f7cd059e70fc57e888db282c622ec050c0dcdbaacc65e3c1eb163cd9d92d810d"
license "GPL-2.0-only"

depends_on "autoconf" => :build
depends_on "automake" => :build
depends_on "libtool" => :build
depends_on "pkg-config" => :build
depends_on "bzip2"
depends_on "e2fsprogs"
depends_on "libgcrypt"
depends_on :linux
depends_on "lz4"
depends_on "lzo"
depends_on "util-linux"
depends_on "xz"
depends_on "zlib"
depends_on "zstd"

def install
args = [
"--enable-elf-shlibs",
"--disable-fsck",
"--disable-uuidd",
"--disable-libuuid",
"--disable-libblkid",
"--without-crond-dir",
"--sysconfdir=#{etc}",
"--disable-e2initrd-helper",
"MKDIR_P=mkdir -p",
]

system "autoreconf", "--force", "--install", "--verbose"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The release tarball contains a configure script. Perhaps we can skip this?

system "./configure", *args, *std_configure_args

system "make"
system "make", "install"
end

test do

Check failure on line 43 in Formula/f/fsarchiver.rb

View workflow job for this annotation

GitHub Actions / Linux

`brew test --verbose fsarchiver` failed on Linux!

/home/linuxbrew/.linuxbrew/Homebrew/Library/Homebrew/test.rb:52:in `<main>'
system bin/"fsarchiver", "usage"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you propose a more substantial test than checking the version or calling for help? These tests rarely ever fail even for broken installations.

We want tests that don’t require any user input and test the basic functionality of the application. For example foo build-foo input.foo is a good test and (despite their widespread use) foo --version and foo --help are bad tests.

Ref. https://docs.brew.sh/Formula-Cookbook#add-a-test-to-the-formula

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not know, most fsarchiver runs need root access and mess with disks.
I will see if there are any partitions which can be accessed without root access.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we try to do something that requires root access while not actually having root access, and check that we get the expected failure message and exit code?

end
end
Loading