Mercurial > hg > aboriginal
comparison sources/functions.sh @ 767:dc19e20734ca
Use the git magic tarball comment field to get the version number of unstable git packages for MANIFEST.
author | Rob Landley <rob@landley.net> |
---|---|
date | Tue, 30 Jun 2009 03:05:04 -0500 |
parents | 879cf963cdbb |
children | 27f007ea2129 |
comparison
equal
deleted
inserted
replaced
766:3d5fdc78af90 | 767:dc19e20734ca |
---|---|
449 | 449 |
450 function identify_release() | 450 function identify_release() |
451 { | 451 { |
452 if unstable "$1" | 452 if unstable "$1" |
453 then | 453 then |
454 for i in "b" "" | |
455 do | |
456 FILE="$(echo "$SRCDIR/alt-$1-"*.tar.$i*)" | |
457 if [ -f "$FILE" ] | |
458 then | |
459 GITID="$(${i}zcat "$FILE" | git get-tar-commit-id)" | |
460 if [ ! -z "$GITID" ] | |
461 then | |
462 # The first dozen chars should form a unique id. | |
463 | |
464 echo $GITID | sed 's/^\(................\).*/git \1/' | |
465 return | |
466 fi | |
467 fi | |
468 done | |
469 | |
454 # Need to extract unstable packages to determine source control version. | 470 # Need to extract unstable packages to determine source control version. |
455 | 471 |
456 EXTRACT_ONLY=1 setupfor "$1" >&2 | 472 EXTRACT_ONLY=1 setupfor "$1" >&2 |
457 DIR="${BUILD}/sources/alt-$1" | 473 DIR="${BUILD}/sources/alt-$1" |
458 | 474 |
464 return 0 | 480 return 0 |
465 elif [ -d "$DIR/.hg" ] | 481 elif [ -d "$DIR/.hg" ] |
466 then | 482 then |
467 ( echo mercurial rev \ | 483 ( echo mercurial rev \ |
468 $(hg tip | sed -n 's/changeset: *\([0-9]*\).*/\1/p') | 484 $(hg tip | sed -n 's/changeset: *\([0-9]*\).*/\1/p') |
469 ) | |
470 return 0 | |
471 elif [ -d "$DIR/.git" ] | |
472 then | |
473 ( echo git rev \ | |
474 $(git show master --pretty=format:%H | | |
475 sed -n '1s/^\(............\).*/\1/p') | |
476 ) | 485 ) |
477 return 0 | 486 return 0 |
478 fi | 487 fi |
479 fi | 488 fi |
480 | 489 |