diff options
author | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-11-03 01:05:47 -0400 |
---|---|---|
committer | Luke Shumaker <LukeShu@sbcglobal.net> | 2012-11-03 01:05:47 -0400 |
commit | ec48dd455397e1653ac7ba6810435c9d1a7cf2f9 (patch) | |
tree | 106bffed1e610781ef9a14725e917d9fa9095a68 /pbs-absrepo-convert | |
parent | d2ef0c1c9925ec7f4d7494dd20a9c73451587592 (diff) |
add a fast (but slightly incorrect) mode for absrepo-convert's collect-data
and make convert-arch able to deal with it
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 ################################################################# |