Skip to content
This repository was archived by the owner on Jul 1, 2024. It is now read-only.

Obsidian-StudiosInc/ebuild-batcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

61 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ebuild-batcher.sh

License Build Status

Experimental script for making the same change across all ebuilds that need such change. It can be used for things like bumping EAPI, or making other changes to ebuilds. This can save allot of time by making minor changes against several or all ebuilds in tree.

The script will attempt to make such change for every ebuild specified. If it succeeds it will commit the change to git. If it fails, it will revert all modifications via git reset and checkout. Therefore should be 100% safe to use as any failures are reverted to previous state.

Usage

The script functions off 2 variables and 1 function, all pretty self explanatory. Place the variables and function in a file/script of its own in any location you choose. Default location is in the provided scripts directory. That file/script is passed to ebuild-batcher.sh as the first argument, and sourced before run.

# String commit message
COMMIT_MSG="Change being made"

# Array of ebuilds to be modified
PKGS=( $( grep -ls 'EAPI="\?5"\?' */*/*ebuild  ) )

# Function of commands to run, return 0 on success, 1 on failure
batch_cmds() {
	echo "Making ebuild modification..." || return 1
	return 0
}

Bump slots

Bumping slots on packages is easy using the provided slot-bumper.sh script. Just pass a few arguments;

  1. Package Name
  2. New Slot
  3. Old Slot Pattern, plain or regex

Example

./ebuild-batcher.sh scripts/slot-bumper.sh icu4j 0 59

sed A to B

Sometimes you need to make a change in an ebuild, from A to B. Doing so is trivial with the provided sed_a_b.sh script. Just pass a few arguments;

  1. Commit message prefix, A to B will be added
  2. Replacement sed pattern (A), plain or regex
  3. Replacement (B)

Example

./ebuild-batcher.sh scripts/sed_a_b.sh "Bump eclipse slot" "\"4.6\"" "\"4.7\""

A is used for both grep and sed.

About

Script to make the same change to a batch of ebuilds

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages