null+****@clear*****
null+****@clear*****
2012年 5月 29日 (火) 14:22:57 JST
Kouhei Sutou 2012-05-29 14:22:57 +0900 (Tue, 29 May 2012) New Revision: e834f87cb25d353890ebcd52940244302e80cd4a Log: apt: move packages to repositories/ Modified files: packages/apt/Makefile.am packages/apt/sign-packages.sh packages/apt/sign-repository.sh packages/apt/update-repository.sh Modified: packages/apt/Makefile.am (+13 -10) =================================================================== --- packages/apt/Makefile.am 2012-05-29 13:59:32 +0900 (e903c69) +++ packages/apt/Makefile.am 2012-05-29 14:22:57 +0900 (275c834) @@ -1,3 +1,4 @@ +REPOSITORIES_PATH = repositories DISTRIBUTIONS = debian ubuntu CHROOT_BASE = /var/lib/chroot ARCHITECTURES = i386 amd64 @@ -8,24 +9,26 @@ all: release: build sign-packages update-repository sign-repository upload remove-existing-packages: - for distribution in $(DISTRIBUTIONS); do \ - find $${distribution}/pool -type f -delete; \ + for distribution in $(DISTRIBUTIONS); do \ + find $(REPOSITORIES_PATH)/$${distribution}/pool \ + -type f -delete; \ done download: - for distribution in $(DISTRIBUTIONS); do \ - rsync -avz --progress --delete \ - $(RSYNC_PATH)/$${distribution}/ $${distribution}; \ + for distribution in $(DISTRIBUTIONS); do \ + rsync -avz --progress --delete \ + $(RSYNC_PATH)/$${distribution}/ $(REPOSITORIES_PATH)/; \ done sign-packages: - ./sign-packages.sh '$(GPG_UID)' '$(CODES)' + ./sign-packages.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODES)' update-repository: - ./update-repository.sh '$(PACKAGE_NAME)' '$(ARCHITECTURES)' '$(CODES)' + ./update-repository.sh '$(PACKAGE_NAME)' '$(REPOSITORIES_PATH)/' \ + '$(ARCHITECTURES)' '$(CODES)' sign-repository: - ./sign-repository.sh '$(GPG_UID)' '$(CODES)' + ./sign-repository.sh '$(GPG_UID)' '$(REPOSITORIES_PATH)/' '$(CODES)' ensure-rsync-path: @if test -z "$(RSYNC_PATH)"; then \ @@ -35,7 +38,7 @@ ensure-rsync-path: upload: ensure-rsync-path for distribution in $(DISTRIBUTIONS); do \ - (cd $${distribution}; \ + (cd $(REPOSITORIES_PATH)/$${distribution}; \ rsync -avz --progress --delete \ dists pool $(RSYNC_PATH)/$${distribution}; \ ); \ @@ -43,7 +46,7 @@ upload: ensure-rsync-path build: source ./build-in-chroot.sh \ - $(PACKAGE) $(VERSION) $(CHROOT_BASE) \ + $(PACKAGE) $(VERSION) $(REPOSITORIES_PATH)/ $(CHROOT_BASE) \ '$(ARCHITECTURES)' '$(CODES)' source: ../$(PACKAGE)-$(VERSION).tar.gz Modified: packages/apt/sign-packages.sh (+7 -6) =================================================================== --- packages/apt/sign-packages.sh 2012-05-29 13:59:32 +0900 (12677c3) +++ packages/apt/sign-packages.sh 2012-05-29 14:22:57 +0900 (6e865d6) @@ -2,14 +2,15 @@ script_base_dir=`dirname $0` -if [ $# != 2 ]; then - echo "Usage: $0 GPG_UID CODES" - echo " e.g.: $0 'F10399C0' 'lenny unstable hardy karmic'" +if [ $# != 3 ]; then + echo "Usage: $0 GPG_UID DESITINATION CODES" + echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'" exit 1 fi GPG_UID=$1 -CODES=$2 +DESTINATION=$2 +CODES=$3 run() { @@ -30,8 +31,8 @@ for code_name in ${CODES}; do ;; esac - base_directory=${distribution} - debsign --re-sign -k${GPG_UID} \ + base_directory=${DESTINATION}${distribution} + debsign -pgpg2 --re-sign -k${GPG_UID} \ $(find ${base_directory} -name '*.dsc' -or -name '*.changes') & if [ "${PARALLEL}" != "yes" ]; then wait Modified: packages/apt/sign-repository.sh (+5 -5) =================================================================== --- packages/apt/sign-repository.sh 2012-05-29 13:59:32 +0900 (ce6ca55) +++ packages/apt/sign-repository.sh 2012-05-29 14:22:57 +0900 (34969a8) @@ -3,13 +3,14 @@ script_base_dir=`dirname $0` if [ $# != 2 ]; then - echo "Usage: $0 GPG_UID CODES" - echo " e.g.: $0 'F10399C0' 'lenny unstable hardy karmic'" + echo "Usage: $0 GPG_UID DESTINATION CODES" + echo " e.g.: $0 'F10399C0' repositories/ 'lenny unstable hardy karmic'" exit 1 fi GPG_UID=$1 -CODES=$2 +DESTINATION=$2 +CODES=$3 run() { @@ -30,11 +31,10 @@ for code_name in ${CODES}; do ;; esac - release=${distribution}/dists/${code_name}/Release + release=${DESTINATION}${distribution}/dists/${code_name}/Release rm -f ${release}.gpg gpg2 --sign --detach-sign --armor \ --local-user ${GPG_UID} \ - --local-user 1C837F31 \ --output ${release}.gpg \ ${release} & Modified: packages/apt/update-repository.sh (+15 -9) =================================================================== --- packages/apt/update-repository.sh 2012-05-29 13:59:32 +0900 (09248ed) +++ packages/apt/update-repository.sh 2012-05-29 14:22:57 +0900 (65ebb9c) @@ -2,15 +2,16 @@ script_base_dir=`dirname $0` -if [ $# != 3 ]; then - echo "Usage: $0 PROJECT_NAME ARCHITECTURES CODES" - echo " e.g.: $0 mroonga 'i386 amd64' 'lenny unstable hardy karmic'" +if [ $# != 4 ]; then + echo "Usage: $0 PROJECT_NAME DESTINATION ARCHITECTURES CODES" + echo " e.g.: $0 mroonga repositories/ 'i386 amd64' 'lenny unstable hardy karmic'" exit 1 fi PROJECT_NAME=$1 -ARCHITECTURES=$2 -CODES=$3 +DESTINATION=$2 +ARCHITECTURES=$3 +CODES=$4 run() { @@ -88,7 +89,7 @@ Tree "dists/${code_name}" { }; EOF apt-ftparchive generate generate-${code_name}.conf - chmod 644 dists/${code_name}/Contents* + chmod 644 dists/${code_name}/Contents-* rm -f dists/${code_name}/Release* rm -f *.db @@ -118,7 +119,12 @@ for code_name in ${CODES}; do ;; esac - mkdir -p ${distribution} - (cd ${distribution} - update_repository $distribution $code_name $component) + mkdir -p ${DESTINATION}${distribution} + (cd ${DESTINATION}${distribution} + update_repository $distribution $code_name $component) & + if [ "${PARALLEL}" != "yes" ]; then + wait + fi done + +wait