Closed kabamwboyer closed 4 years ago
Hello Wanda,
Unfortunately, I am not a user of Homebrew so I won't be able to create a tap for fpart. Anyway, I would be happy to integrate it if someone provided one to me :)
Anyone interested in contributing ?
I can definitely give it a shot! I will research and get back to you :D
I created a homebrew-fpart repository, and then ran
$ brew create https://github.com/martymac/fpart/archive/fpart-1.1.0.tar.gz
to create
/usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/fpart.rb
which I then copied to the repository directory:
$ cp /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core/Formula/fpart.rb ./homebrew-fpart/Formula/
However, I have a few questions:
homebrew-core
(as seen in the section on Contributing), one needs to have a test
within the Formula
; what kind of test can be done to ensure that fpart
has been installed correctly, other than ensuring the output is equal to the help text:$ fpart
Please specify either -n, -f or -s.
Usage: fpart [OPTIONS] -n num | -f files | -s size [FILE or DIR...]
Sort and pack files into partitions.
General options:
-h this help
-V print version
...
brew create
has calls to cmake
commented out; shall I just delete these lines, since in the fpart
repo README.md
the only calls you use are autoreconf -i
, ./configure
, make
, and make install
(as root).Hello Wanda,
Good news, thanks for your contribution :)
Maybe you can trigger a simple 'fpart -V' which displays the current version as well as build options ?
Yes, I presume you can, fpart does not use CMake at all
Once you have everything ready (and if you want), just tell me, I'll import your work into the contribs/package/homebrew directory.
Thanks again :)
Ahhhh, well I guess the issue is that in the Homebrew docs, they say:
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. However, a bad test is better than no test at all.
Is there some sort of simple operation that I could perform and validate the output of other than running fpart -V
? I'm only familiar with using fpsync
that comes with fpart
(which is actually my intention for wanting to be able to install this - to have access to fpsync
).
Thank you for working through this with me! This is my first time actually contributing something to a repo, so I'm kind of pumped, not gonna lie 😀
Hello Wanda,
You can use that simple one-liner :
touch "${HOME}/.fpart-test" && fpart -n 1 -y ".fpart-test" "${HOME}" 2>/dev/null | grep -q "0 (0): ${HOME}/.fpart-test"
that will create an empty file in ${HOME} and then use fpart to pack it in a single partition. That will ensure that fpart works, can crawl the filesystrem and output a partition.
Best regards, Ganael.
Absolutely brilliant!! Thank you, Ganael; I'll keep you posted when I push to the homebrew-fpart
repo and the results for testing and subsequently installing fpart
using brew
!
Hey Ganael, I've got a quick question for you: when I try to run fpart
in the terminal as you have described, i.e.
touch "${HOME}/.fpart-test" && fpart -n 1 -y ".fpart-test" "${HOME}" 2>/dev/null | grep -q "0 (0): ${HOME}/.fpart-test"
The command hangs. I attempted to break it apart and test, and observed that
fpart -n 1 -y ".fpart-test" "${HOME}"
gives no output, despite the file .fpart-test
existing in the home directory. I thought perhaps it was because the point you were attempting to create the partition at, i.e. ${HOME}
, might be problematic, so I did mkdir ${HOME}/tmpDir
and attempted to run
fpart -n 1 -y ".fpart-test" "${HOME}/tmpDir"
The command executed, but no output was forthcoming, and ~/tmpDir
was empty.
Is there an issue because I'm not using fpart
correctly as per its usage:
Usage: fpart [OPTIONS] -n num | -f files | -s size [FILE or DIR...]
Hello Wanda,
Weird... You are using fpart the right way.
Can you add verbose options to see what's happening? :
$ fpart -vv -n 1 -y ".fpart-test" "${HOME}/tmpDir"
Maybe you can also try using a fixed directory first, such as /tmp instead of ${HOME}.
Hope this helps, Regards,
Ganael.
Here ya go, Ganael!
$ pwd
/Users/wboyer
$ echo ${HOME}
/Users/wboyer
$ ls -lahe .fpart-test
-rw-r--r-- 1 wboyer CORP\Domain Users 0B 28 Aug 17:02 .fpart-test
$ fpart -vv -n 1 -y ".fpart-test" "${HOME}/tmpDir"
Examining filesystem...
0 file(s) found.
$ ls -lahe ~/tmpDir/
total 0
drwxr-xr-x 2 wboyer CORP\Domain Users 64B 29 Aug 09:12 .
drwxr-xr-x@ 84 wboyer CORP\Domain Users 2.6K 29 Aug 09:12 ..
0: group:everyone deny delete
So I'm not sure if it's actually creating the partition... Should I create a separate bug report and poke around at this later today?
Hello Wanda,
Your .fpart-test file is in "${HOME}" while you are asking fpart to work on "${HOME}/tmpDir".
Either move .fpart-test to "${HOME}/tmpDir" or start fpart that way :
$ fpart -vv -n 1 -y ".fpart-test" "${HOME}"
It should now find the .fpart-test file and display (on stdout) a single partition with that file inside.
Best regards,
Ganael.
Oh gosh I'm so sorry! I don't know how fpart
works - only have used your fpsync
!!! Thank you for walking me through this :D
EDIT: Works like a charm!
$ fpart -vv -n 1 -y ".fpart-test" "${HOME}/tmpDir"
Examining filesystem...
/Users/wboyer/tmpDir/.fpart-test
1 file(s) found.
Sorting entries...
Part #0: size = 0, 1 file(s)
Writing output lists...
0 (0): /Users/wboyer/tmpDir/.fpart-test
Cleaning up...
Great, good news :)
Hello Wanda,
Is everything working fine regarding that issue ? Is the homebrew package working now or do you still need help ?
Ganael.
Hey @martymac ! Sorry for the delay; things have been a bit crazy at work, and since the needs of the project went in another direction, I haven't taken time on my own to get this working and tested... I'll keep you posted next week if I can eke some time for this task!
Hello Wanda,
OK, no pb :) Thanks for the update !
Best regards,
Ganael.
I'll close that bur report for now, feel free to re-open it if necessary.
FYI, I took a stab at this: https://github.com/Homebrew/homebrew-core/pull/62573/.
Hello @benstiglitz,
Good news, thanks!
@kabamwboyer, @benstiglitz,
Thanks again for your contribution!
Would it be possible to create a homebrew tap for the fpart package to facilitate deployment on MacOS machines, or to allow that work to be done on a separate repo called
homebrew-fpart
so one can use thebrew tap
command? Thanks so much for your time!