├── reponames ├── aur ├── githubcustom ├── githubcustom2 ├── githubcustom3 ├── githubcustom4 ├── githubcustom5 ├── gitlab-core ├── gitlab-extra ├── gitlab-temp ├── gitlab-community ├── gitlab-multilib ├── gitlab-kde-unstable └── github1 ├── PKGBUILD ├── README.md ├── autogit.conf ├── LICENSE └── autogit /reponames/aur: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #yaru 5 | #oh-my-zsh-git -------------------------------------------------------------------------------- /reponames/githubcustom: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #excalibur1234/pacui -------------------------------------------------------------------------------- /reponames/githubcustom2: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #excalibur1234/pacui -------------------------------------------------------------------------------- /reponames/githubcustom3: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #excalibur1234/pacui -------------------------------------------------------------------------------- /reponames/githubcustom4: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #excalibur1234/pacui -------------------------------------------------------------------------------- /reponames/githubcustom5: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #excalibur1234/pacui -------------------------------------------------------------------------------- /reponames/gitlab-core: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #packages/core/mhwd 5 | -------------------------------------------------------------------------------- /reponames/gitlab-extra: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #packages/extra/conky 5 | -------------------------------------------------------------------------------- /reponames/gitlab-temp: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #packages/temp/qt5-webengine 5 | -------------------------------------------------------------------------------- /reponames/gitlab-community: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #packages/community/gamemode 5 | -------------------------------------------------------------------------------- /reponames/gitlab-multilib: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #packages/multilib/steam-manjaro 5 | -------------------------------------------------------------------------------- /reponames/gitlab-kde-unstable: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #packages/kde-unstable/libraries-git/plasma-wayland-protocols-git 5 | -------------------------------------------------------------------------------- /reponames/github1: -------------------------------------------------------------------------------- 1 | # Commenting with '#' is allowed to ignore applications. 2 | # Use one application per line and place optional dependencies before the final package. 3 | # Example: 4 | #excalibur1234/pacui 5 | #puxplaying/autogit 6 | #puxplaying/manjaro-update 7 | #puxplaying/toolbox 8 | #puxplaying/mutter-x11-scaling -------------------------------------------------------------------------------- /PKGBUILD: -------------------------------------------------------------------------------- 1 | # Maintainer: Georg Wagner 2 | 3 | pkgname=autogit 4 | pkgver=2.1.0 5 | pkgrel=1 6 | pkgdesc="Auto build, update, install PKGBUILDS from Github, Gitlab and AUR" 7 | arch=('any') 8 | url="https://github.com/puxplaying/autogit" 9 | license=('GPL-3.0-or-later') 10 | depends=( 11 | 'bash' 12 | 'curl' 13 | 'fzf' 14 | 'pacman' 15 | 'rsync' 16 | 'sudo' 17 | ) 18 | optdepends=( 19 | 'manjaro-chrootbuild: Needed for Manjaro clean chroot package building' 20 | 'devtools: Needed for Arch Linux clean chroot package building' 21 | ) 22 | backup=("etc/$pkgname/$pkgname.conf") 23 | source=("$pkgname-$pkgver.tar.gz::$url/archive/$pkgver.tar.gz") 24 | sha256sums=('ef404014ed3a3c0c7fe487de9739bcba59bd8c783021f60f9dfbd8188ed61a7c') 25 | 26 | package () { 27 | cd "$pkgname-$pkgver" 28 | install -Dm755 "$pkgname" -t "$pkgdir/usr/bin/" 29 | install -Dm644 "$pkgname.conf" -t "$pkgdir/etc/$pkgname/" 30 | cp -r reponames "$pkgdir/etc/$pkgname/" 31 | } 32 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # autogit 2 | 3 | Autogit is a Bash tool to automatically build, update or install Pacman applications from PKGBUILD's available on Github, Gitlab and AUR via configurable `makepkg`, [`devtools`](https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot#Convenience_way), or Manjaro `chrootbuild` commands. It can also create automatically repo names like *core*, *extra*, *community* and create/update a repo database file via `repo-add`. Additionally it clears each local repo with `paccache` to only keep the latest package version. 4 | 5 | Basically if you want to avoid a "git clone" and the rest of the procedure each time a PKGBUILD has been updated and trust the source, then this tool might be for you. Here are some examples: 6 | - Auto create your own local repositories, add them to `/etc/pacman.conf` and update with Pacman. 7 | - Compile packages from different sources into one repository while building all in a clean "chroot", e.g. AUR, Gitlab, Github. 8 | - Compile the same package from different branches into different repositories, or add a "-git" PKGBUILD for development on a different branch etc. 9 | - Use "makepkg" to directly install packages after compilation. 10 | 11 | Two different options are available to compare and update applications. In case of a "-git" package it checks for the latest commit to update and can either run once or in a loop with a timer setting. 12 | 13 | More information on how to set it up is available in [autogit.conf](https://github.com/puxplaying/autogit/blob/master/autogit.conf), examples are included. 14 | 15 | Currently the AUR, 6 Github and 6 Gitlab sources are available to use. There is no limitation of packages for each source, which need to be added to the *reponames* folder source files. 16 | 17 | In sum 13 different repos can be enabled/created and will be updated together. 18 | 19 | --- 20 | 21 | How to install: 22 | 23 | This package is available on [Manjaro](https://packages.manjaro.org/?query=autogit) and the [AUR](https://aur.archlinux.org/packages/autogit). 24 | 25 | From source: 26 | 27 | - `sudo pacman -Syu base-devel git` 28 | - `git clone https://github.com/puxplaying/autogit.git ` 29 | - `cd autogit` 30 | - `makepkg -srci` 31 | 32 | --- 33 | 34 | How to run: 35 | 36 | - Run `autogit` after installation to create a local configuration 37 | - `autogit -h` (Help Page and fzf-UI options to manage packages) 38 | 39 | ``` 40 | Welcome to Autogit's Help Page! 41 | 42 | Autogit runs by default without flags. 43 | In order to run autogit, edit the options in 44 | "/YourDirectory/autogit/autogit.conf" 45 | 46 | The provided flags will run a fzf UI to manage packages. 47 | 48 | autogit [options]: 49 | 50 | -e, --edit - [EDIT] 51 | Edit Package List Entries (Commenting With '#' Is Supported) 52 | NOTE: Make Sure That The (EDITOR) Environment Variable Is Set On Your System! 53 | 54 | -d, --dryrun - [DRY RUN] 55 | Dry Run To Remove Packages - (Nothing Will Be Touched) 56 | 57 | -b, --build - [REBUILD PACKAGES] 58 | Remove Package Source(s), Binary(s) And Rebuild The Packge(s) 59 | 60 | -r, --remove - [REMOVE PACKAGES] 61 | Remove Package Source(s), Binary(s), Package List Entry(s), 62 | Old Database Files And Run "repo-add" If Enabled 63 | 64 | -h, --help - This Help Text 65 | ``` 66 | 67 | To run it automatically without a password prompt for `chrootbuild`, it can be added to `sudoers` via: 68 | 69 | `echo "$USER ALL = NOPASSWD: /usr/bin/chrootbuild" | sudo tee /etc/sudoers.d/$USER` 70 | 71 | --- 72 | 73 | ![123](https://user-images.githubusercontent.com/28549766/103438530-0b81d300-4c34-11eb-9ea1-a49542fabc4f.png) 74 | -------------------------------------------------------------------------------- /autogit.conf: -------------------------------------------------------------------------------- 1 | # This is the main autogit configuration file. 2 | # By default autogit will create a local configuration in "$HOME" on the first run. 3 | # 4 | # To use autogit, this file needs to be changed according to the preferred Github, 5 | # Gitlab or AUR source which is containing the PKGBUILD for the application you 6 | # want to build. 7 | # 8 | # The application names are stored in the "reponames" folder and 9 | # need to be set manually in the provided example files. Each file belongs to a 10 | # "*SOURCE*" setting inside this configuration file and can be changed. 11 | # In sum 13 different sources can be enabled and will be updated together, 12 | # 6 Github, 6 Gitlab and 1 AUR source. 13 | # This is useful if you want to update different repos with each repo having a 14 | # separate binary folder. For example: core, extra, community... 15 | # 16 | # Use the options by uncommenting SETGITHUBREPO etc. in the settings below for 17 | # each source. 18 | # Autogit can be run either in a loop with a timer or as a single run. 19 | # 20 | # Use "autogit -h" for more options to maintain packages in a fzf-UI. 21 | # 22 | # The settings are described below: 23 | # 24 | # -----------------------| 25 | # Local configuration file update check: 26 | # This check is required to automatically inform about upstream "autogit.conf" 27 | # changes on package updates, that need to be merged with the local configuration. 28 | # This is the default behavior for easy access to the configuration file. 29 | # 30 | # A alternative would be to delete this file in "~/autogit" and "~/.config/autogit", 31 | # to use the "/etc/autogit/autogit.conf" instead which - 32 | # if changed could be merged with a ".pacnew" file on package updates. 33 | # Please only change this setting when merging a new configuration or when prompted! 34 | # 35 | CONFVER=2.0.0 36 | # 37 | # -----------------------| 38 | # Set default update method: 39 | # There are 2 available modes to check for updates. 40 | # 41 | # 1 = Fast Check: Compare "pkgver"+"pkgrel" and "sha512sums" of PKGBUILD's via "curl". 42 | # (This is a fast, secure and resource friendly way to check for package updates.) 43 | # 44 | # 2 = Secure Check: Compare "pkgver"+"pkgrel" of created ".SRCINFO" files and 45 | # "sha512sums" of "PKGBUILD's" via "git" & "makepkg". 46 | # (This check is the most accurate, but is also the slowest and very CPU-intensive. 47 | # It requires the use of "git" & "makepkg".) 48 | # 49 | UPDCHECK=1 50 | # 51 | # -----------------------| 52 | # Set default build method: 53 | # 54 | # Arch "devtools" - Convenience way option: 55 | # https://wiki.archlinux.org/title/DeveloperWiki:Building_in_a_clean_chroot#Convenience_way 56 | # The first argument starts with one of the supported build scripts ("extra-x86_64-build" "multilib-build") etc. 57 | # Edit the options and select "var=3" below to use it. 58 | MBARG1=multilib-build 59 | MBARG2=-c 60 | MBARG3= 61 | MBARG4= 62 | # 63 | # Default Manjaro "chrootbuild" command for unstable, 64 | # edit the options and select "var=2" below to use it. 65 | # Default = "chrootbuild -b unstable -c -p" 66 | MCARG1=-b 67 | MCARG2=unstable 68 | MCARG3=-c 69 | MCARG4=-m 70 | MCARG5=-H 71 | MCARG6=-p 72 | # 73 | # Default "makepkg" command, edit the options and select "var=1" below to use it. 74 | # Default = "makepkg -s -r -c" 75 | MARG1=-s 76 | MARG2=-r 77 | MARG3=-c 78 | MARG4=--noconfirm 79 | MARG5= 80 | MARG6= 81 | # 82 | # Options: 83 | # 3 = Arch "devtools" - Convenience way option #Customizeable 84 | # 2 = Manjaro "chrootbuild" #Customizeable 85 | # 1 = makepkg -src (makepkg only building) #Customizeable 86 | # 0 = makepkg -srci (makepkg with installation) 87 | # 88 | var=1 89 | # 90 | # -----------------------| 91 | # Timer setting in seconds for the auto mode below 92 | timer=600 93 | # 94 | # -----------------------| 95 | # 1 = Run the script in a loop with the above timer setting 96 | # 2 = Run the script manually 97 | mode=2 98 | # 99 | # -----------------------| 100 | # Local Pacman repository database file generation and update via "repo-add" 101 | # 0 = Off 102 | # 1 = On 103 | REPOADD=0 104 | # 105 | # Modify the default "repo-add" command. For more information see: "repo-add -h" 106 | REPOADDCMD="repo-add" 107 | # 108 | # -----------------------| 109 | # Sync all enabled repositories to a custom location via "rsync", for example to: "/etc/pacman.d" 110 | # This functionality may require root access depending on the destination location and only works if "REPOADD" is enabled. 111 | # 0 = Off 112 | # 1 = On 113 | REPOSYNC=0 114 | # 115 | # Set the destination location here: 116 | REPOPATH="/etc/pacman.d" 117 | # 118 | # Modify the default rsync command. For more information see: "rsync -h" 119 | RSYNCCMD="rsync --archive --delete" 120 | # 121 | # -----------------------| 122 | ##################### 123 | ### GITHUB REPO 1 ### 124 | ##################### 125 | # Configure the URL for Github master branch 126 | # Uncomment to SETGITHUBREPO=1 to enable this function 127 | #SETGITHUBREPO=1 128 | # 129 | # This is the default URL for "git clone" 130 | # GITHUBCLONEURLC=https://github.com/ 131 | GITHUBCLONEURLC=https://github.com/ 132 | # 133 | # This is the default URL to the PKGBUILD 134 | # GITHUBURLC=https://raw.githubusercontent.com/ 135 | GITHUBURLC=https://raw.githubusercontent.com/ 136 | # 137 | # This is the targeting branch 138 | # BRANCH=master 139 | BRANCH=master 140 | # 141 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 142 | GITHUBBINARY=repo 143 | # 144 | # Reponames config files 145 | GITHUBSOURCE=$DIR/reponames/github1 146 | # 147 | # -----------------------| 148 | ##################### 149 | ### GITHUB REPO 2 ### 150 | ##################### 151 | # Configure the URL for Github extra repo 152 | # Uncomment to SETCUSTGITHUBREPO=1 to enable this function 153 | #SETCUSTGITHUBREPO=1 154 | # 155 | # This is the default URL for "git clone" 156 | # GITHUBCLONEURLCCUSTOM=https://github.com/ 157 | GITHUBCLONEURLCCUSTOM=https://github.com/ 158 | # 159 | # This is the default URL to the PKGBUILD 160 | # GITHUBURLCCUSTOM=https://raw.githubusercontent.com/ 161 | GITHUBURLCCUSTOM=https://raw.githubusercontent.com/ 162 | # 163 | # This is the targeting branch 164 | # BRANCHCUSTOM=master 165 | BRANCHCUSTOM=master 166 | # 167 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 168 | GITHUBBINARYCUSTOM=githubcustom 169 | # 170 | # Reponames config files 171 | GITHUBSOURCECUSTOM=$DIR/reponames/githubcustom 172 | # 173 | # -----------------------| 174 | ##################### 175 | ### GITHUB REPO 3 ### 176 | ##################### 177 | # Configure the URL for Github extra repo 2 178 | # Uncomment to SETCUSTGITHUBREPO2=1 to enable this function 179 | #SETCUSTGITHUBREPO2=1 180 | # 181 | # This is the default URL for "git clone" 182 | # GITHUBCLONEURLCCUSTOM2=https://github.com/ 183 | GITHUBCLONEURLCCUSTOM2=https://github.com/ 184 | # 185 | # This is the default URL to the PKGBUILD 186 | # GITHUBURLCCUSTOM2=https://raw.githubusercontent.com/ 187 | GITHUBURLCCUSTOM2=https://raw.githubusercontent.com/ 188 | # 189 | # This is the targeting branch 190 | # BRANCHCUSTOM2=master 191 | BRANCHCUSTOM2=master 192 | # 193 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 194 | GITHUBBINARYCUSTOM2=githubcustom2 195 | # 196 | # Reponames config files 197 | GITHUBSOURCECUSTOM2=$DIR/reponames/githubcustom2 198 | # 199 | # -----------------------| 200 | ##################### 201 | ### GITHUB REPO 4 ### 202 | ##################### 203 | # Configure the URL for Github extra repo 3 204 | # Uncomment to SETCUSTGITHUBREPO3=1 to enable this function 205 | #SETCUSTGITHUBREPO3=1 206 | # 207 | # This is the default URL for "git clone" 208 | # GITHUBCLONEURLCCUSTOM3=https://github.com/ 209 | GITHUBCLONEURLCCUSTOM3=https://github.com/ 210 | # 211 | # This is the default URL to the PKGBUILD 212 | # GITHUBURLCCUSTOM3=https://raw.githubusercontent.com/ 213 | GITHUBURLCCUSTOM3=https://raw.githubusercontent.com/ 214 | # 215 | # This is the targeting branch 216 | # BRANCHCUSTOM3=master 217 | BRANCHCUSTOM3=master 218 | # 219 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 220 | GITHUBBINARYCUSTOM3=githubcustom3 221 | # 222 | # Reponames config files 223 | GITHUBSOURCECUSTOM3=$DIR/reponames/githubcustom3 224 | # 225 | # -----------------------| 226 | ##################### 227 | ### GITHUB REPO 5 ### 228 | ##################### 229 | # Configure the URL for Github extra repo 4 230 | # Uncomment to SETCUSTGITHUBREPO4=1 to enable this function 231 | #SETCUSTGITHUBREPO4=1 232 | # 233 | # This is the default URL for "git clone" 234 | # GITHUBCLONEURLCCUSTOM4=https://github.com/ 235 | GITHUBCLONEURLCCUSTOM4=https://github.com/ 236 | # 237 | # This is the default URL to the PKGBUILD 238 | # GITHUBURLCCUSTOM4=https://raw.githubusercontent.com/ 239 | GITHUBURLCCUSTOM4=https://raw.githubusercontent.com/ 240 | # 241 | # This is the targeting branch 242 | # BRANCHCUSTOM4=master 243 | BRANCHCUSTOM4=master 244 | # 245 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 246 | GITHUBBINARYCUSTOM4=githubcustom4 247 | # 248 | # Reponames config files 249 | GITHUBSOURCECUSTOM4=$DIR/reponames/githubcustom4 250 | # 251 | # -----------------------| 252 | ##################### 253 | ### GITHUB REPO 6 ### 254 | ##################### 255 | # Configure the URL for Github extra repo 5 256 | # Uncomment to SETCUSTGITHUBREPO5=1 to enable this function 257 | #SETCUSTGITHUBREPO5=1 258 | # 259 | # This is the default URL for "git clone" 260 | # GITHUBCLONEURLCCUSTOM5=https://github.com/ 261 | GITHUBCLONEURLCCUSTOM5=https://github.com/ 262 | # 263 | # This is the default URL to the PKGBUILD 264 | # GITHUBURLCCUSTOM5=https://raw.githubusercontent.com/ 265 | GITHUBURLCCUSTOM5=https://raw.githubusercontent.com/ 266 | # 267 | # This is the targeting branch 268 | # BRANCHCUSTOM5=master 269 | BRANCHCUSTOM5=master 270 | # 271 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 272 | GITHUBBINARYCUSTOM5=githubcustom5 273 | # 274 | # Reponames config files 275 | GITHUBSOURCECUSTOM5=$DIR/reponames/githubcustom5 276 | # 277 | # -----------------------| 278 | ##################### 279 | ### GITLAB REPO 1 ### 280 | ##################### 281 | # Configure the URL for Gitlab 282 | # Uncomment to SETGITLABREPO=1 to enable this function 283 | #SETGITLABREPO=1 284 | # 285 | # This is the default URL for "git clone" 286 | # GITLABCLONEURL=https://gitlab.manjaro.org/ 287 | GITLABCLONEURL=https://gitlab.manjaro.org/ 288 | # 289 | # This is the default URL to the PKGBUILD 290 | # GITLABURLC=https://gitlab.manjaro.org/ 291 | GITLABURLC=https://gitlab.manjaro.org/ 292 | # 293 | # This is the targeting branch 294 | # BRANCHGITLAB=master 295 | BRANCHGITLAB=master 296 | # 297 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 298 | GITLABBINARY=core 299 | # 300 | # Reponames config files 301 | GITLABSOURCE=$DIR/reponames/gitlab-core 302 | # 303 | # -----------------------| 304 | ##################### 305 | ### GITLAB REPO 2 ### 306 | ##################### 307 | # Configure the URL for Gitlab extra repo 308 | # Uncomment to SETGITLABREPOCUSTOM=1 to enable this function 309 | #SETGITLABREPOCUSTOM=1 310 | # 311 | # This is the default URL for "git clone" 312 | # GITLABCLONEURLCUSTOM=https://gitlab.manjaro.org/ 313 | GITLABCLONEURLCUSTOM=https://gitlab.manjaro.org/ 314 | # 315 | # This is the default URL to the PKGBUILD 316 | # GITLABURLCCUSTOM=https://gitlab.manjaro.org/ 317 | GITLABURLCCUSTOM=https://gitlab.manjaro.org/ 318 | # 319 | # This is the targeting branch 320 | # BRANCHGITLABCUSTOM=master 321 | BRANCHGITLABCUSTOM=master 322 | # 323 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 324 | GITLABBINARYCUSTOM=extra 325 | # 326 | # Reponames config files 327 | GITLABSOURCECUSTOM=$DIR/reponames/gitlab-extra 328 | # 329 | # -----------------------| 330 | ##################### 331 | ### GITLAB REPO 3 ### 332 | ##################### 333 | # Configure the URL for Gitlab extra repo 2 334 | # Uncomment to SETGITLABREPOCUSTOM2=1 to enable this function 335 | #SETGITLABREPOCUSTOM2=1 336 | # 337 | # This is the default URL for "git clone" 338 | # GITLABCLONEURLCUSTOM2=https://gitlab.manjaro.org/ 339 | GITLABCLONEURLCUSTOM2=https://gitlab.manjaro.org/ 340 | # 341 | # This is the default URL to the PKGBUILD 342 | # GITLABURLCCUSTOM2=https://gitlab.manjaro.org/ 343 | GITLABURLCCUSTOM2=https://gitlab.manjaro.org/ 344 | # 345 | # This is the targeting branch 346 | # BRANCHGITLABCUSTOM2=master 347 | BRANCHGITLABCUSTOM2=master 348 | # 349 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 350 | GITLABBINARYCUSTOM2=community 351 | # 352 | # Reponames config files 353 | GITLABSOURCECUSTOM2=$DIR/reponames/gitlab-community 354 | # 355 | # -----------------------| 356 | ##################### 357 | ### GITLAB REPO 4 ### 358 | ##################### 359 | # Configure the URL for Gitlab extra repo 3 360 | # Uncomment to SETGITLABREPOCUSTOM3=1 to enable this function 361 | #SETGITLABREPOCUSTOM3=1 362 | # 363 | # This is the default URL for "git clone" 364 | # GITLABCLONEURLCUSTOM3=https://gitlab.manjaro.org/ 365 | GITLABCLONEURLCUSTOM3=https://gitlab.manjaro.org/ 366 | # 367 | # This is the default URL to the PKGBUILD 368 | # GITLABURLCCUSTOM3=https://gitlab.manjaro.org/ 369 | GITLABURLCCUSTOM3=https://gitlab.manjaro.org/ 370 | # 371 | # This is the targeting branch 372 | # BRANCHGITLABCUSTOM3=master 373 | BRANCHGITLABCUSTOM3=master 374 | # 375 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 376 | GITLABBINARYCUSTOM3=multilib 377 | # 378 | # Reponames config files 379 | GITLABSOURCECUSTOM3=$DIR/reponames/gitlab-multilib 380 | # 381 | # -----------------------| 382 | ##################### 383 | ### GITLAB REPO 5 ### 384 | ##################### 385 | # Configure the URL for Gitlab extra repo 4 386 | # Uncomment to SETGITLABREPOCUSTOM4=1 to enable this function 387 | #SETGITLABREPOCUSTOM4=1 388 | # 389 | # This is the default URL for "git clone" 390 | # GITLABCLONEURLCUSTOM4=https://gitlab.manjaro.org/ 391 | GITLABCLONEURLCUSTOM4=https://gitlab.manjaro.org/ 392 | # 393 | # This is the default URL to the PKGBUILD 394 | # GITLABURLCCUSTOM4=https://gitlab.manjaro.org/ 395 | GITLABURLCCUSTOM4=https://gitlab.manjaro.org/ 396 | # 397 | # This is the targeting branch 398 | # BRANCHGITLABCUSTOM4=master 399 | BRANCHGITLABCUSTOM4=master 400 | # 401 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 402 | GITLABBINARYCUSTOM4=kde-unstable 403 | # 404 | # Reponames config files 405 | GITLABSOURCECUSTOM4=$DIR/reponames/gitlab-kde-unstable 406 | # 407 | # -----------------------| 408 | ##################### 409 | ### GITLAB REPO 6 ### 410 | ##################### 411 | # Configure the URL for Gitlab extra repo 5 412 | # Uncomment to SETGITLABREPOCUSTOM5=1 to enable this function 413 | #SETGITLABREPOCUSTOM5=1 414 | # 415 | # This is the default URL for "git clone" 416 | # GITLABCLONEURLCUSTOM5=https://gitlab.manjaro.org/ 417 | GITLABCLONEURLCUSTOM5=https://gitlab.manjaro.org/ 418 | # 419 | # This is the default URL to the PKGBUILD 420 | # GITLABURLCCUSTOM5=https://gitlab.manjaro.org/ 421 | GITLABURLCCUSTOM5=https://gitlab.manjaro.org/ 422 | # 423 | # This is the targeting branch 424 | # BRANCHGITLABCUSTOM5=master 425 | BRANCHGITLABCUSTOM5=master 426 | # 427 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 428 | GITLABBINARYCUSTOM5=temp 429 | # 430 | # Reponames config files 431 | GITLABSOURCECUSTOM5=$DIR/reponames/gitlab-temp 432 | # 433 | # -----------------------| 434 | ################ 435 | ### AUR REPO ### 436 | ################ 437 | # Configure the URL for the AUR 438 | # Uncomment to AURREPO=1 to enable this function 439 | #AURREPO=1 440 | # 441 | AURCLONEURL=https://aur.archlinux.org/cgit/aur.git/plain/PKGBUILD?h= 442 | # 443 | AURURL=https://aur.archlinux.org/ 444 | # 445 | # Binary Folder (Change according to repo names you want to have e.g. core, community etc.) 446 | AURBINARY=aur 447 | # 448 | # Reponames config files 449 | AURSOURCE=$DIR/reponames/aur 450 | # 451 | # -----------------------| 452 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 3, 29 June 2007 3 | 4 | Copyright (C) 2007 Free Software Foundation, Inc. 5 | Everyone is permitted to copy and distribute verbatim copies 6 | of this license document, but changing it is not allowed. 7 | 8 | Preamble 9 | 10 | The GNU General Public License is a free, copyleft license for 11 | software and other kinds of works. 12 | 13 | The licenses for most software and other practical works are designed 14 | to take away your freedom to share and change the works. By contrast, 15 | the GNU General Public License is intended to guarantee your freedom to 16 | share and change all versions of a program--to make sure it remains free 17 | software for all its users. We, the Free Software Foundation, use the 18 | GNU General Public License for most of our software; it applies also to 19 | any other work released this way by its authors. You can apply it to 20 | your programs, too. 21 | 22 | When we speak of free software, we are referring to freedom, not 23 | price. Our General Public Licenses are designed to make sure that you 24 | have the freedom to distribute copies of free software (and charge for 25 | them if you wish), that you receive source code or can get it if you 26 | want it, that you can change the software or use pieces of it in new 27 | free programs, and that you know you can do these things. 28 | 29 | To protect your rights, we need to prevent others from denying you 30 | these rights or asking you to surrender the rights. Therefore, you have 31 | certain responsibilities if you distribute copies of the software, or if 32 | you modify it: responsibilities to respect the freedom of others. 33 | 34 | For example, if you distribute copies of such a program, whether 35 | gratis or for a fee, you must pass on to the recipients the same 36 | freedoms that you received. You must make sure that they, too, receive 37 | or can get the source code. And you must show them these terms so they 38 | know their rights. 39 | 40 | Developers that use the GNU GPL protect your rights with two steps: 41 | (1) assert copyright on the software, and (2) offer you this License 42 | giving you legal permission to copy, distribute and/or modify it. 43 | 44 | For the developers' and authors' protection, the GPL clearly explains 45 | that there is no warranty for this free software. For both users' and 46 | authors' sake, the GPL requires that modified versions be marked as 47 | changed, so that their problems will not be attributed erroneously to 48 | authors of previous versions. 49 | 50 | Some devices are designed to deny users access to install or run 51 | modified versions of the software inside them, although the manufacturer 52 | can do so. This is fundamentally incompatible with the aim of 53 | protecting users' freedom to change the software. The systematic 54 | pattern of such abuse occurs in the area of products for individuals to 55 | use, which is precisely where it is most unacceptable. Therefore, we 56 | have designed this version of the GPL to prohibit the practice for those 57 | products. If such problems arise substantially in other domains, we 58 | stand ready to extend this provision to those domains in future versions 59 | of the GPL, as needed to protect the freedom of users. 60 | 61 | Finally, every program is threatened constantly by software patents. 62 | States should not allow patents to restrict development and use of 63 | software on general-purpose computers, but in those that do, we wish to 64 | avoid the special danger that patents applied to a free program could 65 | make it effectively proprietary. To prevent this, the GPL assures that 66 | patents cannot be used to render the program non-free. 67 | 68 | The precise terms and conditions for copying, distribution and 69 | modification follow. 70 | 71 | TERMS AND CONDITIONS 72 | 73 | 0. Definitions. 74 | 75 | "This License" refers to version 3 of the GNU General Public License. 76 | 77 | "Copyright" also means copyright-like laws that apply to other kinds of 78 | works, such as semiconductor masks. 79 | 80 | "The Program" refers to any copyrightable work licensed under this 81 | License. Each licensee is addressed as "you". "Licensees" and 82 | "recipients" may be individuals or organizations. 83 | 84 | To "modify" a work means to copy from or adapt all or part of the work 85 | in a fashion requiring copyright permission, other than the making of an 86 | exact copy. The resulting work is called a "modified version" of the 87 | earlier work or a work "based on" the earlier work. 88 | 89 | A "covered work" means either the unmodified Program or a work based 90 | on the Program. 91 | 92 | To "propagate" a work means to do anything with it that, without 93 | permission, would make you directly or secondarily liable for 94 | infringement under applicable copyright law, except executing it on a 95 | computer or modifying a private copy. Propagation includes copying, 96 | distribution (with or without modification), making available to the 97 | public, and in some countries other activities as well. 98 | 99 | To "convey" a work means any kind of propagation that enables other 100 | parties to make or receive copies. Mere interaction with a user through 101 | a computer network, with no transfer of a copy, is not conveying. 102 | 103 | An interactive user interface displays "Appropriate Legal Notices" 104 | to the extent that it includes a convenient and prominently visible 105 | feature that (1) displays an appropriate copyright notice, and (2) 106 | tells the user that there is no warranty for the work (except to the 107 | extent that warranties are provided), that licensees may convey the 108 | work under this License, and how to view a copy of this License. If 109 | the interface presents a list of user commands or options, such as a 110 | menu, a prominent item in the list meets this criterion. 111 | 112 | 1. Source Code. 113 | 114 | The "source code" for a work means the preferred form of the work 115 | for making modifications to it. "Object code" means any non-source 116 | form of a work. 117 | 118 | A "Standard Interface" means an interface that either is an official 119 | standard defined by a recognized standards body, or, in the case of 120 | interfaces specified for a particular programming language, one that 121 | is widely used among developers working in that language. 122 | 123 | The "System Libraries" of an executable work include anything, other 124 | than the work as a whole, that (a) is included in the normal form of 125 | packaging a Major Component, but which is not part of that Major 126 | Component, and (b) serves only to enable use of the work with that 127 | Major Component, or to implement a Standard Interface for which an 128 | implementation is available to the public in source code form. A 129 | "Major Component", in this context, means a major essential component 130 | (kernel, window system, and so on) of the specific operating system 131 | (if any) on which the executable work runs, or a compiler used to 132 | produce the work, or an object code interpreter used to run it. 133 | 134 | The "Corresponding Source" for a work in object code form means all 135 | the source code needed to generate, install, and (for an executable 136 | work) run the object code and to modify the work, including scripts to 137 | control those activities. However, it does not include the work's 138 | System Libraries, or general-purpose tools or generally available free 139 | programs which are used unmodified in performing those activities but 140 | which are not part of the work. For example, Corresponding Source 141 | includes interface definition files associated with source files for 142 | the work, and the source code for shared libraries and dynamically 143 | linked subprograms that the work is specifically designed to require, 144 | such as by intimate data communication or control flow between those 145 | subprograms and other parts of the work. 146 | 147 | The Corresponding Source need not include anything that users 148 | can regenerate automatically from other parts of the Corresponding 149 | Source. 150 | 151 | The Corresponding Source for a work in source code form is that 152 | same work. 153 | 154 | 2. Basic Permissions. 155 | 156 | All rights granted under this License are granted for the term of 157 | copyright on the Program, and are irrevocable provided the stated 158 | conditions are met. This License explicitly affirms your unlimited 159 | permission to run the unmodified Program. The output from running a 160 | covered work is covered by this License only if the output, given its 161 | content, constitutes a covered work. This License acknowledges your 162 | rights of fair use or other equivalent, as provided by copyright law. 163 | 164 | You may make, run and propagate covered works that you do not 165 | convey, without conditions so long as your license otherwise remains 166 | in force. You may convey covered works to others for the sole purpose 167 | of having them make modifications exclusively for you, or provide you 168 | with facilities for running those works, provided that you comply with 169 | the terms of this License in conveying all material for which you do 170 | not control copyright. Those thus making or running the covered works 171 | for you must do so exclusively on your behalf, under your direction 172 | and control, on terms that prohibit them from making any copies of 173 | your copyrighted material outside their relationship with you. 174 | 175 | Conveying under any other circumstances is permitted solely under 176 | the conditions stated below. Sublicensing is not allowed; section 10 177 | makes it unnecessary. 178 | 179 | 3. Protecting Users' Legal Rights From Anti-Circumvention Law. 180 | 181 | No covered work shall be deemed part of an effective technological 182 | measure under any applicable law fulfilling obligations under article 183 | 11 of the WIPO copyright treaty adopted on 20 December 1996, or 184 | similar laws prohibiting or restricting circumvention of such 185 | measures. 186 | 187 | When you convey a covered work, you waive any legal power to forbid 188 | circumvention of technological measures to the extent such circumvention 189 | is effected by exercising rights under this License with respect to 190 | the covered work, and you disclaim any intention to limit operation or 191 | modification of the work as a means of enforcing, against the work's 192 | users, your or third parties' legal rights to forbid circumvention of 193 | technological measures. 194 | 195 | 4. Conveying Verbatim Copies. 196 | 197 | You may convey verbatim copies of the Program's source code as you 198 | receive it, in any medium, provided that you conspicuously and 199 | appropriately publish on each copy an appropriate copyright notice; 200 | keep intact all notices stating that this License and any 201 | non-permissive terms added in accord with section 7 apply to the code; 202 | keep intact all notices of the absence of any warranty; and give all 203 | recipients a copy of this License along with the Program. 204 | 205 | You may charge any price or no price for each copy that you convey, 206 | and you may offer support or warranty protection for a fee. 207 | 208 | 5. Conveying Modified Source Versions. 209 | 210 | You may convey a work based on the Program, or the modifications to 211 | produce it from the Program, in the form of source code under the 212 | terms of section 4, provided that you also meet all of these conditions: 213 | 214 | a) The work must carry prominent notices stating that you modified 215 | it, and giving a relevant date. 216 | 217 | b) The work must carry prominent notices stating that it is 218 | released under this License and any conditions added under section 219 | 7. This requirement modifies the requirement in section 4 to 220 | "keep intact all notices". 221 | 222 | c) You must license the entire work, as a whole, under this 223 | License to anyone who comes into possession of a copy. This 224 | License will therefore apply, along with any applicable section 7 225 | additional terms, to the whole of the work, and all its parts, 226 | regardless of how they are packaged. This License gives no 227 | permission to license the work in any other way, but it does not 228 | invalidate such permission if you have separately received it. 229 | 230 | d) If the work has interactive user interfaces, each must display 231 | Appropriate Legal Notices; however, if the Program has interactive 232 | interfaces that do not display Appropriate Legal Notices, your 233 | work need not make them do so. 234 | 235 | A compilation of a covered work with other separate and independent 236 | works, which are not by their nature extensions of the covered work, 237 | and which are not combined with it such as to form a larger program, 238 | in or on a volume of a storage or distribution medium, is called an 239 | "aggregate" if the compilation and its resulting copyright are not 240 | used to limit the access or legal rights of the compilation's users 241 | beyond what the individual works permit. Inclusion of a covered work 242 | in an aggregate does not cause this License to apply to the other 243 | parts of the aggregate. 244 | 245 | 6. Conveying Non-Source Forms. 246 | 247 | You may convey a covered work in object code form under the terms 248 | of sections 4 and 5, provided that you also convey the 249 | machine-readable Corresponding Source under the terms of this License, 250 | in one of these ways: 251 | 252 | a) Convey the object code in, or embodied in, a physical product 253 | (including a physical distribution medium), accompanied by the 254 | Corresponding Source fixed on a durable physical medium 255 | customarily used for software interchange. 256 | 257 | b) Convey the object code in, or embodied in, a physical product 258 | (including a physical distribution medium), accompanied by a 259 | written offer, valid for at least three years and valid for as 260 | long as you offer spare parts or customer support for that product 261 | model, to give anyone who possesses the object code either (1) a 262 | copy of the Corresponding Source for all the software in the 263 | product that is covered by this License, on a durable physical 264 | medium customarily used for software interchange, for a price no 265 | more than your reasonable cost of physically performing this 266 | conveying of source, or (2) access to copy the 267 | Corresponding Source from a network server at no charge. 268 | 269 | c) Convey individual copies of the object code with a copy of the 270 | written offer to provide the Corresponding Source. This 271 | alternative is allowed only occasionally and noncommercially, and 272 | only if you received the object code with such an offer, in accord 273 | with subsection 6b. 274 | 275 | d) Convey the object code by offering access from a designated 276 | place (gratis or for a charge), and offer equivalent access to the 277 | Corresponding Source in the same way through the same place at no 278 | further charge. You need not require recipients to copy the 279 | Corresponding Source along with the object code. If the place to 280 | copy the object code is a network server, the Corresponding Source 281 | may be on a different server (operated by you or a third party) 282 | that supports equivalent copying facilities, provided you maintain 283 | clear directions next to the object code saying where to find the 284 | Corresponding Source. Regardless of what server hosts the 285 | Corresponding Source, you remain obligated to ensure that it is 286 | available for as long as needed to satisfy these requirements. 287 | 288 | e) Convey the object code using peer-to-peer transmission, provided 289 | you inform other peers where the object code and Corresponding 290 | Source of the work are being offered to the general public at no 291 | charge under subsection 6d. 292 | 293 | A separable portion of the object code, whose source code is excluded 294 | from the Corresponding Source as a System Library, need not be 295 | included in conveying the object code work. 296 | 297 | A "User Product" is either (1) a "consumer product", which means any 298 | tangible personal property which is normally used for personal, family, 299 | or household purposes, or (2) anything designed or sold for incorporation 300 | into a dwelling. In determining whether a product is a consumer product, 301 | doubtful cases shall be resolved in favor of coverage. For a particular 302 | product received by a particular user, "normally used" refers to a 303 | typical or common use of that class of product, regardless of the status 304 | of the particular user or of the way in which the particular user 305 | actually uses, or expects or is expected to use, the product. A product 306 | is a consumer product regardless of whether the product has substantial 307 | commercial, industrial or non-consumer uses, unless such uses represent 308 | the only significant mode of use of the product. 309 | 310 | "Installation Information" for a User Product means any methods, 311 | procedures, authorization keys, or other information required to install 312 | and execute modified versions of a covered work in that User Product from 313 | a modified version of its Corresponding Source. The information must 314 | suffice to ensure that the continued functioning of the modified object 315 | code is in no case prevented or interfered with solely because 316 | modification has been made. 317 | 318 | If you convey an object code work under this section in, or with, or 319 | specifically for use in, a User Product, and the conveying occurs as 320 | part of a transaction in which the right of possession and use of the 321 | User Product is transferred to the recipient in perpetuity or for a 322 | fixed term (regardless of how the transaction is characterized), the 323 | Corresponding Source conveyed under this section must be accompanied 324 | by the Installation Information. But this requirement does not apply 325 | if neither you nor any third party retains the ability to install 326 | modified object code on the User Product (for example, the work has 327 | been installed in ROM). 328 | 329 | The requirement to provide Installation Information does not include a 330 | requirement to continue to provide support service, warranty, or updates 331 | for a work that has been modified or installed by the recipient, or for 332 | the User Product in which it has been modified or installed. Access to a 333 | network may be denied when the modification itself materially and 334 | adversely affects the operation of the network or violates the rules and 335 | protocols for communication across the network. 336 | 337 | Corresponding Source conveyed, and Installation Information provided, 338 | in accord with this section must be in a format that is publicly 339 | documented (and with an implementation available to the public in 340 | source code form), and must require no special password or key for 341 | unpacking, reading or copying. 342 | 343 | 7. Additional Terms. 344 | 345 | "Additional permissions" are terms that supplement the terms of this 346 | License by making exceptions from one or more of its conditions. 347 | Additional permissions that are applicable to the entire Program shall 348 | be treated as though they were included in this License, to the extent 349 | that they are valid under applicable law. If additional permissions 350 | apply only to part of the Program, that part may be used separately 351 | under those permissions, but the entire Program remains governed by 352 | this License without regard to the additional permissions. 353 | 354 | When you convey a copy of a covered work, you may at your option 355 | remove any additional permissions from that copy, or from any part of 356 | it. (Additional permissions may be written to require their own 357 | removal in certain cases when you modify the work.) You may place 358 | additional permissions on material, added by you to a covered work, 359 | for which you have or can give appropriate copyright permission. 360 | 361 | Notwithstanding any other provision of this License, for material you 362 | add to a covered work, you may (if authorized by the copyright holders of 363 | that material) supplement the terms of this License with terms: 364 | 365 | a) Disclaiming warranty or limiting liability differently from the 366 | terms of sections 15 and 16 of this License; or 367 | 368 | b) Requiring preservation of specified reasonable legal notices or 369 | author attributions in that material or in the Appropriate Legal 370 | Notices displayed by works containing it; or 371 | 372 | c) Prohibiting misrepresentation of the origin of that material, or 373 | requiring that modified versions of such material be marked in 374 | reasonable ways as different from the original version; or 375 | 376 | d) Limiting the use for publicity purposes of names of licensors or 377 | authors of the material; or 378 | 379 | e) Declining to grant rights under trademark law for use of some 380 | trade names, trademarks, or service marks; or 381 | 382 | f) Requiring indemnification of licensors and authors of that 383 | material by anyone who conveys the material (or modified versions of 384 | it) with contractual assumptions of liability to the recipient, for 385 | any liability that these contractual assumptions directly impose on 386 | those licensors and authors. 387 | 388 | All other non-permissive additional terms are considered "further 389 | restrictions" within the meaning of section 10. If the Program as you 390 | received it, or any part of it, contains a notice stating that it is 391 | governed by this License along with a term that is a further 392 | restriction, you may remove that term. If a license document contains 393 | a further restriction but permits relicensing or conveying under this 394 | License, you may add to a covered work material governed by the terms 395 | of that license document, provided that the further restriction does 396 | not survive such relicensing or conveying. 397 | 398 | If you add terms to a covered work in accord with this section, you 399 | must place, in the relevant source files, a statement of the 400 | additional terms that apply to those files, or a notice indicating 401 | where to find the applicable terms. 402 | 403 | Additional terms, permissive or non-permissive, may be stated in the 404 | form of a separately written license, or stated as exceptions; 405 | the above requirements apply either way. 406 | 407 | 8. Termination. 408 | 409 | You may not propagate or modify a covered work except as expressly 410 | provided under this License. Any attempt otherwise to propagate or 411 | modify it is void, and will automatically terminate your rights under 412 | this License (including any patent licenses granted under the third 413 | paragraph of section 11). 414 | 415 | However, if you cease all violation of this License, then your 416 | license from a particular copyright holder is reinstated (a) 417 | provisionally, unless and until the copyright holder explicitly and 418 | finally terminates your license, and (b) permanently, if the copyright 419 | holder fails to notify you of the violation by some reasonable means 420 | prior to 60 days after the cessation. 421 | 422 | Moreover, your license from a particular copyright holder is 423 | reinstated permanently if the copyright holder notifies you of the 424 | violation by some reasonable means, this is the first time you have 425 | received notice of violation of this License (for any work) from that 426 | copyright holder, and you cure the violation prior to 30 days after 427 | your receipt of the notice. 428 | 429 | Termination of your rights under this section does not terminate the 430 | licenses of parties who have received copies or rights from you under 431 | this License. If your rights have been terminated and not permanently 432 | reinstated, you do not qualify to receive new licenses for the same 433 | material under section 10. 434 | 435 | 9. Acceptance Not Required for Having Copies. 436 | 437 | You are not required to accept this License in order to receive or 438 | run a copy of the Program. Ancillary propagation of a covered work 439 | occurring solely as a consequence of using peer-to-peer transmission 440 | to receive a copy likewise does not require acceptance. However, 441 | nothing other than this License grants you permission to propagate or 442 | modify any covered work. These actions infringe copyright if you do 443 | not accept this License. Therefore, by modifying or propagating a 444 | covered work, you indicate your acceptance of this License to do so. 445 | 446 | 10. Automatic Licensing of Downstream Recipients. 447 | 448 | Each time you convey a covered work, the recipient automatically 449 | receives a license from the original licensors, to run, modify and 450 | propagate that work, subject to this License. You are not responsible 451 | for enforcing compliance by third parties with this License. 452 | 453 | An "entity transaction" is a transaction transferring control of an 454 | organization, or substantially all assets of one, or subdividing an 455 | organization, or merging organizations. If propagation of a covered 456 | work results from an entity transaction, each party to that 457 | transaction who receives a copy of the work also receives whatever 458 | licenses to the work the party's predecessor in interest had or could 459 | give under the previous paragraph, plus a right to possession of the 460 | Corresponding Source of the work from the predecessor in interest, if 461 | the predecessor has it or can get it with reasonable efforts. 462 | 463 | You may not impose any further restrictions on the exercise of the 464 | rights granted or affirmed under this License. For example, you may 465 | not impose a license fee, royalty, or other charge for exercise of 466 | rights granted under this License, and you may not initiate litigation 467 | (including a cross-claim or counterclaim in a lawsuit) alleging that 468 | any patent claim is infringed by making, using, selling, offering for 469 | sale, or importing the Program or any portion of it. 470 | 471 | 11. Patents. 472 | 473 | A "contributor" is a copyright holder who authorizes use under this 474 | License of the Program or a work on which the Program is based. The 475 | work thus licensed is called the contributor's "contributor version". 476 | 477 | A contributor's "essential patent claims" are all patent claims 478 | owned or controlled by the contributor, whether already acquired or 479 | hereafter acquired, that would be infringed by some manner, permitted 480 | by this License, of making, using, or selling its contributor version, 481 | but do not include claims that would be infringed only as a 482 | consequence of further modification of the contributor version. For 483 | purposes of this definition, "control" includes the right to grant 484 | patent sublicenses in a manner consistent with the requirements of 485 | this License. 486 | 487 | Each contributor grants you a non-exclusive, worldwide, royalty-free 488 | patent license under the contributor's essential patent claims, to 489 | make, use, sell, offer for sale, import and otherwise run, modify and 490 | propagate the contents of its contributor version. 491 | 492 | In the following three paragraphs, a "patent license" is any express 493 | agreement or commitment, however denominated, not to enforce a patent 494 | (such as an express permission to practice a patent or covenant not to 495 | sue for patent infringement). To "grant" such a patent license to a 496 | party means to make such an agreement or commitment not to enforce a 497 | patent against the party. 498 | 499 | If you convey a covered work, knowingly relying on a patent license, 500 | and the Corresponding Source of the work is not available for anyone 501 | to copy, free of charge and under the terms of this License, through a 502 | publicly available network server or other readily accessible means, 503 | then you must either (1) cause the Corresponding Source to be so 504 | available, or (2) arrange to deprive yourself of the benefit of the 505 | patent license for this particular work, or (3) arrange, in a manner 506 | consistent with the requirements of this License, to extend the patent 507 | license to downstream recipients. "Knowingly relying" means you have 508 | actual knowledge that, but for the patent license, your conveying the 509 | covered work in a country, or your recipient's use of the covered work 510 | in a country, would infringe one or more identifiable patents in that 511 | country that you have reason to believe are valid. 512 | 513 | If, pursuant to or in connection with a single transaction or 514 | arrangement, you convey, or propagate by procuring conveyance of, a 515 | covered work, and grant a patent license to some of the parties 516 | receiving the covered work authorizing them to use, propagate, modify 517 | or convey a specific copy of the covered work, then the patent license 518 | you grant is automatically extended to all recipients of the covered 519 | work and works based on it. 520 | 521 | A patent license is "discriminatory" if it does not include within 522 | the scope of its coverage, prohibits the exercise of, or is 523 | conditioned on the non-exercise of one or more of the rights that are 524 | specifically granted under this License. You may not convey a covered 525 | work if you are a party to an arrangement with a third party that is 526 | in the business of distributing software, under which you make payment 527 | to the third party based on the extent of your activity of conveying 528 | the work, and under which the third party grants, to any of the 529 | parties who would receive the covered work from you, a discriminatory 530 | patent license (a) in connection with copies of the covered work 531 | conveyed by you (or copies made from those copies), or (b) primarily 532 | for and in connection with specific products or compilations that 533 | contain the covered work, unless you entered into that arrangement, 534 | or that patent license was granted, prior to 28 March 2007. 535 | 536 | Nothing in this License shall be construed as excluding or limiting 537 | any implied license or other defenses to infringement that may 538 | otherwise be available to you under applicable patent law. 539 | 540 | 12. No Surrender of Others' Freedom. 541 | 542 | If conditions are imposed on you (whether by court order, agreement or 543 | otherwise) that contradict the conditions of this License, they do not 544 | excuse you from the conditions of this License. If you cannot convey a 545 | covered work so as to satisfy simultaneously your obligations under this 546 | License and any other pertinent obligations, then as a consequence you may 547 | not convey it at all. For example, if you agree to terms that obligate you 548 | to collect a royalty for further conveying from those to whom you convey 549 | the Program, the only way you could satisfy both those terms and this 550 | License would be to refrain entirely from conveying the Program. 551 | 552 | 13. Use with the GNU Affero General Public License. 553 | 554 | Notwithstanding any other provision of this License, you have 555 | permission to link or combine any covered work with a work licensed 556 | under version 3 of the GNU Affero General Public License into a single 557 | combined work, and to convey the resulting work. The terms of this 558 | License will continue to apply to the part which is the covered work, 559 | but the special requirements of the GNU Affero General Public License, 560 | section 13, concerning interaction through a network will apply to the 561 | combination as such. 562 | 563 | 14. Revised Versions of this License. 564 | 565 | The Free Software Foundation may publish revised and/or new versions of 566 | the GNU General Public License from time to time. Such new versions will 567 | be similar in spirit to the present version, but may differ in detail to 568 | address new problems or concerns. 569 | 570 | Each version is given a distinguishing version number. If the 571 | Program specifies that a certain numbered version of the GNU General 572 | Public License "or any later version" applies to it, you have the 573 | option of following the terms and conditions either of that numbered 574 | version or of any later version published by the Free Software 575 | Foundation. If the Program does not specify a version number of the 576 | GNU General Public License, you may choose any version ever published 577 | by the Free Software Foundation. 578 | 579 | If the Program specifies that a proxy can decide which future 580 | versions of the GNU General Public License can be used, that proxy's 581 | public statement of acceptance of a version permanently authorizes you 582 | to choose that version for the Program. 583 | 584 | Later license versions may give you additional or different 585 | permissions. However, no additional obligations are imposed on any 586 | author or copyright holder as a result of your choosing to follow a 587 | later version. 588 | 589 | 15. Disclaimer of Warranty. 590 | 591 | THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY 592 | APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT 593 | HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY 594 | OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, 595 | THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 596 | PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM 597 | IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF 598 | ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 599 | 600 | 16. Limitation of Liability. 601 | 602 | IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 603 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS 604 | THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY 605 | GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE 606 | USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF 607 | DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD 608 | PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), 609 | EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF 610 | SUCH DAMAGES. 611 | 612 | 17. Interpretation of Sections 15 and 16. 613 | 614 | If the disclaimer of warranty and limitation of liability provided 615 | above cannot be given local legal effect according to their terms, 616 | reviewing courts shall apply local law that most closely approximates 617 | an absolute waiver of all civil liability in connection with the 618 | Program, unless a warranty or assumption of liability accompanies a 619 | copy of the Program in return for a fee. 620 | 621 | END OF TERMS AND CONDITIONS 622 | 623 | How to Apply These Terms to Your New Programs 624 | 625 | If you develop a new program, and you want it to be of the greatest 626 | possible use to the public, the best way to achieve this is to make it 627 | free software which everyone can redistribute and change under these terms. 628 | 629 | To do so, attach the following notices to the program. It is safest 630 | to attach them to the start of each source file to most effectively 631 | state the exclusion of warranty; and each file should have at least 632 | the "copyright" line and a pointer to where the full notice is found. 633 | 634 | 635 | Copyright (C) 636 | 637 | This program is free software: you can redistribute it and/or modify 638 | it under the terms of the GNU General Public License as published by 639 | the Free Software Foundation, either version 3 of the License, or 640 | (at your option) any later version. 641 | 642 | This program is distributed in the hope that it will be useful, 643 | but WITHOUT ANY WARRANTY; without even the implied warranty of 644 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 645 | GNU General Public License for more details. 646 | 647 | You should have received a copy of the GNU General Public License 648 | along with this program. If not, see . 649 | 650 | Also add information on how to contact you by electronic and paper mail. 651 | 652 | If the program does terminal interaction, make it output a short 653 | notice like this when it starts in an interactive mode: 654 | 655 | Copyright (C) 656 | This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 657 | This is free software, and you are welcome to redistribute it 658 | under certain conditions; type `show c' for details. 659 | 660 | The hypothetical commands `show w' and `show c' should show the appropriate 661 | parts of the General Public License. Of course, your program's commands 662 | might be different; for a GUI interface, you would use an "about box". 663 | 664 | You should also get your employer (if you work as a programmer) or school, 665 | if any, to sign a "copyright disclaimer" for the program, if necessary. 666 | For more information on this, and how to apply and follow the GNU GPL, see 667 | . 668 | 669 | The GNU General Public License does not permit incorporating your program 670 | into proprietary programs. If your program is a subroutine library, you 671 | may consider it more useful to permit linking proprietary applications with 672 | the library. If this is what you want to do, use the GNU Lesser General 673 | Public License instead of this License. But first, please read 674 | . 675 | -------------------------------------------------------------------------------- /autogit: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | # 3 | # Set autogit directory 4 | DIR=$HOME/autogit 5 | # 6 | # Set cache directory and create it 7 | CACHEDIR=/tmp/autogit 8 | if [ -e "$DIR" ]; then 9 | mkdir -p "$CACHEDIR" 10 | fi 11 | # 12 | # Additional Files 13 | # Checked packages: 14 | CHECKEDPKGS=$CACHEDIR/.pkgs.txt 15 | # Failed to build packages: 16 | FAILEDPKGS=$CACHEDIR/.failed.txt 17 | # Compiled packages 18 | COMPILEDPKGS=$CACHEDIR/.compiled.txt 19 | # 20 | # Configuration file update check 21 | function conf_ver_upd() { 22 | # Check if the local ".conf" needs to be merged with the new package ".conf" 23 | # because code changes require it. 24 | # Define a hard coded variable, which will be checked inside the ".conf file" 25 | if [ "$CONFVER" == "2.0.0" ]; then 26 | echo "Up to date configuration" &>/dev/null 27 | else 28 | clear 29 | echo "" 30 | echo -e " \e[1mPackage Update - manual intervention required!\e[0m" 31 | echo -e " \e[1mPlease merge the changes of \e[7m/etc/autogit/autogit.conf\e[0m \e[1mfor usage!\e[0m" 32 | echo "" 33 | exit 1 34 | fi 35 | } 36 | # 37 | # Check if a local configuration exists 38 | if [ -e "$DIR" ]; then # If local autogit folder exists 39 | if [ -e "$DIR/autogit.conf" ]; then # If local autogit.conf file exists in "$DIR" 40 | 41 | # Load User configuration 42 | # This is the default behavior to quickly change all settings without the need of root access, 43 | # but can be changed by deleting the ".conf" in "$DIR" and "$HOME/.config/autogit", to use the root file instead. 44 | configdir=$DIR 45 | . "$configdir"/autogit.conf 46 | 47 | # Configuration file update check 48 | conf_ver_upd 49 | else 50 | if [ -e "$HOME/.config/autogit/autogit.conf" ]; then # If local autogit.conf file exists in "$HOME/.config/autogit" 51 | 52 | # Load User configuration 53 | # This is the default behavior to quickly change all settings without the need of root access, 54 | # but can be changed by deleting the ".conf" in "$DIR" and "$HOME/.config/autogit", to use the root file instead. 55 | configdir=$HOME/.config/autogit 56 | . "$configdir"/autogit.conf 57 | 58 | # Configuration file update check 59 | conf_ver_upd 60 | else 61 | # If a local "autogit.conf" file does not exist, but the autogit folder is present in "$DIR", 62 | # we need to assume the user wants to use the root configuration file instead. 63 | # This means a new configuration file can be detected via a ".pacnew" file and 64 | # should not require a message on changes, as this is user preference. 65 | # Load root configuration 66 | configdir=/etc/autogit 67 | . $configdir/autogit.conf 68 | fi 69 | fi 70 | else 71 | # Create a local configuration on first run or if "$DIR" is not found 72 | if [ -e "/etc/autogit" ]; then 73 | if mkdir -p "$DIR" && cp -r /etc/autogit/reponames "$DIR" && cp -r /etc/autogit "$HOME/.config" && ln -s "$HOME/.config/autogit/autogit.conf" "$DIR"; then 74 | newconfig=1 75 | fi 76 | fi 77 | fi 78 | # 79 | # Traps (ctrl-c) 80 | function killproc() { 81 | echo -e "\n**** Received SIGINT, aborting! ****\n" 82 | kill -- -$$ && exit 2 83 | } 84 | # 85 | # Messages 86 | GITHUBMSG="\e[1mGithub repo updated - \e[7m$GITHUBBINARY\e[0m\e[0m" 87 | GITHUBMSGCUST="\e[1mGithub repo updated - \e[7m$GITHUBBINARYCUSTOM\e[0m\e[0m" 88 | GITHUBMSGCUST2="\e[1mGithub repo updated - \e[7m$GITHUBBINARYCUSTOM2\e[0m\e[0m" 89 | GITHUBMSGCUST3="\e[1mGithub repo updated - \e[7m$GITHUBBINARYCUSTOM3\e[0m\e[0m" 90 | GITHUBMSGCUST4="\e[1mGithub repo updated - \e[7m$GITHUBBINARYCUSTOM4\e[0m\e[0m" 91 | GITHUBMSGCUST5="\e[1mGithub repo updated - \e[7m$GITHUBBINARYCUSTOM5\e[0m\e[0m" 92 | GITLABMSG="\e[1mGitlab repo updated - \e[7m$GITLABBINARY\e[0m\e[0m" 93 | GITLABMSGCUST="\e[1mGitlab repo updated - \e[7m$GITLABBINARYCUSTOM\e[0m\e[0m" 94 | GITLABMSGCUST2="\e[1mGitlab repo updated - \e[7m$GITLABBINARYCUSTOM2\e[0m\e[0m" 95 | GITLABMSGCUST3="\e[1mGitlab repo updated - \e[7m$GITLABBINARYCUSTOM3\e[0m\e[0m" 96 | GITLABMSGCUST4="\e[1mGitlab repo updated - \e[7m$GITLABBINARYCUSTOM4\e[0m\e[0m" 97 | GITLABMSGCUST5="\e[1mGitlab repo updated - \e[7m$GITLABBINARYCUSTOM5\e[0m\e[0m" 98 | AURMSG="\e[1mAUR repo updated - \e[7m$AURBINARY\e[0m\e[0m" 99 | FAILEDBUILDMSG="\e[31mPackage build failed, removing ...\e[0m" 100 | # 101 | # Online connection check 102 | function onlinecheck() { 103 | # Check for a internet connection 104 | if [ -z "$(curl -f -s "$GITHUBURL")" ]; then # Check if "curl" fails 105 | echo "No online connection ..retrying" 106 | sleep 2 107 | if [ -z "$(curl -f -s "$GITHUBURL")" ]; then # Check if "curl" fails 108 | echo "No online connection ..retrying" 109 | sleep 2 110 | if [ -z "$(curl -f -s "$GITHUBURL")" ]; then # Check if "curl" fails 111 | echo "No online connection ..exit!" 112 | exit 1 113 | fi 114 | fi 115 | fi 116 | } 117 | # 118 | # Supported build options 119 | function buildoptions() { 120 | 121 | failedbuild=0 122 | 123 | if [ "$var" == "3" ]; then 124 | # Arch "devtools" - Convenience way option 125 | if $MBARG1 "$MBARG2" "$MBARG3" "$MBARG4"; then 126 | rm -rf ./*.*.log* ./*.log &>/dev/null # remove log files 127 | mv ./*.*.pkg.* "$DIR/$GITHUBBINARY" &>/dev/null # move built package 128 | rm -rf ./*.*.tar.* ./*.zip ./*.deb &>/dev/null # remove left over source packages 129 | find "$DIR/$GITHUBBINARY" -type d -exec paccache -v -r -k 1 -c {} \; # clean cache 130 | setrepoadd=1 131 | else 132 | echo -e "$FAILEDBUILDMSG" 133 | rm -rf PKGBUILD &>/dev/null 134 | failedbuild=1 135 | fi 136 | else 137 | if [ "$var" == "1" ]; then 138 | # Makepkg building 139 | if makepkg "$MARG1" "$MARG2" "$MARG3" "$MARG4" "$MARG5" "$MARG6"; then 140 | mv ./*.*.pkg.* "$DIR/$GITHUBBINARY" &>/dev/null 141 | rm -rf ./*.*.tar.* ./*.zip ./*.deb &>/dev/null 142 | find "$DIR/$GITHUBBINARY" -type d -exec paccache -v -r -k 1 -c {} \; # clean cache 143 | setrepoadd=1 144 | else 145 | echo -e "$FAILEDBUILDMSG" 146 | rm -rf PKGBUILD &>/dev/null 147 | failedbuild=1 148 | fi 149 | else 150 | if [ "$var" == "0" ]; then 151 | # Makepkg installation 152 | if makepkg -srci --noconfirm; then 153 | echo "installed ..." 154 | else 155 | echo -e "$FAILEDBUILDMSG" 156 | rm -rf PKGBUILD &>/dev/null 157 | failedbuild=1 158 | fi 159 | else 160 | if [ "$var" == "2" ]; then 161 | # Manjaro chrootbuild 162 | # I don't know why, but "chrootbuild" is unable to ignore "unset/empty" variables 163 | # So let's filter them out in a loop 164 | 165 | # Source folder 166 | folder="$(printf '%q\n' "${PWD##*/}")" 167 | 168 | # "chrootbuild" doesn't like to be inside the "git" directory, but instead wants to be pointed at it 169 | cd .. 170 | 171 | # Define an array with variable names 172 | variables=("MCARG1" "MCARG2" "MCARG3" "MCARG4" "MCARG5" "MCARG6") 173 | 174 | # Initialize a command string 175 | cmd="" 176 | 177 | # Loop through the "variables" array and append each set variable to the "cmd" command 178 | for vars in "${variables[@]}"; do 179 | if [ -n "$vars" ]; then 180 | cmd+="\${$vars} " 181 | fi 182 | done 183 | 184 | # Resolve the "cmd" command string via the eval function 185 | ARGUMENTS="$(eval echo "${cmd}")" 186 | BUILDFLAGS="$(printf "%s\n" "$ARGUMENTS")" 187 | BUILDCOMMAND="sudo chrootbuild $BUILDFLAGS $folder" 188 | echo "Buildcommand = \"$BUILDCOMMAND\"" 189 | 190 | if $BUILDCOMMAND; then 191 | mv ./*.*.pkg.* "$DIR/$GITHUBBINARY" &>/dev/null 192 | cd "$folder" || exit 193 | rm -rf ./*.*.log* ./*.log &>/dev/null 194 | rm -rf ./*.*.tar.* ./*.zip ./*.deb &>/dev/null 195 | find "$DIR/$GITHUBBINARY" -type d -exec paccache -v -r -k 1 -c {} \; # clean cache 196 | setrepoadd=1 197 | else 198 | echo -e "$FAILEDBUILDMSG" 199 | rm -rf "$folder"/PKGBUILD &>/dev/null 200 | failedbuild=1 201 | fi 202 | fi 203 | fi 204 | fi 205 | fi 206 | } 207 | # 208 | # Find "-git" package source 209 | # shellcheck disable=SC2120 210 | function gitpkg_src_check() { 211 | local PKGBUILD=${1:-PKGBUILD} 212 | shopt -s expand_aliases 2>/dev/null || true 213 | 214 | # Define a helper to safely expand variable names 215 | safe_eval() { 216 | local expr="$1" 217 | eval "echo \"\$${expr}\"" 2>/dev/null || echo "$expr" 218 | } 219 | 220 | # Source PKGBUILD 221 | # shellcheck disable=SC1090 222 | if ! source "$PKGBUILD"; then 223 | echo "Error: Failed to source $PKGBUILD" >&2 224 | return 1 225 | fi 226 | 227 | # Handle source array safely 228 | local srcdir=${srcdir:-$PWD} 229 | local entry dir_part url_part dir_name 230 | 231 | # Loop through source array entries 232 | # shellcheck disable=SC2154 233 | for entry in "${source[@]}"; do 234 | [[ "$entry" != *"git+"* ]] && continue 235 | 236 | # Handle name::git+url syntax 237 | if [[ "$entry" == *::git+* ]]; then 238 | dir_part="${entry%%::git+*}" 239 | url_part="${entry#*::git+}" 240 | else 241 | dir_part="" 242 | url_part="$entry" 243 | fi 244 | 245 | # If directory name not specified explicitly, extract from URL 246 | if [[ -z "$dir_part" ]]; then 247 | url_part="${url_part%%#*}" # strip fragment 248 | dir_part="$(basename "${url_part}" .git)" 249 | fi 250 | 251 | # Expand any variables in dir_part 252 | if [[ "$dir_part" =~ \$ ]]; then 253 | dir_part="$(safe_eval "${dir_part#\${}")" 254 | fi 255 | 256 | dir_name="$dir_part" 257 | 258 | # Check if directory exists and "cd" into it 259 | if [[ -d "$srcdir/$dir_name" ]]; then 260 | cd "$srcdir/$dir_name" || exit 261 | return 0 262 | else 263 | echo "Git source directory '$dir_name' not found in $srcdir" >&2 264 | return 1 265 | fi 266 | done 267 | 268 | echo "No git source found in PKGBUILD" >&2 269 | return 1 270 | } 271 | # 272 | # Main functionality 273 | function maincheck() { 274 | if [ -e "$DIR/packages/$GITDIR/$p" ]; then # If file exists 275 | cd "$DIR/packages/$GITDIR/$p" || exit # go to current package directory to compare it 276 | 277 | ONLINEPKGBUILD=".onlinepkgbuild" 278 | CURL=$(curl -f -s "$GITHUBURL" | tee "$ONLINEPKGBUILD") 279 | onlinecheck 280 | 281 | # Update check method 1: compare "pkgver" + "pkgrel" & "sha512sum of PKGBUILD's via curl" 282 | if [ "$UPDCHECK" == "1" ]; then 283 | if [ -e "PKGBUILD" ]; then # If file exists "PKGBUILD" 284 | LOCALPKGVER=$(cat PKGBUILD | grep 'pkgver=' | cut -c 8-) 285 | LOCALPKGREL=$(cat PKGBUILD | grep 'pkgrel=' | cut -c 8-) 286 | GETPKGVER=$(echo "$CURL" | grep 'pkgver=' | cut -c 8-) 287 | GETPKGREL=$(echo "$CURL" | grep 'pkgrel=' | cut -c 8-) 288 | SHA512LOCAL=$(sha512sum PKGBUILD | cut -f 1 -d " ") 289 | SHA512ONLINE=$(sha512sum "$ONLINEPKGBUILD" | cut -f 1 -d " ") 290 | 291 | echo -e "\e[1m⚿ local version: $LOCALPKGVER-$LOCALPKGREL\e[0m" 292 | echo -e "\e[1m⚿ online version: $GETPKGVER-$GETPKGREL\e[0m" 293 | fi 294 | fi 295 | 296 | # Update check method 2: compare "pkgver" + "pkgrel" of ".SRCINFO's" & "sha512sum" of PKGBUILD's via "git" & "makepkg" 297 | if [ "$UPDCHECK" == "2" ]; then 298 | ONLINESRCDIR="onlinesrcinfo" 299 | # Local PKGBUILD ".SRCINFO" 300 | if [ -e "PKGBUILD" ]; then # If file exists "PKGBUILD" 301 | 302 | if [ -e ".SRCINFO" ]; then # If file exists ".SRCINFO" 303 | echo ".SRCINFO exists" &>/dev/null 304 | else 305 | makepkg --printsrcinfo >.SRCINFO # print .SRCINFO file for a reliable local pkg update reference 306 | fi 307 | 308 | # Online PKGBUILD ".SRCINFO" 309 | if [ -e "$ONLINESRCDIR" ]; then # If file exists 310 | cd "$ONLINESRCDIR/original" || exit 311 | git fetch origin &>/dev/null 312 | git checkout origin/"$BRANCH" &>/dev/null 313 | git reset --hard origin/"$BRANCH" &>/dev/null # reset files to how they were before 314 | git clean -f -d &>/dev/null # clear any other changes you've done 315 | makepkg --printsrcinfo >"$DIR/packages/$GITDIR/$p"/"$ONLINESRCDIR"/.SRCINFO # print .SRCINFO file for a reliable online pkg update reference 316 | cd "$DIR/packages/$GITDIR/$p" || exit # go to current package directory 317 | else 318 | if mkdir -p "$ONLINESRCDIR" && cd "$ONLINESRCDIR"; then 319 | git clone --single-branch --branch "$BRANCH" "$GITHUBCLONEURL""$p".git &>/dev/null 320 | folder="$(ls)" 321 | mv "$folder" original &>/dev/null 322 | cd original || exit 323 | makepkg --printsrcinfo >"$DIR/packages/$GITDIR/$p"/"$ONLINESRCDIR"/.SRCINFO # print .SRCINFO file for a reliable online pkg update reference 324 | cd "$DIR/packages/$GITDIR/$p" || exit # go to current package directory 325 | fi 326 | fi 327 | 328 | LOCALPKGVER=$(cat .SRCINFO | grep 'pkgver =' | cut -c 11-) 329 | LOCALPKGREL=$(cat .SRCINFO | grep 'pkgrel =' | cut -c 11-) 330 | GETPKGVER=$(cat "$ONLINESRCDIR"/.SRCINFO | grep 'pkgver =' | cut -c 11-) 331 | GETPKGREL=$(cat "$ONLINESRCDIR"/.SRCINFO | grep 'pkgrel =' | cut -c 11-) 332 | SHA512LOCAL=$(sha512sum PKGBUILD | cut -f 1 -d " ") 333 | SHA512ONLINE=$(sha512sum "$ONLINESRCDIR/original/PKGBUILD" | cut -f 1 -d " ") 334 | 335 | echo -e "\e[1m⚿ local version: $LOCALPKGVER-$LOCALPKGREL\e[0m" 336 | echo -e "\e[1m⚿ online version: $GETPKGVER-$GETPKGREL\e[0m" 337 | fi 338 | fi 339 | 340 | # Check if it's a Git Package before updating 341 | gitfile=.gitcheck 342 | if [ -e "PKGBUILD" ]; then # If file exists 343 | if [ -e "$gitfile" ]; then 344 | if grep -E *'-git' "$gitfile" &>/dev/null; then # If result matches (Name has a -git string) 345 | # Find "-git" package source 346 | gitpkg_src_check 347 | # Check if a gitlog has been created 348 | if [ -f ".gitversioncheck" ]; then # If file exists 349 | git fetch origin &>/dev/null 350 | gitversionfile1=.gitversioncheck1 351 | gitversioncheck1="$(git show | head -1 | tee "$gitversionfile1")" 352 | if [[ -n "$gitversioncheck1" ]]; then 353 | if [[ "$(cat "$gitversionfile1")" == "$(cat ".gitversioncheck")" ]]; then 354 | cd "$DIR/packages/$GITDIR/$p" || exit 355 | echo -e "\e[2m🗹 Up-to-Date\e[0m" 356 | rm -rf .onlinepkgbuild &>/dev/null 357 | return 1 358 | fi 359 | fi 360 | else 361 | # Create a gitlog to check for updates 362 | gitversionfile=.gitversioncheck 363 | gitversioncheck="$(git show | head -1 | tee "$gitversionfile")" 364 | # Generate a gitcheck file for a update reference 365 | if [[ -n "$gitversioncheck" ]]; then 366 | cd "$DIR/packages/$GITDIR/$p" || exit 367 | echo -e "\e[2m🗹 Up-to-Date\e[0m" 368 | rm -rf .onlinepkgbuild &>/dev/null 369 | return 1 370 | fi 371 | fi 372 | fi 373 | fi 374 | fi 375 | 376 | # Check which update method is selected 377 | if [ "$UPDCHECK" == "2" ] && [ -e "PKGBUILD" ] && [ "$GETPKGVER" == "$LOCALPKGVER" ] && [ "$GETPKGREL" == "$LOCALPKGREL" ] && [ "$SHA512LOCAL" == "$SHA512ONLINE" ]; then # If PKGBUILD exists, "pkgver" + "pkgrel" and SHA-512 sums match 378 | echo -e "\e[2m🗹 Up-to-Date\e[0m" 379 | rm -rf "$ONLINEPKGBUILD" &>/dev/null 380 | elif [ "$UPDCHECK" == "1" ] && [ -e "PKGBUILD" ] && [ "$GETPKGVER" == "$LOCALPKGVER" ] && [ "$GETPKGREL" == "$LOCALPKGREL" ] && [ "$SHA512LOCAL" == "$SHA512ONLINE" ]; then # If PKGBUILD exists, "pkgver" + "pkgrel" and SHA-512 sums match 381 | echo -e "\e[2m🗹 Up-to-Date\e[0m" 382 | rm -rf "$ONLINEPKGBUILD" &>/dev/null 383 | else 384 | 385 | echo -e "\e[7mOut-of-Date! Updating ...\e[0m" 386 | cd "$DIR/packages/$GITDIR/$p" || exit 387 | 388 | onlinecheck 389 | git fetch origin &>/dev/null 390 | git checkout origin/"$BRANCH" &>/dev/null 391 | git reset --hard origin/"$BRANCH" # reset files to how they were before 392 | git clean -f -d # clear any other changes you've done 393 | buildoptions 394 | # Check if it's a Git Package to create a log for updating 395 | cd "$DIR/packages/$GITDIR/$p" || exit 396 | gitfile=.gitcheck 397 | gitcheck="$(echo "$p" | tee "$gitfile")" 398 | if [ -n "$gitcheck" ]; then 399 | if grep -E *'-git' "$gitfile" &>/dev/null; then # If result matches (Name has a -git string) 400 | makepkg --nobuild 401 | makepkg --verifysource 402 | makepkg --printsrcinfo >.SRCINFO 403 | # Find "-git" package source 404 | gitpkg_src_check 405 | # Create a gitlog to check for updates 406 | gitversionfile=.gitversioncheck 407 | gitversioncheck="$(git show | head -1 | tee "$gitversionfile")" 408 | # Generate a gitcheck file for a update reference 409 | if [[ -n "$gitversioncheck" ]]; then 410 | cd "$DIR/packages/$GITDIR/$p" || exit 411 | rm -rf .onlinepkgbuild &>/dev/null 412 | return 1 413 | fi 414 | fi 415 | rm -rf "$gitfile" &>/dev/null 416 | fi 417 | fi 418 | else 419 | 420 | echo "Package does not exist local, downloading ..." 421 | 422 | onlinecheck 423 | mkdir -p "$DIR/packages/$GITDIR/$p" && cd "$DIR/packages/$GITDIR/$p" || exit 424 | git clone --single-branch --branch "$BRANCH" "$GITHUBCLONEURL""$p".git 425 | folder="$(ls)" 426 | echo "$folder" 427 | mv "$folder" original &>/dev/null 428 | cd original || exit 429 | ls 430 | mv * .* "$DIR/packages/$GITDIR/$p" &>/dev/null 431 | cd "$DIR/packages/$GITDIR/$p" || exit 432 | rm -rf original &>/dev/null 433 | mkdir -p "$DIR/$GITHUBBINARY" 434 | buildoptions 435 | # Check if it's a Git Package to create a log for updating 436 | cd "$DIR/packages/$GITDIR/$p" || exit 437 | gitfile=.gitcheck 438 | gitcheck="$(echo "$p" | tee "$gitfile")" 439 | if [ -n "$gitcheck" ]; then 440 | if grep -E *'-git' "$gitfile" &>/dev/null; then # If result matches (Name has a -git string) 441 | makepkg --nobuild 442 | makepkg --verifysource 443 | makepkg --printsrcinfo >.SRCINFO 444 | # Find "-git" package source 445 | gitpkg_src_check 446 | # Create a gitlog to check for updates 447 | gitversionfile=.gitversioncheck 448 | gitversioncheck="$(git show | head -1 | tee "$gitversionfile")" 449 | # Generate a gitcheck file for a update reference 450 | if [[ -n "$gitversioncheck" ]]; then 451 | cd "$DIR/packages/$GITDIR/$p" || exit 452 | rm -rf .onlinepkgbuild &>/dev/null 453 | return 1 454 | fi 455 | fi 456 | rm -rf "$gitfile" &>/dev/null 457 | fi 458 | fi 459 | } 460 | # 461 | 462 | # Function for checked and failed to build packages 463 | function checked_and_failed_pkgs() { 464 | printf '%s\n' "$p" | tee -a "$CHECKEDPKGS" &>/dev/null # Checked Packages 465 | if [ "$failedbuild" == "1" ]; then 466 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$FAILEDPKGS" &>/dev/null # Failed to build packages 467 | failedbuild=0 468 | fi 469 | } 470 | # Update, install, build packages from Github repos with available PKGBUILD 471 | function githubversion() { 472 | while IFS="" read -r p || [ -n "$p" ]; do 473 | case "$p" in \#*) continue ;; esac # Skip lines that start with "#" 474 | echo "" 475 | cd "$DIR" || exit 476 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 477 | GITHUBBINARY=$GITHUBBINARY 478 | BRANCH=$BRANCH 479 | GITHUBCLONEURL=$GITHUBCLONEURLC 480 | GITHUBURL="$GITHUBURLC"$p"/"$BRANCH"/PKGBUILD" 481 | GITDIR=Github1 482 | maincheck 483 | if [ "$setrepoadd" == "1" ]; then 484 | setrepoaddgithub1=1 485 | setrepoadd=0 486 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null # Compiled packages 487 | fi 488 | # Function for checked and failed to build packages 489 | checked_and_failed_pkgs 490 | done <"$GITHUBSOURCE" #< $GITHUBSOURCE1 491 | } 492 | # 493 | # Additional Custom Github repo 494 | # Update, install, build packages from Github repos with available PKGBUILD 495 | function githubversioncustom() { 496 | while IFS="" read -r p || [ -n "$p" ]; do 497 | case "$p" in \#*) continue ;; esac 498 | echo "" 499 | cd "$DIR" || exit 500 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 501 | GITHUBBINARY=$GITHUBBINARYCUSTOM 502 | BRANCH=$BRANCHCUSTOM 503 | GITHUBCLONEURL=$GITHUBCLONEURLCCUSTOM 504 | GITHUBURL="$GITHUBURLCCUSTOM"$p"/"$BRANCH"/PKGBUILD" 505 | GITDIR=Github2 506 | maincheck 507 | if [ "$setrepoadd" == "1" ]; then 508 | setrepoaddgithub2=1 509 | setrepoadd=0 510 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null 511 | fi 512 | # Function for checked and failed to build packages 513 | checked_and_failed_pkgs 514 | done <"$GITHUBSOURCECUSTOM" #< $GITHUBSOURCE1 515 | } 516 | # 517 | # Additional Custom Github repo 518 | # Update, install, build packages from Github repos with available PKGBUILD 519 | function githubversioncustom2() { 520 | while IFS="" read -r p || [ -n "$p" ]; do 521 | case "$p" in \#*) continue ;; esac 522 | echo "" 523 | cd "$DIR" || exit 524 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 525 | GITHUBBINARY=$GITHUBBINARYCUSTOM2 526 | BRANCH=$BRANCHCUSTOM2 527 | GITHUBCLONEURL=$GITHUBCLONEURLCCUSTOM2 528 | GITHUBURL="$GITHUBURLCCUSTOM2"$p"/"$BRANCH"/PKGBUILD" 529 | GITDIR=Github3 530 | maincheck 531 | if [ "$setrepoadd" == "1" ]; then 532 | setrepoaddgithub3=1 533 | setrepoadd=0 534 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null 535 | fi 536 | # Function for checked and failed to build packages 537 | checked_and_failed_pkgs 538 | done <"$GITHUBSOURCECUSTOM2" #< $GITHUBSOURCE1 539 | } 540 | # 541 | # Additional Custom Github repo 542 | # Update, install, build packages from Github repos with available PKGBUILD 543 | function githubversioncustom3() { 544 | while IFS="" read -r p || [ -n "$p" ]; do 545 | case "$p" in \#*) continue ;; esac 546 | echo "" 547 | cd "$DIR" || exit 548 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 549 | GITHUBBINARY=$GITHUBBINARYCUSTOM3 550 | BRANCH=$BRANCHCUSTOM3 551 | GITHUBCLONEURL=$GITHUBCLONEURLCCUSTOM3 552 | GITHUBURL="$GITHUBURLCCUSTOM3"$p"/"$BRANCH"/PKGBUILD" 553 | GITDIR=Github4 554 | maincheck 555 | if [ "$setrepoadd" == "1" ]; then 556 | setrepoaddgithub4=1 557 | setrepoadd=0 558 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null 559 | fi 560 | # Function for checked and failed to build packages 561 | checked_and_failed_pkgs 562 | done <"$GITHUBSOURCECUSTOM3" #< $GITHUBSOURCE1 563 | } 564 | # 565 | # Additional Custom Github repo 566 | # Update, install, build packages from Github repos with available PKGBUILD 567 | function githubversioncustom4() { 568 | while IFS="" read -r p || [ -n "$p" ]; do 569 | case "$p" in \#*) continue ;; esac 570 | echo "" 571 | cd "$DIR" || exit 572 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 573 | GITHUBBINARY=$GITHUBBINARYCUSTOM4 574 | BRANCH=$BRANCHCUSTOM4 575 | GITHUBCLONEURL=$GITHUBCLONEURLCCUSTOM4 576 | GITHUBURL="$GITHUBURLCCUSTOM4"$p"/"$BRANCH"/PKGBUILD" 577 | GITDIR=Github5 578 | maincheck 579 | if [ "$setrepoadd" == "1" ]; then 580 | setrepoaddgithub5=1 581 | setrepoadd=0 582 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null 583 | fi 584 | # Function for checked and failed to build packages 585 | checked_and_failed_pkgs 586 | done <"$GITHUBSOURCECUSTOM4" #< $GITHUBSOURCE1 587 | } 588 | # 589 | # Additional Custom Github repo 590 | # Update, install, build packages from Github repos with available PKGBUILD 591 | function githubversioncustom5() { 592 | while IFS="" read -r p || [ -n "$p" ]; do 593 | case "$p" in \#*) continue ;; esac 594 | echo "" 595 | cd "$DIR" || exit 596 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 597 | GITHUBBINARY=$GITHUBBINARYCUSTOM5 598 | BRANCH=$BRANCHCUSTOM5 599 | GITHUBCLONEURL=$GITHUBCLONEURLCCUSTOM5 600 | GITHUBURL="$GITHUBURLCCUSTOM5"$p"/"$BRANCH"/PKGBUILD" 601 | GITDIR=Github6 602 | maincheck 603 | if [ "$setrepoadd" == "1" ]; then 604 | setrepoaddgithub6=1 605 | setrepoadd=0 606 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null 607 | fi 608 | # Function for checked and failed to build packages 609 | checked_and_failed_pkgs 610 | done <"$GITHUBSOURCECUSTOM5" #< $GITHUBSOURCE1 611 | } 612 | # 613 | # Additional Gitlab repo 614 | # Update, install, build packages from Gitlab repos with available PKGBUILD 615 | function gitlabversion() { 616 | while IFS="" read -r p || [ -n "$p" ]; do 617 | case "$p" in \#*) continue ;; esac 618 | echo "" 619 | cd "$DIR" || exit 620 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 621 | GITHUBBINARY=$GITLABBINARY 622 | BRANCH=$BRANCHGITLAB 623 | GITHUBCLONEURL=$GITLABCLONEURL 624 | GITHUBURL="$GITLABURLC"$p"/-/raw/"$BRANCH"/PKGBUILD" 625 | GITDIR=Gitlab1 626 | maincheck 627 | if [ "$setrepoadd" == "1" ]; then 628 | setrepoaddgitlab1=1 629 | setrepoadd=0 630 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null 631 | fi 632 | # Function for checked and failed to build packages 633 | checked_and_failed_pkgs 634 | done <"$GITLABSOURCE" #< $GITHUBSOURCE1 635 | } 636 | # 637 | # Additional Custom Gitlab repo 638 | # Update, install, build packages from Gitlab repos with available PKGBUILD 639 | function gitlabversioncustom() { 640 | while IFS="" read -r p || [ -n "$p" ]; do 641 | case "$p" in \#*) continue ;; esac 642 | echo "" 643 | cd "$DIR" || exit 644 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 645 | GITHUBBINARY=$GITLABBINARYCUSTOM 646 | BRANCH=$BRANCHGITLABCUSTOM 647 | GITHUBCLONEURL=$GITLABCLONEURLCUSTOM 648 | GITHUBURL="$GITLABURLCCUSTOM"$p"/-/raw/"$BRANCH"/PKGBUILD" 649 | GITDIR=Gitlab2 650 | maincheck 651 | if [ "$setrepoadd" == "1" ]; then 652 | setrepoaddgitlab2=1 653 | setrepoadd=0 654 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null 655 | fi 656 | # Function for checked and failed to build packages 657 | checked_and_failed_pkgs 658 | done <"$GITLABSOURCECUSTOM" #< $GITHUBSOURCE1 659 | } 660 | # 661 | # Additional Custom Gitlab repo extra 2 662 | # Update, install, build packages from Gitlab repos with available PKGBUILD 663 | function gitlabversioncustom2() { 664 | while IFS="" read -r p || [ -n "$p" ]; do 665 | case "$p" in \#*) continue ;; esac 666 | echo "" 667 | cd "$DIR" || exit 668 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 669 | GITHUBBINARY=$GITLABBINARYCUSTOM2 670 | BRANCH=$BRANCHGITLABCUSTOM2 671 | GITHUBCLONEURL=$GITLABCLONEURLCUSTOM2 672 | GITHUBURL="$GITLABURLCCUSTOM2"$p"/-/raw/"$BRANCH"/PKGBUILD" 673 | GITDIR=Gitlab3 674 | maincheck 675 | if [ "$setrepoadd" == "1" ]; then 676 | setrepoaddgitlab3=1 677 | setrepoadd=0 678 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null 679 | fi 680 | # Function for checked and failed to build packages 681 | checked_and_failed_pkgs 682 | done <"$GITLABSOURCECUSTOM2" #< $GITHUBSOURCE1 683 | } 684 | # 685 | # Additional Custom Gitlab repo extra 3 686 | # Update, install, build packages from Gitlab repos with available PKGBUILD 687 | function gitlabversioncustom3() { 688 | while IFS="" read -r p || [ -n "$p" ]; do 689 | case "$p" in \#*) continue ;; esac 690 | echo "" 691 | cd "$DIR" || exit 692 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 693 | GITHUBBINARY=$GITLABBINARYCUSTOM3 694 | BRANCH=$BRANCHGITLABCUSTOM3 695 | GITHUBCLONEURL=$GITLABCLONEURLCUSTOM3 696 | GITHUBURL="$GITLABURLCCUSTOM3"$p"/-/raw/"$BRANCH"/PKGBUILD" 697 | GITDIR=Gitlab4 698 | maincheck 699 | if [ "$setrepoadd" == "1" ]; then 700 | setrepoaddgitlab4=1 701 | setrepoadd=0 702 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null 703 | fi 704 | # Function for checked and failed to build packages 705 | checked_and_failed_pkgs 706 | done <"$GITLABSOURCECUSTOM3" #< $GITHUBSOURCE1 707 | } 708 | # 709 | # 710 | # Additional Custom Gitlab repo extra 3 711 | # Update, install, build packages from Gitlab repos with available PKGBUILD 712 | function gitlabversioncustom4() { 713 | while IFS="" read -r p || [ -n "$p" ]; do 714 | case "$p" in \#*) continue ;; esac 715 | echo "" 716 | cd "$DIR" || exit 717 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 718 | GITHUBBINARY=$GITLABBINARYCUSTOM4 719 | BRANCH=$BRANCHGITLABCUSTOM4 720 | GITHUBCLONEURL=$GITLABCLONEURLCUSTOM4 721 | GITHUBURL="$GITLABURLCCUSTOM4"$p"/-/raw/"$BRANCH"/PKGBUILD" 722 | GITDIR=Gitlab5 723 | maincheck 724 | if [ "$setrepoadd" == "1" ]; then 725 | setrepoaddgitlab5=1 726 | setrepoadd=0 727 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null 728 | fi 729 | # Function for checked and failed to build packages 730 | checked_and_failed_pkgs 731 | done <"$GITLABSOURCECUSTOM4" #< $GITHUBSOURCE1 732 | } 733 | # 734 | # 735 | # Additional Custom Gitlab repo extra 3 736 | # Update, install, build packages from Gitlab repos with available PKGBUILD 737 | function gitlabversioncustom5() { 738 | while IFS="" read -r p || [ -n "$p" ]; do 739 | case "$p" in \#*) continue ;; esac 740 | echo "" 741 | cd "$DIR" || exit 742 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 743 | GITHUBBINARY=$GITLABBINARYCUSTOM5 744 | BRANCH=$BRANCHGITLABCUSTOM5 745 | GITHUBCLONEURL=$GITLABCLONEURLCUSTOM5 746 | GITHUBURL="$GITLABURLCCUSTOM5"$p"/-/raw/"$BRANCH"/PKGBUILD" 747 | GITDIR=Gitlab6 748 | maincheck 749 | if [ "$setrepoadd" == "1" ]; then 750 | setrepoaddgitlab6=1 751 | setrepoadd=0 752 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null 753 | fi 754 | # Function for checked and failed to build packages 755 | checked_and_failed_pkgs 756 | done <"$GITLABSOURCECUSTOM5" #< $GITHUBSOURCE1 757 | } 758 | # 759 | # Additional AUR repo 760 | # Update, install, build packages from AUR 761 | function aur() { 762 | while IFS="" read -r p || [ -n "$p" ]; do 763 | case "$p" in \#*) continue ;; esac 764 | echo "" 765 | cd "$DIR" || exit 766 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 767 | GITHUBBINARY=$AURBINARY 768 | BRANCH=master 769 | GITHUBURL="$AURCLONEURL""$p" 770 | GITHUBCLONEURL="$AURURL" 771 | GITDIR=AUR 772 | maincheck 773 | if [ "$setrepoadd" == "1" ]; then 774 | setrepoaddaur=1 775 | setrepoadd=0 776 | printf '%s\n' "$p"-["$GITHUBBINARY"] | tee -a "$COMPILEDPKGS" &>/dev/null 777 | fi 778 | # Function for checked and failed to build packages 779 | checked_and_failed_pkgs 780 | done <"$AURSOURCE" #< $GITHUBSOURCE1 781 | } 782 | # 783 | # Run the script once 784 | function manualsync() { 785 | 786 | clear 787 | 788 | setreposync=0 789 | 790 | time { 791 | if [ "$SETGITHUBREPO" == "1" ]; then 792 | githubversion 793 | echo "" 794 | echo -e "$GITHUBMSG" 795 | # Local pacman repository update - rename repo to your preference 796 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddgithub1" == "1" ]; then 797 | echo -e "\e[1mUpdating Database ...\e[0m" 798 | $REPOADDCMD "$DIR"/"$GITHUBBINARY"/"$GITHUBBINARY".db.tar.gz "$DIR"/"$GITHUBBINARY"/*.pkg.* &>/dev/null 799 | setrepoaddgithub1=0 800 | setreposync=1 801 | fi 802 | fi 803 | if [ "$SETCUSTGITHUBREPO" == "1" ]; then 804 | githubversioncustom 805 | echo "" 806 | echo -e "$GITHUBMSGCUST" 807 | # Local pacman repository update - rename repo to your preference 808 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddgithub2" == "1" ]; then 809 | echo -e "\e[1mUpdating Database ...\e[0m" 810 | $REPOADDCMD "$DIR"/"$GITHUBBINARYCUSTOM"/"$GITHUBBINARYCUSTOM".db.tar.gz "$DIR"/"$GITHUBBINARYCUSTOM"/*.pkg.* &>/dev/null 811 | setrepoaddgithub2=0 812 | setreposync=1 813 | fi 814 | fi 815 | if [ "$SETCUSTGITHUBREPO2" == "1" ]; then 816 | githubversioncustom2 817 | echo "" 818 | echo -e "$GITHUBMSGCUST2" 819 | # Local pacman repository update - rename repo to your preference 820 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddgithub3" == "1" ]; then 821 | echo -e "\e[1mUpdating Database ...\e[0m" 822 | $REPOADDCMD "$DIR"/"$GITHUBBINARYCUSTOM2"/"$GITHUBBINARYCUSTOM2".db.tar.gz "$DIR"/"$GITHUBBINARYCUSTOM2"/*.pkg.* &>/dev/null 823 | setrepoaddgithub3=0 824 | setreposync=1 825 | fi 826 | fi 827 | if [ "$SETCUSTGITHUBREPO3" == "1" ]; then 828 | githubversioncustom3 829 | echo "" 830 | echo -e "$GITHUBMSGCUST3" 831 | # Local pacman repository update - rename repo to your preference 832 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddgithub4" == "1" ]; then 833 | echo -e "\e[1mUpdating Database ...\e[0m" 834 | $REPOADDCMD "$DIR"/"$GITHUBBINARYCUSTOM3"/"$GITHUBBINARYCUSTOM3".db.tar.gz "$DIR"/"$GITHUBBINARYCUSTOM3"/*.pkg.* &>/dev/null 835 | setrepoaddgithub4=0 836 | setreposync=1 837 | fi 838 | fi 839 | if [ "$SETCUSTGITHUBREPO4" == "1" ]; then 840 | githubversioncustom4 841 | echo "" 842 | echo -e "$GITHUBMSGCUST4" 843 | # Local pacman repository update - rename repo to your preference 844 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddgithub5" == "1" ]; then 845 | echo -e "\e[1mUpdating Database ...\e[0m" 846 | $REPOADDCMD "$DIR"/"$GITHUBBINARYCUSTOM4"/"$GITHUBBINARYCUSTOM4".db.tar.gz "$DIR"/"$GITHUBBINARYCUSTOM4"/*.pkg.* &>/dev/null 847 | setrepoaddgithub5=0 848 | setreposync=1 849 | fi 850 | fi 851 | if [ "$SETCUSTGITHUBREPO5" == "1" ]; then 852 | githubversioncustom5 853 | echo "" 854 | echo -e "$GITHUBMSGCUST5" 855 | # Local pacman repository update - rename repo to your preference 856 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddgithub6" == "1" ]; then 857 | echo -e "\e[1mUpdating Database ...\e[0m" 858 | $REPOADDCMD "$DIR"/"$GITHUBBINARYCUSTOM5"/"$GITHUBBINARYCUSTOM5".db.tar.gz "$DIR"/"$GITHUBBINARYCUSTOM5"/*.pkg.* &>/dev/null 859 | setrepoaddgithub6=0 860 | setreposync=1 861 | fi 862 | fi 863 | if [ "$SETGITLABREPO" == "1" ]; then 864 | gitlabversion 865 | echo "" 866 | echo -e "$GITLABMSG" 867 | # Local pacman repository update - rename repo to your preference 868 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddgitlab1" == "1" ]; then 869 | echo -e "\e[1mUpdating Database ...\e[0m" 870 | $REPOADDCMD "$DIR"/"$GITLABBINARY"/"$GITLABBINARY".db.tar.gz "$DIR"/"$GITLABBINARY"/*.pkg.* &>/dev/null 871 | setrepoaddgitlab1=0 872 | setreposync=1 873 | fi 874 | fi 875 | if [ "$SETGITLABREPOCUSTOM" == "1" ]; then 876 | gitlabversioncustom 877 | echo "" 878 | echo -e "$GITLABMSGCUST" 879 | # Local pacman repository update - rename repo to your preference 880 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddgitlab2" == "1" ]; then 881 | echo -e "\e[1mUpdating Database ...\e[0m" 882 | $REPOADDCMD "$DIR"/"$GITLABBINARYCUSTOM"/"$GITLABBINARYCUSTOM".db.tar.gz "$DIR"/"$GITLABBINARYCUSTOM"/*.pkg.* &>/dev/null 883 | setrepoaddgitlab2=0 884 | setreposync=1 885 | fi 886 | fi 887 | if [ "$SETGITLABREPOCUSTOM2" == "1" ]; then 888 | gitlabversioncustom2 889 | echo "" 890 | echo -e "$GITLABMSGCUST2" 891 | # Local pacman repository update - rename repo to your preference 892 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddgitlab3" == "1" ]; then 893 | echo -e "\e[1mUpdating Database ...\e[0m" 894 | $REPOADDCMD "$DIR"/"$GITLABBINARYCUSTOM2"/"$GITLABBINARYCUSTOM2".db.tar.gz "$DIR"/"$GITLABBINARYCUSTOM2"/*.pkg.* &>/dev/null 895 | setrepoaddgitlab3=0 896 | setreposync=1 897 | fi 898 | fi 899 | if [ "$SETGITLABREPOCUSTOM3" == "1" ]; then 900 | gitlabversioncustom3 901 | echo "" 902 | echo -e "$GITLABMSGCUST3" 903 | # Local pacman repository update - rename repo to your preference 904 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddgitlab4" == "1" ]; then 905 | echo -e "\e[1mUpdating Database ...\e[0m" 906 | $REPOADDCMD "$DIR"/"$GITLABBINARYCUSTOM3"/"$GITLABBINARYCUSTOM3".db.tar.gz "$DIR"/"$GITLABBINARYCUSTOM3"/*.pkg.* &>/dev/null 907 | setrepoaddgitlab4=0 908 | setreposync=1 909 | fi 910 | fi 911 | if [ "$SETGITLABREPOCUSTOM4" == "1" ]; then 912 | gitlabversioncustom4 913 | echo "" 914 | echo -e "$GITLABMSGCUST4" 915 | # Local pacman repository update - rename repo to your preference 916 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddgitlab5" == "1" ]; then 917 | echo -e "\e[1mUpdating Database ...\e[0m" 918 | $REPOADDCMD "$DIR"/"$GITLABBINARYCUSTOM4"/"$GITLABBINARYCUSTOM4".db.tar.gz "$DIR"/"$GITLABBINARYCUSTOM4"/*.pkg.* &>/dev/null 919 | setrepoaddgitlab5=0 920 | setreposync=1 921 | fi 922 | fi 923 | if [ "$SETGITLABREPOCUSTOM5" == "1" ]; then 924 | gitlabversioncustom5 925 | echo "" 926 | echo -e "$GITLABMSGCUST5" 927 | # Local pacman repository update - rename repo to your preference 928 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddgitlab6" == "1" ]; then 929 | echo -e "\e[1mUpdating Database ...\e[0m" 930 | $REPOADDCMD "$DIR"/"$GITLABBINARYCUSTOM5"/"$GITLABBINARYCUSTOM5".db.tar.gz "$DIR"/"$GITLABBINARYCUSTOM5"/*.pkg.* &>/dev/null 931 | setrepoaddgitlab6=0 932 | setreposync=1 933 | fi 934 | fi 935 | if [ "$AURREPO" == "1" ]; then 936 | aur 937 | echo "" 938 | echo -e "$AURMSG" 939 | # Local pacman repository update - rename repo to your preference 940 | if [ "$REPOADD" == "1" ] && [ "$setrepoaddaur" == "1" ]; then 941 | echo -e "\e[1mUpdating Database ...\e[0m" 942 | $REPOADDCMD "$DIR"/"$AURBINARY"/"$AURBINARY".db.tar.gz "$DIR"/"$AURBINARY"/*.pkg.* &>/dev/null 943 | setrepoaddaur=0 944 | setreposync=1 945 | fi 946 | fi 947 | # Print output summary 948 | if [ -e "$CHECKEDPKGS" ]; then 949 | echo "" 950 | checked=$(cat "$CHECKEDPKGS" | wc -l) 951 | echo -e " \e[3m🗱 Checked Package(s): $checked\e[0m" 952 | rm -rf "$CHECKEDPKGS" &>/dev/null 953 | fi 954 | if [ -e "$COMPILEDPKGS" ]; then 955 | checked=$(cat "$COMPILEDPKGS" | wc -l) 956 | echo -e " \e[3m🗱 Compiled Package(s): $checked\e[0m" 957 | cat -b "$COMPILEDPKGS" 958 | rm -rf "$COMPILEDPKGS" &>/dev/null 959 | fi 960 | if [ -e "$FAILEDPKGS" ]; then 961 | checked=$(cat "$FAILEDPKGS" | wc -l) 962 | echo -e " \e[3m🗱 Failed to Build: $checked\e[0m" 963 | cat -b "$FAILEDPKGS" 964 | rm -rf "$FAILEDPKGS" &>/dev/null 965 | fi 966 | # Run repo-sync if enabled 967 | repo_rsync 968 | echo "" 969 | echo -e "\e[1m Elapsed Time: \e[0m" 970 | } 971 | } 972 | # 973 | # Run the script in a loop 974 | function main() { 975 | while true; do 976 | manualsync 977 | echo "" 978 | echo -e "\e[1mPress \e[7m[Ctrl]\e[0m+\e[1m\e[7m[C]\e[0m \e[1mto stop \e[3mautogit\e[0m" 979 | countdown() { 980 | secs=$timer 981 | shift 982 | while [ "$secs" -gt 0 ]; do 983 | printf "\r\033[KWaiting %.d seconds for next sync ..." $((secs--)) 984 | sleep 1 985 | done 986 | echo 987 | } 988 | countdown 989 | sleep 1 && main 990 | 991 | # wait for input, e.g. by pressing ENTER: 992 | read -r 993 | 994 | done 995 | # close while-loop 996 | } 997 | # 998 | # Select the source to edit for the fzf menu 999 | function pkgchooser() { 1000 | # Check if -e (edit) is run for a different text 1001 | if [ "$edit" == "1" ]; then 1002 | # shellcheck disable=SC2120 1003 | editfzf() { 1004 | cd "$DIR"/reponames || exit 1005 | files=() 1006 | while IFS= read -r -d '' file; do 1007 | files+=("$file") 1008 | done < <(ls "$DIR"/reponames | fzf -i --reverse --info=inline --prompt="Enter string > " --header=" ENTER to edit package(s) 1009 | from selected source file(s). 1010 | ESC to quit." --preview "cat $DIR/reponames/{}" --no-unicode "$(if (($(tput cols) >= 80)); then echo "--preview-window=right:55%:wrap"; else echo "--preview-window=bottom:60%:wrap"; fi)" --multi --print0) 1011 | 1012 | ((${#files})) || return 1013 | "${VISUAL:-${EDITOR:-vi}}" "$@" "${files[@]}" 1014 | } 1015 | editfzf 1016 | else 1017 | # Check if -d (DRY RUN) is run for a different text 1018 | if [ "$dryrun" == "1" ]; then 1019 | # Select the source to edit 1020 | SELECTFILE=$(ls "$DIR"/reponames | fzf -i --reverse --info=inline --prompt="Enter string > " --header=" ENTER to remove package(s) 1021 | from selected source file. 1022 | ESC to quit. [DRY RUN] " --preview "cat $DIR/reponames/{}" --no-unicode "$(if (($(tput cols) >= 80)); then echo "--preview-window=right:55%:wrap"; else echo "--preview-window=bottom:60%:wrap"; fi)" | xargs -ro >"$DIR"/reponames/.selected.txt) 1023 | $SELECTFILE 1024 | else 1025 | # Check if -b (REBUILD) is run for a different text 1026 | if [ "$rebuild" == "1" ]; then 1027 | # Select the source to edit 1028 | SELECTFILE=$(ls "$DIR"/reponames | fzf -i --reverse --info=inline --prompt="Enter string > " --header=" ENTER to rebuild package(s) 1029 | from selected source file. 1030 | ESC to quit. " --preview "cat $DIR/reponames/{}" --no-unicode "$(if (($(tput cols) >= 80)); then echo "--preview-window=right:55%:wrap"; else echo "--preview-window=bottom:60%:wrap"; fi)" | xargs -ro >"$DIR"/reponames/.selected.txt) 1031 | $SELECTFILE 1032 | else 1033 | # Select the source to edit 1034 | SELECTFILE=$(ls "$DIR"/reponames | fzf -i --reverse --info=inline --prompt="Enter string > " --header=" ENTER to remove package(s) 1035 | from selected source file. 1036 | ESC to quit. " --preview "cat $DIR/reponames/{}" --no-unicode "$(if (($(tput cols) >= 80)); then echo "--preview-window=right:55%:wrap"; else echo "--preview-window=bottom:60%:wrap"; fi)" | xargs -ro >"$DIR"/reponames/.selected.txt) 1037 | $SELECTFILE 1038 | fi 1039 | fi 1040 | fi 1041 | 1042 | # Open file content to manipulate it 1043 | # Check if -d (DRY RUN) is run for a different text 1044 | if [ "$dryrun" == "1" ]; then 1045 | if [ -s "$DIR"/reponames/.selected.txt ]; then 1046 | GETSELECTED=$(cat "$DIR"/reponames/.selected.txt) 1047 | OPENFILE=$(cat "$DIR"/reponames/"$GETSELECTED" | fzf -i --multi --reverse --info=inline --prompt="Enter string > " --header=" TAB key to (un)select. 1048 | ENTER to remove selected source(s), binary(s) 1049 | and package list entry(s). ESC to quit. [DRY RUN] " | xargs -ro >"$DIR"/reponames/.output.txt) 1050 | $OPENFILE 1051 | awk -v ORS='\n' '{ for (i = 1; i <= NF; i++) print $i }' "$DIR"/reponames/.output.txt >"$DIR"/reponames/.toremove.txt 1052 | 1053 | # Set a start flag for the "removepkgs" function when the second fzf menu has been run 1054 | startflag=1 1055 | fi 1056 | else 1057 | # Open file content to manipulate it 1058 | # Check if -b (REBUILD) is run for a different text 1059 | if [ "$rebuild" == "1" ]; then 1060 | if [ -s "$DIR"/reponames/.selected.txt ]; then 1061 | GETSELECTED=$(cat "$DIR"/reponames/.selected.txt) 1062 | OPENFILE=$(cat "$DIR"/reponames/"$GETSELECTED" | fzf -i --multi --reverse --info=inline --prompt="Enter string > " --header=" TAB key to (un)select. 1063 | ENTER to rebuild selected package(s) 1064 | ESC to quit. " | xargs -ro >"$DIR"/reponames/.output.txt) 1065 | $OPENFILE 1066 | awk -v ORS='\n' '{ for (i = 1; i <= NF; i++) print $i }' "$DIR"/reponames/.output.txt >"$DIR"/reponames/.toremove.txt 1067 | 1068 | # Set a start flag for the "removepkgs" function when the second fzf menu has been run 1069 | startflag=1 1070 | fi 1071 | else 1072 | # Open file content to manipulate it 1073 | if [ -s "$DIR"/reponames/.selected.txt ]; then 1074 | GETSELECTED=$(cat "$DIR"/reponames/.selected.txt) 1075 | OPENFILE=$(cat "$DIR"/reponames/"$GETSELECTED" | fzf -i --multi --reverse --info=inline --prompt="Enter string > " --header=" TAB key to (un)select. 1076 | ENTER to remove selected source(s), binary(s) 1077 | and package list entry(s). ESC to quit. " | xargs -ro >"$DIR"/reponames/.output.txt) 1078 | $OPENFILE 1079 | awk -v ORS='\n' '{ for (i = 1; i <= NF; i++) print $i }' "$DIR"/reponames/.output.txt >"$DIR"/reponames/.toremove.txt 1080 | 1081 | # Set a start flag for the "removepkgs" function when the second fzf menu has been run 1082 | startflag=1 1083 | fi 1084 | fi 1085 | fi 1086 | } 1087 | 1088 | # Remove selected package(s) 1089 | function removepkgs() { 1090 | clear 1091 | while IFS="" read -r p || [ -n "$p" ]; do 1092 | echo "" 1093 | cd "$DIR" || exit 1094 | printf '\e[1;36m%-6s\e[m%s\n' "𝌤 $p" # Print package list entry 1095 | # Use the eval function which resolves in this example the GETSELECTED variable before the awk is run. 1096 | SOURCEPKGDIR=$(eval "awk '/""${GETSELECTED}""/ && /SOURCE/'" '"$DIR"/autogit.conf' | grep -E -o ".{0,20}=" | rev | cut -c 2- | rev) # Find Reponame for source folder 1097 | if [ "$SOURCEPKGDIR" == "GITHUBSOURCE" ]; then 1098 | PKGDIR=Github1 1099 | PKGBIN=$GITHUBBINARY 1100 | else 1101 | if [ "$SOURCEPKGDIR" == "GITHUBSOURCECUSTOM" ]; then 1102 | PKGDIR=Github2 1103 | PKGBIN=$GITHUBBINARYCUSTOM 1104 | else 1105 | if [ "$SOURCEPKGDIR" == "GITHUBSOURCECUSTOM2" ]; then 1106 | PKGDIR=Github3 1107 | PKGBIN=$GITHUBBINARYCUSTOM2 1108 | else 1109 | if [ "$SOURCEPKGDIR" == "GITHUBSOURCECUSTOM3" ]; then 1110 | PKGDIR=Github4 1111 | PKGBIN=$GITHUBBINARYCUSTOM3 1112 | else 1113 | if [ "$SOURCEPKGDIR" == "GITHUBSOURCECUSTOM4" ]; then 1114 | PKGDIR=Github5 1115 | PKGBIN=$GITHUBBINARYCUSTOM4 1116 | else 1117 | if [ "$SOURCEPKGDIR" == "GITHUBSOURCECUSTOM5" ]; then 1118 | PKGDIR=Github6 1119 | PKGBIN=$GITHUBBINARYCUSTOM5 1120 | else 1121 | if [ "$SOURCEPKGDIR" == "GITLABSOURCE" ]; then 1122 | PKGDIR=Gitlab1 1123 | PKGBIN=$GITLABBINARY 1124 | else 1125 | if [ "$SOURCEPKGDIR" == "GITLABSOURCECUSTOM" ]; then 1126 | PKGDIR=Gitlab2 1127 | PKGBIN=$GITLABBINARYCUSTOM 1128 | else 1129 | if [ "$SOURCEPKGDIR" == "GITLABSOURCECUSTOM2" ]; then 1130 | PKGDIR=Gitlab3 1131 | PKGBIN=$GITLABBINARYCUSTOM2 1132 | else 1133 | if [ "$SOURCEPKGDIR" == "GITLABSOURCECUSTOM3" ]; then 1134 | PKGDIR=Gitlab4 1135 | PKGBIN=$GITLABBINARYCUSTOM3 1136 | else 1137 | if [ "$SOURCEPKGDIR" == "GITLABSOURCECUSTOM4" ]; then 1138 | PKGDIR=Gitlab5 1139 | PKGBIN=$GITLABBINARYCUSTOM4 1140 | else 1141 | if [ "$SOURCEPKGDIR" == "GITLABSOURCECUSTOM5" ]; then 1142 | PKGDIR=Gitlab6 1143 | PKGBIN=$GITLABBINARYCUSTOM5 1144 | else 1145 | if [ "$SOURCEPKGDIR" == "AURSOURCE" ]; then 1146 | PKGDIR=AUR 1147 | PKGBIN=$AURBINARY 1148 | fi 1149 | fi 1150 | fi 1151 | fi 1152 | fi 1153 | fi 1154 | fi 1155 | fi 1156 | fi 1157 | fi 1158 | fi 1159 | fi 1160 | fi 1161 | echo """$DIR""/packages/$PKGDIR/""$p""" | tee "$DIR"/reponames/.rm.txt &>/dev/null 1162 | location=$(cat "$DIR"/reponames/.rm.txt) #Source package folder to remove 1163 | 1164 | if [ "$dryrun" == "1" ]; then 1165 | if [ -e "$location" ]; then # If file exists (source file folder) 1166 | echo -e "\e[1m\e[32m==>\e[0m \e[1mFound Source:\e[0m \e[1m"\""$location"\""\e[0m" 1167 | echo -e "\e[1m\e[34m -> Removing Source Folder ...\e[0m" 1168 | echo "Dry Run" 1169 | else 1170 | echo " ⇒ No Package Source Files Found" 1171 | echo "Dry Run" 1172 | fi 1173 | else 1174 | if [ -e "$location" ]; then # If file exists (source file folder) 1175 | echo -e "\e[1m\e[32m==>\e[0m \e[1mFound Source:\e[0m \e[1m"\""$location"\""\e[0m" 1176 | echo -e "\e[1m\e[34m -> Removing Source Folder ...\e[0m" 1177 | sourcelocation=1 1178 | else 1179 | echo " ⇒ No Package Source Files Found" 1180 | fi 1181 | fi 1182 | 1183 | # Find the Filename 1184 | #cd ""$DIR"/packages/$PKGDIR/"$p"" 1185 | if [ -e "$location" ]; then # If file exists (source file folder) 1186 | cd "$location" || exit 1187 | #ls 1188 | filename1=$(cat PKGBUILD | grep 'pkgbase=' | cut -c 9-) 1189 | filename2=$(cat PKGBUILD | grep 'pkgname=' | cut -c 9-) 1190 | if [ -n "$filename1" ]; then 1191 | filename=$filename1 1192 | if ls "$DIR"/"$PKGBIN" | grep "$filename*.*" | tee "$DIR"/reponames/.rmbin.txt &>/dev/null; then 1193 | locationbin=$(cat "$DIR"/reponames/.rmbin.txt) 1194 | #echo "FILENAME=pkgbase" 1195 | fi 1196 | else 1197 | filename=$filename2 1198 | if ls "$DIR"/"$PKGBIN" | grep "$filename*.*" | tee "$DIR"/reponames/.rmbin.txt &>/dev/null; then 1199 | locationbin=$(cat "$DIR"/reponames/.rmbin.txt) 1200 | #echo "FILENAME=pkgname" 1201 | fi 1202 | fi 1203 | fi 1204 | 1205 | # Delete Binary if exists 1206 | if [ "$dryrun" == "1" ]; then 1207 | if [ -n "$locationbin" ]; then # If file exists (binary folder) 1208 | #echo 1209 | echo -e "\e[1m\e[32m==>\e[0m \e[1mFound Binary:\e[0m" 1210 | echo -e "\e[1m""$locationbin""\e[0m" 1211 | echo -e "\e[1m\e[34m -> Removing Binary ...\e[0m" 1212 | echo "Dry Run" 1213 | 1214 | # Run repo-add 1215 | if [ "$REPOADD" == "1" ]; then 1216 | #echo 1217 | echo -e "\e[1m\e[32m==>\e[0m \e[1mUpdating Database ...\e[0m" 1218 | echo -e "\e[1m\e[34m -> ""$DIR""/""$PKGBIN"" ...\e[0m" 1219 | echo "Dry Run" 1220 | fi 1221 | fi 1222 | else 1223 | if [ -n "$locationbin" ]; then # If file exists (binary) 1224 | #echo 1225 | echo -e "\e[1m\e[32m==>\e[0m \e[1mFound Binary:\e[0m" 1226 | echo -e "\e[1m""$locationbin""\e[0m" 1227 | echo -e "\e[1m\e[34m -> Removing Binary ...\e[0m" 1228 | # Remove old database first as repo-add has no option to remove deleted binary's when updating it 1229 | rm -rf "${DIR:?}"/"$PKGBIN"/*"$PKGBIN"* # remove database 1230 | locationbinn=$(echo "$locationbin") 1231 | rm -rf "${DIR:?}"/"$PKGBIN"/"$locationbinn" # remove binary 1232 | 1233 | # Run repo-add 1234 | if [ "$rebuild" == "1" ]; then 1235 | echo "rebuild" &>/dev/null 1236 | else 1237 | if [ "$REPOADD" == "1" ]; then 1238 | #echo 1239 | echo -e "\e[1m\e[32m==>\e[0m \e[1mUpdating Database ...\e[0m" 1240 | echo -e "\e[1m\e[34m -> ""$DIR""/$PKGBIN ...\e[0m" 1241 | $REPOADDCMD "$DIR"/"$PKGBIN"/"$PKGBIN".db.tar.gz "$DIR"/"$PKGBIN"/*.pkg.* &>/dev/null 1242 | fi 1243 | fi 1244 | fi 1245 | fi 1246 | # remove the source folder here - not before! 1247 | if [ "$sourcelocation" == "1" ]; then 1248 | rm -rf "$location" 1249 | fi 1250 | if [ "$dryrun" == "1" ]; then 1251 | echo -e "\e[1m\e[32m==>\e[0m \e[1mRemoving From List: "\""$p"\""\e[0m" 1252 | echo -e "\e[1m\e[34m -> ""$DIR"/reponames/"$GETSELECTED"" ...\e[0m" 1253 | echo "Dry Run" 1254 | echo -e "\e[7m\e[31m\e[0m\e[0m" 1255 | else 1256 | if [ "$rebuild" == "1" ]; then 1257 | echo -e "\e[1mRebuilding ...\e[0m" 1258 | autogitrun=1 1259 | sleep 3 1260 | else 1261 | echo -e "\e[1m\e[32m==>\e[0m \e[1mRemoving From List: "\""$p"\""\e[0m" 1262 | echo -e "\e[1m\e[34m -> ""$DIR"/reponames/"$GETSELECTED"" ...\e[0m" 1263 | grep -v "$p" "$DIR"/reponames/"$GETSELECTED" >"$DIR"/reponames/.pkglist 1264 | mv "$DIR"/reponames/.pkglist "$DIR"/reponames/"$GETSELECTED" 1265 | echo -e "\e[7m\e[31m\e[0m\e[0m" 1266 | fi 1267 | fi 1268 | 1269 | done \ 1270 | <"$DIR"/reponames/.toremove.txt 1271 | } 1272 | # 1273 | function cleanup() { 1274 | # Clean Up 1275 | rm -rf "$DIR"/reponames/.selected.txt &>/dev/null 1276 | rm -rf "$DIR"/reponames/.output.txt &>/dev/null 1277 | rm -rf "$DIR"/reponames/.toremove.txt &>/dev/null 1278 | rm -rf "$DIR"/reponames/.rm.txt &>/dev/null 1279 | rm -rf "$DIR"/reponames/.rmbin.txt &>/dev/null 1280 | } 1281 | # Run fzf options 1282 | # Flags 1283 | while test $# -gt 0; do 1284 | case "$1" in 1285 | -h | --help) 1286 | echo 1287 | echo -e " Welcome to Autogit's Help Page!" 1288 | echo 1289 | echo -e " Autogit runs by default without flags." 1290 | echo -e " In order to run autogit, edit the options in" 1291 | echo -e " \"""$DIR""/autogit.conf\"" 1292 | echo 1293 | echo -e " The provided flags will run a fzf UI to manage packages." 1294 | echo 1295 | echo -e " autogit [options]:" 1296 | echo -e "" 1297 | echo -e " -e, --edit - [EDIT]" 1298 | echo -e " Edit Package List Entries (Commenting With '#' Is Supported)" 1299 | echo -e " NOTE: Make Sure That The (EDITOR) Environment Variable Is Set On Your System!" 1300 | echo -e "" 1301 | echo -e " -d, --dryrun - [DRY RUN]" 1302 | echo -e " Dry Run To Remove Packages - (Nothing Will Be Touched)" 1303 | echo -e "" 1304 | echo -e " -b, --build - [REBUILD PACKAGES]" 1305 | echo -e " Remove Package Source(s), Binary(s) And Rebuild The Packge(s)" 1306 | echo -e "" 1307 | echo -e " -r, --remove - [REMOVE PACKAGES]" 1308 | echo -e " Remove Package Source(s), Binary(s), Package List Entry(s)," 1309 | echo -e " Old Database Files And Run \"repo-add\" If Enabled" 1310 | echo -e "" 1311 | echo -e " -h, --help - This Help Text" 1312 | echo 1313 | exit 1314 | ;; 1315 | -e | --edit) 1316 | edit=1 1317 | pkgchooser 1318 | cleanup # needs to be run as last because we need to remove files when fzf has been quit with "ESC" 1319 | exit # this "exit" command is needed to prevent the UI from loading! 1320 | ;; 1321 | -d | --dryrun) 1322 | echo "Dry Run" 1323 | dryrun=1 1324 | pkgchooser 1325 | if [ "$startflag" == "1" ]; then 1326 | removepkgs 1327 | fi 1328 | cleanup # needs to be run as last because we need to remove files when fzf has been quit with "ESC" 1329 | exit # this "exit" command is needed to prevent the UI from loading! 1330 | ;; 1331 | -b | --build) 1332 | rebuild=1 1333 | pkgchooser 1334 | # pkgchooser runs the whole script 1335 | if [ "$startflag" == "1" ]; then 1336 | removepkgs 1337 | if [ "$autogitrun" == "1" ]; then 1338 | # run autogit 1339 | cd || exit 1340 | autogit 1341 | fi 1342 | fi 1343 | cleanup # needs to be run as last because we need to remove files when fzf has been quit with "ESC" 1344 | exit # this "exit" command is needed to prevent the UI from loading! 1345 | ;; 1346 | -r | --remove) 1347 | pkgchooser 1348 | if [ "$startflag" == "1" ]; then 1349 | removepkgs 1350 | fi 1351 | cleanup # needs to be run as last because we need to remove files when fzf has been quit with "ESC" 1352 | exit # this "exit" command is needed to prevent the UI from loading! 1353 | ;; 1354 | 1355 | *) 1356 | echo -e "Wrong Option, Please run \"autogit -h\"" 1357 | exit 1358 | ;; 1359 | esac 1360 | done 1361 | # 1362 | # Sync all enabled repositories to a custom location via "rsync" 1363 | function repo_rsync() { 1364 | # Check if the option is enabled 1365 | if [ "$REPOSYNC" == "1" ]; then 1366 | # Define an array with variable names for local repos 1367 | repositories=("$GITHUBBINARY" "$GITHUBBINARYCUSTOM" "$GITHUBBINARYCUSTOM2" "$GITHUBBINARYCUSTOM3" "$GITHUBBINARYCUSTOM4" "$GITHUBBINARYCUSTOM5" "$GITLABBINARY" "$GITLABBINARYCUSTOM" "$GITLABBINARYCUSTOM2" "$GITLABBINARYCUSTOM3" "$GITLABBINARYCUSTOM4" "$GITLABBINARYCUSTOM5" "$AURBINARY") 1368 | declare -A unique_names 1369 | # Loop through the original array 1370 | for name in "${repositories[@]}"; do 1371 | # Check if the name is already in the unique_names array 1372 | if [[ ! "${unique_names[$name]}" ]]; then 1373 | # If not, add it to the unique_names array 1374 | unique_names[$name]=1 1375 | fi 1376 | done 1377 | # Check if the unique names are repositories 1378 | echo "" 1379 | echo -e "Processing \e[1mREPOSYNC\e[0m..." 1380 | for name in "${!unique_names[@]}"; do 1381 | # Perform actions for each name 1382 | cd "$DIR" || exit 1383 | # If destination repo exists 1384 | if [ -e "$DIR"/"$name" ] && [ -e "$REPOPATH"/"$name" ] && [ "$setreposync" == "1" ]; then 1385 | echo "" 1386 | echo -e "Found \"$name\" in \"$REPOPATH"\" 1387 | echo -e "Syncing \e[7m[$name]\e[0m ..." 1388 | if ! $RSYNCCMD "$DIR"/"$name" "$REPOPATH"/; then 1389 | echo "Failed with user permissions, trying root..." 1390 | if sudo $RSYNCCMD "$DIR"/"$name" "$REPOPATH"/; then 1391 | echo -e "Done!" 1392 | else 1393 | echo -e "Something went wrong, exit." 1394 | exit 1 1395 | fi 1396 | fi 1397 | else 1398 | if [ -e "$DIR"/"$name" ] && [ -e "$REPOPATH"/"$name" ]; then 1399 | echo "" 1400 | echo "Found \"$name\" in \"$REPOPATH"\" 1401 | echo "Next repo-sync on database update!" 1402 | fi 1403 | fi 1404 | # If destination repo does not exist 1405 | if [ -e "$DIR"/"$name" ] && [ ! -d "$REPOPATH"/"$name" ]; then 1406 | echo "" 1407 | echo -e "\"$name\" repository does not exist in \"$REPOPATH"\" 1408 | echo -e "Syncing \e[7m[$name]\e[0m ..." 1409 | if ! $RSYNCCMD "$DIR"/"$name" "$REPOPATH"/; then 1410 | echo "Failed with user permissions, trying root..." 1411 | if sudo $RSYNCCMD "$DIR"/"$name" "$REPOPATH"/; then 1412 | echo -e "Done!" 1413 | else 1414 | echo -e "Something went wrong, exit." 1415 | exit 1 1416 | fi 1417 | fi 1418 | fi 1419 | done 1420 | fi 1421 | } 1422 | 1423 | # 1424 | # Start script without flags 1425 | function modecheck() { 1426 | # Trap (ctrl-c) 1427 | trap killproc INT 1428 | 1429 | if [ "$mode" == "1" ]; then 1430 | main 1431 | else 1432 | if [ "$mode" == "2" ]; then 1433 | manualsync 1434 | fi 1435 | fi 1436 | if [ "$newconfig" == "1" ]; then 1437 | clear 1438 | echo "" 1439 | echo -e " \e[1mLocal configuration generated in \e[7m$DIR\e[0m" 1440 | echo "" 1441 | echo -e " \e[1mplease configure \e[7mautogit.conf\e[0m \e[1mfor usage!\e[0m" 1442 | echo "" 1443 | fi 1444 | } 1445 | modecheck 1446 | --------------------------------------------------------------------------------