~franz-hsieh/live-build/lb-sg-2.x.columbia

« back to all changes in this revision

Viewing changes to helpers/chroot_sources

  • Committer: Daniel Baumann
  • Date: 2011-03-09 18:17:05 UTC
  • Revision ID: daniel@debian.org-20110309181705-hg63kztvk618a5q4
Adding -r, --repositories option to select preconfigured third-party repositories more easily.

Show diffs side-by-side

added added

removed removed

Lines of Context:
120
120
                        done
121
121
                fi
122
122
 
 
123
                # Configure third-party repositories
 
124
                if [ -n "${LH_REPOSITORIES}" ]
 
125
                then
 
126
                        for REPOSITORY in ${LH_REPOSITORIES}
 
127
                        do
 
128
                                for PLACE in config/repositories "${LH_BASE}/repositories"
 
129
                                do
 
130
                                        # Prefer repositories from the config tree
 
131
                                        # over the global ones.
 
132
                                        if ! ls "${PLACE}/${REPOSITORY}"* > /dev/null 2>&1
 
133
                                        then
 
134
                                                continue
 
135
                                        fi
 
136
 
 
137
                                        # Adding sources.list entries (chroot)
 
138
                                        if [ -e "${PLACE}/${REPOSITORY}.chroot" ]
 
139
                                        then
 
140
                                                sed -e "s|@DISTRIBUTION@|${LH_DISTRIBUTION}|g" \
 
141
                                                    -e "s|@ARCHIVE_AREAS@|${LH_ARCHIVE_AREAS}|g" \
 
142
                                                "${PLACE}/${REPOSITORY}.chroot" > \
 
143
                                                "chroot/etc/apt/sources.list.d/${REPOSITORY}.list"
 
144
                                        elif [ -e "${PLACE}/${REPOSITORY}" ]
 
145
                                        then
 
146
                                                sed -e "s|@DISTRIBUTION@|${LH_DISTRIBUTION}|g" \
 
147
                                                    -e "s|@ARCHIVE_AREAS@|${LH_ARCHIVE_AREAS}|g" \
 
148
                                                "${PLACE}/${REPOSITORY}" > \
 
149
                                                "chroot/etc/apt/sources.list.d/${REPOSITORY}.list"
 
150
                                        fi
 
151
 
 
152
                                        if [ "${LH_APT_SECURE}" != false ]
 
153
                                        then
 
154
                                                # Adding archive signing keys (chroot)
 
155
                                                if [ -e "${PLACE}/${REPOSITORY}.chroot.gpg" ]
 
156
                                                then
 
157
                                                        cat "${PLACE}/${REPOSITORY}.chroot.gpg" | Chroot chroot "apt-key add -"
 
158
                                                elif [ -e "${PLACE}/${REPOSITORY}.gpg" ]
 
159
                                                then
 
160
                                                        cat "${PLACE}/${REPOSITORY}.gpg" | Chroot chroot "apt-key add -"
 
161
                                                fi
 
162
                                        fi
 
163
                                done
 
164
                        done
 
165
                fi
 
166
 
123
167
                # Configure local package repository
124
168
                if Find_files config/chroot_local-packages/*.deb
125
169
                then
453
497
                        esac
454
498
                fi
455
499
 
 
500
                # Configure third-party repositories
 
501
                if [ -n "${LH_REPOSITORIES}" ]
 
502
                then
 
503
                        for REPOSITORY in ${LH_REPOSITORIES}
 
504
                        do
 
505
                                # Removing sources.list entries (chroot)
 
506
                                rm -f "chroot/etc/apt/sources.list.d/${REPOSITORY}.list"
 
507
 
 
508
                                for PLACE in config/repositories "${LH_BASE}/repositories"
 
509
                                do
 
510
                                        # Prefer repositories from the config tree
 
511
                                        # over the global ones.
 
512
                                        if ! ls "${PLACE}/${REPOSITORY}"* > /dev/null 2>&1
 
513
                                        then
 
514
                                                continue
 
515
                                        fi
 
516
 
 
517
                                        # Adding sources.list entries (binary)
 
518
                                        if [ -e "${PLACE}/${REPOSITORY}.binary" ]
 
519
                                        then
 
520
                                                sed -e "s|@DISTRIBUTION@|${LH_DISTRIBUTION}|g" \
 
521
                                                    -e "s|@ARCHIVE_AREAS@|${LH_ARCHIVE_AREAS}|g" \
 
522
                                                "${PLACE}/${REPOSITORY}.binary" > \
 
523
                                                "chroot/etc/apt/sources.list.d/${REPOSITORY}.list"
 
524
                                        elif [ -e "${PLACE}/${REPOSITORY}" ]
 
525
                                        then
 
526
                                                sed -e "s|@DISTRIBUTION@|${LH_DISTRIBUTION}|g" \
 
527
                                                    -e "s|@ARCHIVE_AREAS@|${LH_ARCHIVE_AREAS}|g" \
 
528
                                                "${PLACE}/${REPOSITORY}" > \
 
529
                                                "chroot/etc/apt/sources.list.d/${REPOSITORY}.list"
 
530
                                        fi
 
531
 
 
532
                                        if [ "${LH_APT_SECURE}" != false ]
 
533
                                        then
 
534
                                                # Adding archive signing keys (binary)
 
535
                                                if [ -e "${PLACE}/${REPOSITORY}.binary.gpg" ]
 
536
                                                then
 
537
                                                        cat "${PLACE}/${REPOSITORY}.binary.gpg" | Chroot chroot "apt-key add -"
 
538
                                                elif [ -e "${PLACE}/${REPOSITORY}.gpg" ]
 
539
                                                then
 
540
                                                        cat "${PLACE}/${REPOSITORY}.gpg" | Chroot chroot "apt-key add -"
 
541
                                                fi
 
542
                                        fi
 
543
                                done
 
544
                        done
 
545
                fi
 
546
 
456
547
                # Check local sources.list
457
548
                if Find_files config/chroot_sources/*.binary
458
549
                then