Making workaround for apt-get source actually working in backports-included-but-not...
authorDaniel Baumann <mail@daniel-baumann.ch>
Wed, 18 Sep 2013 06:38:24 +0000 (08:38 +0200)
committerDaniel Baumann <mail@daniel-baumann.ch>
Wed, 18 Sep 2013 07:49:03 +0000 (09:49 +0200)
scripts/build/source_debian

index ca506b9..a619288 100755 (executable)
@@ -116,15 +116,19 @@ case "${LB_MODE}" in
                                ;;
 
                        *)
-                               if grep -qs "-backports" chroot/etc/apt/sources.list.d/progress-linux.list
+                               if grep -qs "${LB_DISTRIBUTION}-backports" chroot/etc/apt/sources.list.d/progress-linux.list
                                then
+                                       cp chroot/etc/apt/sources.list.d/progress-linux.list chroot/etc/apt/sources.list.d/progress-linux.list.orig
+
                                        while read _LINE
                                        do
                                                if echo "${_LINE}" | grep -qs ${LB_DISTRIBUTION}-backports
                                                then
                                                        sed -i -e "s|${_LINE}|#${_LINE}|" chroot/etc/apt/sources.list.d/progress-linux.list
                                                fi
-                                       done < chroot/etc/apt/sources.list.d/progress-linux.list
+                                       done < chroot/etc/apt/sources.list.d/progress-linux.list.orig
+
+                                       Apt chroot update
                                fi
                                ;;
                esac
@@ -183,5 +187,13 @@ do
        mv chroot/"${SOURCE}"_* source/debian/"${LETTER}"/"${SOURCE}"
 done
 
+# Reverting apt sources again
+if [ -e chroot/etc/apt/sources.list.d/progress-linux.list.orig ]
+then
+       mv chroot/etc/apt/sources.list.d/progress-linux.list.orig chroot/etc/apt/sources.list.d/progress-linux.list
+
+       Apt chroot update
+fi
+
 # Creating stage file
 Create_stagefile .build/source_debian