diff options
Diffstat (limited to 'pbs-absrepo-convert')
-rwxr-xr-x | pbs-absrepo-convert | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/pbs-absrepo-convert b/pbs-absrepo-convert index 901b924..417c2da 100755 --- a/pbs-absrepo-convert +++ b/pbs-absrepo-convert @@ -16,7 +16,9 @@ abort() { } ## -# Usage: collect-data +# Usage: collect-data MODE +# MODE is either 'correct' or 'fast' +# # Assumptions: # - currently in a working copy of the repo # - git branch "master" exists and is untouched @@ -29,9 +31,17 @@ abort() { ## collect-data() { msg "$(gettext "Collecting package data...")" - [[ $# = 0 ]] || { usage; return 1; } + [[ $# = 1 ]] || { usage; return 1; } + local mode=$1 - git log --pretty=format:'%H' master > "${TMPDIR}/commits" + case "$mode" in + correct) + git log --pretty=format:'%H' master > "${TMPDIR}/commits";; + fast) + echo master > "${TMPDIR}/commits";; + *) + usage; return 1;; + esac # actual data collection ############################################### local count="$(wc -l < "${TMPDIR}/commits")" @@ -116,6 +126,8 @@ convert-packages() { # - currently in a working copy of the repo # Effects: # - creates git branch "${ARCH}" +# - TMPDIR is set +# - creates file "${TMPDIR}/missing-packages.${ARCH}" # Side effects: # - changes git working tree # - prints output of git commands @@ -124,10 +136,17 @@ convert-arch() { [[ $# = 1 ]] || { usage; return 1; } local arch=$1 + touch "${PKGDIR}/missing-packages.${arch}.tmp" + git checkout orig git checkout -b "$arch" git filter-branch -f --tree-filter \ "pbs-absrepo-convert--filterpackage $arch" "$arch" + + sort -u \ + < "${PKGDIR}/missing-packages.${arch}.tmp" \ + > "${PKGDIR}/missing-packages.${arch}" + rm -f "${PKGDIR}/missing-packages.${arch}.tmp" } ## @@ -165,7 +184,7 @@ main() { cd "${TMPDIR}/repo" git checkout -b orig git checkout master - collect-data + collect-data fast git branch -D master # main ################################################################# |