[pacman-dev] [PATCH] libmakepkg: add optional argument support to parseopts

2019-10-23 Thread Ethan Sommer
Signed-off-by: Ethan Sommer --- scripts/libmakepkg/util/parseopts.sh.in | 110 +++- test/scripts/parseopts_test.sh | 12 ++- 2 files changed, 77 insertions(+), 45 deletions(-) diff --git a/scripts/libmakepkg/util/parseopts.sh.in b/scripts/libmakepkg/util

[pacman-dev] [PATCH v2] libmakepkg: add optional argument support to parseopts

2019-10-23 Thread Ethan Sommer
Adds a "?" suffix that can be used to indicate that an option's argument is optional. This allows options to have a default behaviour when the user doesn't specify one, e.g.: --color=[when] being able to behave like --color=auto when only --color is passed Signed-

[pacman-dev] [PATCH v3] libmakepkg: add optional argument support to parseopts

2019-10-23 Thread Ethan Sommer
o split the option and its optarg easily Signed-off-by: Ethan Sommer --- scripts/libmakepkg/util/parseopts.sh.in | 116 +++- test/scripts/parseopts_test.sh | 12 ++- 2 files changed, 83 insertions(+), 45 deletions(-) diff --git a/scripts/libmakepkg/util/parseopts

[pacman-dev] [PATCH] libmakepkg: fix empty arguments in parseopts

2019-10-24 Thread Ethan Sommer
Previously parseopts checked if there was an argument by checking that the string was non-empty, resulting in empty arguments being incorrectly considered non-existent. This change makes parseopts check if arguments exist at all, rather than checking that they are non-empty Signed-off-by: Ethan

Re: [pacman-dev] [PATCH] libmakepkg: fix empty arguments in parseopts

2019-11-01 Thread Ethan Sommer
> When parsing options, is there any case where an empty argument is > functionally different from a missing one? > > I.e. what is the justification for considering empty arguments? makepkg --config='' --clean ==> ERROR: --clean not found. Aborting... I think that this isn't correct and makes

Re: [pacman-dev] [PATCH v3] libmakepkg: add optional argument support to parseopts

2019-11-03 Thread Ethan Sommer
> Again... devils advocate. You give an example of '--colour=auto' being > equivalent to '--color'. Why would the default when the options is not > specified not be default in the codebase? Fair enough, another example could be if you wanted to allow specifying a custom log file for whatever rea

[pacman-dev] [PATCH v4] libmakepkg: add optional argument support to parseopts

2019-11-03 Thread Ethan Sommer
o split the option and its optarg easily Signed-off-by: Ethan Sommer --- scripts/libmakepkg/util/parseopts.sh.in | 116 +++- test/scripts/parseopts_test.sh | 12 ++- 2 files changed, 83 insertions(+), 45 deletions(-) diff --git a/scripts/libmakepkg/util/parseopts

[pacman-dev] [PATCH v2] libmakepkg: fix empty arguments in parseopts

2019-11-04 Thread Ethan Sommer
Previously parseopts checked if there was an argument by checking that the string was non-empty, resulting in empty arguments being incorrectly considered non-existent. This change makes parseopts check if arguments exist at all, rather than checking that they are non-empty Signed-off-by: Ethan

[pacman-dev] [PATCH] makepkg: replace sed in-place with built-in substitution

2019-11-05 Thread Ethan Sommer
Read PKGBUILD into an array and replace the pkgver and pkgrel with bash parameter substitution, then use shell redirection to write to to the file. Because shell redirection follows symlinks, this accomplishes the same thing as the previous default of using the GNU-specific --follow-symlinks sed fl

[pacman-dev] [PATCH v2] makepkg: replaces sed in-place with built in substitution

2019-11-05 Thread Ethan Sommer
sed flag. Removes SEDPATH and SEDINPLACEFLAGS from the build systems as they are not used elsewhere. Signed-off-by: Ethan Sommer --- build-aux/edit-script.sh.in | 2 -- configure.ac| 11 --- meson.build | 11 --- meson_options.txt | 3

[pacman-dev] [PATCH] repo-add: use wc -c on stdin instead of file to avoid use of cut

2019-11-06 Thread Ethan Sommer
Redirect file to stdin so wc -c doesn't print a file name that needs to be stripped. Signed-off-by: Ethan Sommer --- scripts/repo-add.sh.in | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/repo-add.sh.in b/scripts/repo-add.sh.in index caf1232d..7b2a9edb 1

[pacman-dev] [PATCH 2/3] libmakepkg: use readelf instead of file for finding ELF file types

2019-11-26 Thread Ethan Sommer
Signed-off-by: Ethan Sommer --- scripts/libmakepkg/tidy/strip.sh.in | 26 -- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/scripts/libmakepkg/tidy/strip.sh.in b/scripts/libmakepkg/tidy/strip.sh.in index 1bd810f0..301d1989 100644 --- a/scripts/libmakepkg

[pacman-dev] [PATCH 1/3] libmakepkg: use extraction commands instead of file to find archive type

2019-11-26 Thread Ethan Sommer
able to extract the file and is the one to use Signed-off-by: Ethan Sommer --- scripts/libmakepkg/source/file.sh.in | 39 1 file changed, 11 insertions(+), 28 deletions(-) diff --git a/scripts/libmakepkg/source/file.sh.in b/scripts/libmakepkg/source/file.sh.in

[pacman-dev] [PATCH 3/3] remove mention of file as dependency and from build system

2019-11-26 Thread Ethan Sommer
Signed-off-by: Ethan Sommer --- build-aux/edit-script.sh.in | 1 - configure.ac| 12 meson.build | 9 - scripts/makepkg.sh.in | 4 +--- 4 files changed, 1 insertion(+), 25 deletions(-) diff --git a/build-aux/edit-script.sh.in b/build

Re: [pacman-dev] [PATCH 2/3] libmakepkg: use readelf instead of file for finding ELF file types

2019-11-27 Thread Ethan Sommer
> > --- a/scripts/libmakepkg/tidy/strip.sh.in > > +++ b/scripts/libmakepkg/tidy/strip.sh.in > > @@ -111,22 +111,20 @@ tidy_strip() { > > > > local binary strip_flags > > find . -type f -perm -u+w -print0 2>/dev/null | while IFS= > > read -rd '' binary ; do > > -