From cfd98a7131fb01278498eb80973ac03421a59907 Mon Sep 17 00:00:00 2001 From: "Stefano C. Coronado" Date: Mon, 30 Dec 2019 14:13:43 -0500 Subject: [PATCH 1/5] added ability to add extra step into generic dockerfile --- pkg-install | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/pkg-install b/pkg-install index bcfbfb2..ea94205 100755 --- a/pkg-install +++ b/pkg-install @@ -9,10 +9,12 @@ import subprocess parser = ArgumentParser(description="Install AUR packages into a Docker container") parser.add_argument("package_name", type=str, help="name of the AUR package") parser.add_argument("-x", type=str, metavar='EXECUTABLE', help="name of executable") +parser.add_argument("-e", type=str, help="edit generic dockerfile") args = vars(parser.parse_args()) package_name = args['package_name'] command = args['x'] +edit_flag = args['e'] user = getlogin() uid = getuid() gid = getgid() @@ -40,6 +42,14 @@ RUN git clone https://aur.archlinux.org/yay.git WORKDIR /home/{user}/yay RUN makepkg -si --noconfirm +""" +if edit_flag is not None: #if -e flag is passed then take on the following string + extra_run = f"""RUN {edit_flag}""" +else: + extra_run = "" + +dockerfile += extra_run + f""" + # Now you can play with whatever package you'd like RUN yay -S --noconfirm {package_name} From 82d6e7d7c7b28f11298e2125ef16fbcfa0904825 Mon Sep 17 00:00:00 2001 From: "Stefano C. Coronado" Date: Wed, 1 Jan 2020 23:05:05 -0500 Subject: [PATCH 2/5] resolved conditional suggestion and fixed arg help --- pkg-install | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/pkg-install b/pkg-install index ea94205..e609fd8 100755 --- a/pkg-install +++ b/pkg-install @@ -9,7 +9,7 @@ import subprocess parser = ArgumentParser(description="Install AUR packages into a Docker container") parser.add_argument("package_name", type=str, help="name of the AUR package") parser.add_argument("-x", type=str, metavar='EXECUTABLE', help="name of executable") -parser.add_argument("-e", type=str, help="edit generic dockerfile") +parser.add_argument("-e", type=str, help="add extra step in dockerfile") args = vars(parser.parse_args()) package_name = args['package_name'] @@ -42,13 +42,8 @@ RUN git clone https://aur.archlinux.org/yay.git WORKDIR /home/{user}/yay RUN makepkg -si --noconfirm -""" -if edit_flag is not None: #if -e flag is passed then take on the following string - extra_run = f"""RUN {edit_flag}""" -else: - extra_run = "" - -dockerfile += extra_run + f""" +#add extra step +{"RUN " + edit_flag if edit_flag is None else ""} # Now you can play with whatever package you'd like RUN yay -S --noconfirm {package_name} From b3fed042572b6f3c0a474dc61bacfdd8021ff6ce Mon Sep 17 00:00:00 2001 From: "Stefano C. Coronado" Date: Wed, 1 Jan 2020 23:23:45 -0500 Subject: [PATCH 3/5] mend --- pkg-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg-install b/pkg-install index e609fd8..0f21097 100755 --- a/pkg-install +++ b/pkg-install @@ -43,7 +43,7 @@ WORKDIR /home/{user}/yay RUN makepkg -si --noconfirm #add extra step -{"RUN " + edit_flag if edit_flag is None else ""} +{"RUN " + edit_flag if edit_flag is not None else ""} # Now you can play with whatever package you'd like RUN yay -S --noconfirm {package_name} From e896ca8365b8ccc9b2a8ed8fa32285a005cfd6e0 Mon Sep 17 00:00:00 2001 From: "Stefano C. Coronado" Date: Wed, 1 Jan 2020 23:25:58 -0500 Subject: [PATCH 4/5] Revert "resolved conditional suggestion and fixed arg help" This reverts commit 82d6e7d7c7b28f11298e2125ef16fbcfa0904825. --- pkg-install | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/pkg-install b/pkg-install index 0f21097..69cb424 100755 --- a/pkg-install +++ b/pkg-install @@ -9,7 +9,7 @@ import subprocess parser = ArgumentParser(description="Install AUR packages into a Docker container") parser.add_argument("package_name", type=str, help="name of the AUR package") parser.add_argument("-x", type=str, metavar='EXECUTABLE', help="name of executable") -parser.add_argument("-e", type=str, help="add extra step in dockerfile") +parser.add_argument("-e", type=str, help="edit generic dockerfile") args = vars(parser.parse_args()) package_name = args['package_name'] @@ -45,6 +45,7 @@ RUN makepkg -si --noconfirm #add extra step {"RUN " + edit_flag if edit_flag is not None else ""} + # Now you can play with whatever package you'd like RUN yay -S --noconfirm {package_name} From 1b61633513e18065ce1ee12b6179dad5559901b8 Mon Sep 17 00:00:00 2001 From: "Stefano C. Coronado" Date: Wed, 1 Jan 2020 23:27:39 -0500 Subject: [PATCH 5/5] fixed arg help undone in revert --- pkg-install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg-install b/pkg-install index 69cb424..4477dcb 100755 --- a/pkg-install +++ b/pkg-install @@ -9,7 +9,7 @@ import subprocess parser = ArgumentParser(description="Install AUR packages into a Docker container") parser.add_argument("package_name", type=str, help="name of the AUR package") parser.add_argument("-x", type=str, metavar='EXECUTABLE', help="name of executable") -parser.add_argument("-e", type=str, help="edit generic dockerfile") +parser.add_argument("-e", type=str, help="add extra step in dockerfile") args = vars(parser.parse_args()) package_name = args['package_name']