-
Notifications
You must be signed in to change notification settings - Fork 74
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
Add optional buildscripts #370
Conversation
NOTE : THIS IS STILL UNFINISHEDEDIT : THIS IS NOW MOSTLY FINISHEDEDIT2 : THIS IS NOW 99.9% FINISHEDIt works perfectly fine when run using Notably :
|
On that note, the fatal error occurs somewhere near line 11 of make-fedora.sh on subsequent runs EDIT : I think it has something to do with the git pull command expecting an empty directory or something similar, I am not experienced in dealing with git, so I can't fix the error in this case EDIT2 : Fixed the bug, it now works fine |
@ahmubashshir can you take a look? @larina3315 Have you checked the scripts with |
Just checked, some suggestions showed up, I will update my scripts accordingly. |
Script is finished
|
@larina3315 try amending the commits with meaningful messages. https://www.conventionalcommits.org/en/v1.0.0/ |
Initial commit of the script.
Refactor and Revise the script
Add Debian support Misc. revisions to Fedora script for toolbox --help switch for accessing help information --clean switch for cleaning toolbox containers and ~/.obk-build/
Last commit before major changes
Add comments explaining what different variables do, how to add support for new distros. Some misc revisions.
directory, besides the shell scripts
I am extremely sorry, I am still inexperienced in working with git. As for reviewing the PR, I would suggest focusing on/after Some cleanup and restructuring |
@larina3315 Okay the commits are good enough and I can squash them when merging this PR. As you intend it to be a user-facing tool, there should be documentation about it. Can you add basic information about how should a user run it in the |
yes, I will add a readme.md file for it asap. |
Create a readme for the tool
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good work btw 👍🏽 I'll try to add other distro and architecture support on this...
tools/make-pkgs/make-pkgs.sh
Outdated
echo "Usage: $0 [OPTIONS]" | ||
echo "Options:" | ||
echo " --ibus Compile IBus version" | ||
echo " --fcitx Compile Fcitx version (Doesn't work for OBK2 and earlier)" | ||
echo " --develop Compile from the develop branch" | ||
echo " --fedora Compile for Fedora" | ||
echo " --debian Compile for Debian" | ||
echo " --toolbox Compile inside of a toolbox" | ||
echo " --clean Clean \"$FILE_DIR_OBK\" directory and remove obk-toolbox-* containers" | ||
echo " --help Display this help message" | ||
echo " " | ||
echo " -> NOTE: User needs to specify the --toolbox flag to compile for multiple distros at the same time." | ||
echo " Otherwise, only one flag can be used at a time (e.g. --fedora and --debian can't be used together without --toolbox)" | ||
echo " -> NOTE: When compiling inside of a toolbox, an additional <version> can be specified for the distro flags." | ||
echo " (e.g. --fedora 37) This will generate packages for a specific version of a distro." | ||
echo "Example: " | ||
echo " $0 --ibus --fcitx --develop --fedora 37 --debian --toolbox" | ||
echo " $0 --ibus --develop --debian" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of using multiple echo
s, try using
cat <<EOF
...
EOF
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unless absolutely mandatory, I would personally like to avoid the change, as using the echos make the script more readable and understandable compared to using cat <<EOF
tools/make-pkgs/readme.md
Outdated
For example, If you are on Debian and you want to generate `.rpm`s specifically for Fedora 37, you can do so. | ||
|
||
## How to use | ||
Copy this folder, make the make-pkgs.sh script executable by doing `chmod +x make-pkgs.sh` |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@larina3315 why do we need to copy this folder?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was writing this from the POV that if a user clones the OBK git repo with this tool in it, then the make-pkgs.sh file will reside in ./OpenBangla-Keyboard/tools/make-pkgs/ , so the user might want to copy the folder to some other conveinent location and run it from there.
It could be worded in a better way as a suggestion.
Add toolbox-related changes. Cleaned up the markdown. Restructured Howto and Examples sections.
Add bash brackets Fixed behaviour of --clean flag
I would like to ask for suggestion on whether stdout/stderr output of things like toolbox/dnf/apt etc should be
|
Let's keep current behavior as default and put others behind optiol… like |
The user would be bombarded with random things happening on screen, as long as things are going fine why bother the user ? Although adding logging options can surely be done |
verbose output should be behind a |
I am currently looking into ways to introduce logging to bash scripts, although this change will take time as I will have to take a temporary hiatus due to academic reasons soon. EDIT : Using set -x will log every command the shell tries to run |
move initial functions and vars into function.bash
-v must be first arg ./make-pkgs.sh -v --xyz WARNING : CURRENTLY BROKEN
-v flag works correctly
There can be some more QoL enchancements, code cleanups and documentation effort, but I feel like make-pkgs has reached it's intended state, adding more features will take it out of it's original scope of being an enduser focused tool distrobox/docker support can also be easily added should anyone want to do such a thing, toolbox is a wrapper around podman so it already has podman support |
Due to limitations of bash, I sadly cannot suppress log output for toolbox/dnf/cpack/git etc This is the best that could be done given the current circumstances, I had to put ALOT of ugly hacks to make it work. |
@larina3315 I appreciate your effort on this, thanks! ❤️ @ahmubashshir Do you have any review comments to add? Otherwise, I'd like to merge it. |
I have to write some misc. documentation regarding adding distro support and variables, some slight behaviour has changed which need to be mentioned in the readme EDIT : I have finished doing appropriate changes |
On Sat, Jan 13 2024 at 03:42:27 AM -08:00:00, Muhammad Mominul Huque ***@***.***> wrote:
@ahmubashshir Do you have any review comments to add? Otherwise, I'd
like to merge it.
LGTM, you can merge it.
- Mubashshir
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
Implements #367