[Trisquel-devel] Rev 51: Added conditional gpg signing method in file:///home/bzr/package-helpers/trunk/

Ruben Rodriguez ruben at trisquel.info
Sat Jun 9 17:03:25 CEST 2012


At file:///home/bzr/package-helpers/trunk/

------------------------------------------------------------
revno: 51
revision-id: ruben en trisquel.info-20120609150236-55w30frhkfycctru
parent: ruben en trisquel.info-20120601031016-a920xympf0i6knnr
committer: Ruben Rodriguez <ruben en trisquel.info>
branch nick: trunk
timestamp: Sat 2012-06-09 17:02:36 +0200
message:
  Added conditional gpg signing method
------------ pr�xima parte ------------
=== modified file 'makepackage'
--- a/makepackage	2012-05-31 15:00:43 +0000
+++ b/makepackage	2012-06-09 15:02:36 +0000
@@ -21,6 +21,7 @@
 
 export DEBIAN_FRONTEND=noninteractive
 MEM=$(cat /proc/meminfo |grep MemTotal| awk '{print $2}')
+GPGKEY=8D8AEBF1
 
 for VAR in LANG LANGUAGE LC_ALL LC_TIME LC_MONETARY LC_ADDRESS LC_TELEPHONE LC_MESSAGES LC_NAME LC_MEASUREMENT LC_IDENTIFICATION LC_IDENTIFICATION LC_NUMERIC LC_PAPER LANG
 do
@@ -62,6 +63,12 @@
 Log: $i.log
 Description: Trisquel GNU/Linux packages for the $i based release
 EOF
+
+if gpg -K | grep -q $GPGKEY
+then
+    echo "SignWith: $GPGKEY" >> repos/$i/conf/distributions
+fi
+
 cd repos/$i
 reprepro -v export
 cd ../..
@@ -95,6 +102,13 @@
 
     disablescripts
 
+    if gpg -K | grep $GPGKEY -q
+    then
+        cp /root/.gnupg $CHROOT/root -a
+    else
+        echo GPG private key for $GPGKEY not found, the packages and repositories will not be signed.
+    fi
+
     echo $DISTRO-$ARCH  > $CHROOT/etc/debian_chroot
 cat << EOF > $CHROOT/etc/apt/sources.list
 deb $MIRROR $DISTRO main universe
@@ -162,7 +176,7 @@
     echo The $DISTRO-$ARCH jail appears to be running $(cat jails/$DISTRO-$ARCH/CurrentlyBuilding |grep Package: |sed 's/Package:\ //'), aborting.
     exit 1
 fi
-    disablescripts
+    CHROOT=jails/$DISTRO-$ARCH disablescripts
 }
 
 tmpumount(){
@@ -241,6 +255,12 @@
 
 for dsc in incoming/*.dsc
 do
+    if gpg -K | grep $GPGKEY -q
+    then
+        debsign -k$GPGKEY $dsc
+    else
+        echo GPG private key for $GPGKEY not found, the packages and repositories will not be signed.
+    fi
     reprepro -v -C main includedsc $DISTRO $dsc || reprepro -S admin -P optional -v -b . -C main includedsc $DISTRO $dsc
 done
 



More information about the Trisquel-devel mailing list