Conversation
fcf6fa0 to
65f315e
Compare
| Verbose= | ||
| DryRun= | ||
|
|
There was a problem hiding this comment.
I believe these may have been initialized here, empty, as documentation / for developer awareness of their existence.
LMK if you want them restored.
| initialize | ||
| main_prerequisites; | ||
| return |
There was a problem hiding this comment.
If a user is sourcing apt-bundle then the temporary directory & files need to be present in order for any of the subsequent source / package statements to work.
Prerequisites are also obviously necessary.
Prerequisites leverage the same system for installing packages so they need the same temp directory & files.
| cat -- "$@" > "$TmpDir/Debfile" | ||
| . "$TmpDir/Debfile" |
There was a problem hiding this comment.
If a user is sourcing apt-bundle then the calling script is the Debfile (sort of).
Meaning we can't copy & source the entire (list of) Debfiles into the temp dir.
We have to let the user invoke source/package and eventually a "flush" function (not yet defined).
| } | ||
|
|
||
| main() { | ||
| local opt file destdir filename dest tmpfile ppa |
There was a problem hiding this comment.
Variables within this declaration became unused after extraction.
Replaced with local varname= in their respective functions.
There was a problem hiding this comment.
Note: AFAIK sh doesn't have local variables, or even the keyword itself.
Most of the time sh is actually an aliased bash with a compatibility flag enabled and bash gives it the local keyword even though POSIX sh doesn't support it.
| return | ||
| fi | ||
|
|
||
| set -e |
There was a problem hiding this comment.
Exit on first error can be enabled from the shebang #!/bin/sh -e, is this not useful?
65f315e to
544fa52
Compare
544fa52 to
7181160
Compare
First step towards allowing apt-bundle to be used as a library is splitting the functions.
I've created this draft PR with functionality split -- not much attention to function names, I just wanted to get the ball rolling.