aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOliver Eikemeier <eik@FreeBSD.org>2004-07-07 14:51:17 +0000
committerOliver Eikemeier <eik@FreeBSD.org>2004-07-07 14:51:17 +0000
commit512239b93f5c7d42117ebaf20e544b820f1e2a6f (patch)
tree6488d85e6c225201361043dd0f7f7ce79f2b7b76
parente41c0a0867a1fc0e09a21412896d81b94efab86f (diff)
downloadports-512239b93f5c7d42117ebaf20e544b820f1e2a6f.tar.gz
ports-512239b93f5c7d42117ebaf20e544b820f1e2a6f.zip
Notes
-rw-r--r--devel/portmk/Mk/bsd.port.post.mk32
-rw-r--r--devel/portmk/scripts/distfiles.sh56
-rw-r--r--ports-mgmt/portmk/Mk/bsd.port.post.mk32
-rw-r--r--ports-mgmt/portmk/scripts/distfiles.sh56
4 files changed, 174 insertions, 2 deletions
diff --git a/devel/portmk/Mk/bsd.port.post.mk b/devel/portmk/Mk/bsd.port.post.mk
index c36f5f38a68e..17b8a6db2bdd 100644
--- a/devel/portmk/Mk/bsd.port.post.mk
+++ b/devel/portmk/Mk/bsd.port.post.mk
@@ -1368,6 +1368,38 @@ makesum:
.endif
.endif
+.PHONY: master-sites-all
+.if !target(master-sites-all)
+master-sites-all:
+ @${_FETCHDISTFILES_ENV}; \
+ set -- -t ''; \
+ . '${DISTFILES_SH}'
+.endif
+
+.PHONY: master-sites
+.if !target(master-sites)
+master-sites:
+ @${_FETCHDISTFILES_ENV}; \
+ set -- -t 'DEFAULT'; \
+ . '${DISTFILES_SH}'
+.endif
+
+.PHONY: patch-sites-all
+.if !target(patch-sites-all)
+patch-sites-all:
+ @${_FETCHDISTFILES_ENV}; \
+ set -- -T ''; \
+ . '${DISTFILES_SH}'
+.endif
+
+.PHONY: patch-sites
+.if !target(patch-sites)
+patch-sites:
+ @${_FETCHDISTFILES_ENV}; \
+ set -- -T 'DEFAULT'; \
+ . '${DISTFILES_SH}'
+.endif
+
.PHONY: migratesum
.if !target(migratesum)
migratesum:
diff --git a/devel/portmk/scripts/distfiles.sh b/devel/portmk/scripts/distfiles.sh
index 994d40433bba..18916518d922 100644
--- a/devel/portmk/scripts/distfiles.sh
+++ b/devel/portmk/scripts/distfiles.sh
@@ -568,6 +568,48 @@ do_fetch()
done
}
+###
+# do_list_sites lists {MASTER,PATCH}_SITES
+###
+
+do_list_sites()
+{
+ [ $# -eq 2 ] || return 1
+
+ local select
+
+ case "$1" in
+ MASTER)
+ files="$DISTFILES";;
+ PATCH)
+ files="$PATCHFILES";;
+ *)
+ return 1;;
+ esac
+
+ if [ -n "$2" ]; then
+ select="$2"
+ else
+ select=`echo "$files" | $TR -s ' \t' '\n' | $AWK '
+ /.+:/ {
+ sub(/.+:/, "")
+ g=split($0, a, /,/)
+ for (i in a)
+ group[a[i]]=1
+ next
+ }
+ { group["DEFAULT"]=1 }
+ END {
+ for (g in group)
+ print g
+ }'`
+ fi
+
+ SORTED_MASTER_SITES_TMP=`get_master_sites_sorted "$1" "$select"`
+ echo $_MASTER_SITE_OVERRIDE \
+ $SORTED_MASTER_SITES_TMP $_MASTER_SITE_BACKUP
+}
+
### missing size ###
###
@@ -991,6 +1033,8 @@ do_migratesum2()
# main
###
+opt_list_master=false
+opt_list_patch=false
opt_fetch_list=false
opt_makesum=false
opt_migratesum=false
@@ -999,8 +1043,12 @@ opt_fetch=false
opt_fetch_all=false
opt_missing_size=false
-while getopts "LmMNfFS" opt; do
+while getopts "LmMNfFSt:T:" opt; do
case "$opt" in
+ t) list_master="${OPTARG}";
+ opt_list_master=true;;
+ T) list_patch="${OPTARG}";
+ opt_list_patch=true;;
L) opt_fetch_list=true;;
m) opt_makesum=true;;
M) opt_migratesum=true;;
@@ -1014,6 +1062,12 @@ done
shift $(($OPTIND-1))
+$opt_list_master &&
+ { do_list_sites "MASTER" "$list-master" || exit 1; }
+
+$opt_list_patch &&
+ { do_list_sites "PATCH" "$list_patch" || exit 1; }
+
$opt_fetch_list &&
{ do_fetch_list || exit 1; }
diff --git a/ports-mgmt/portmk/Mk/bsd.port.post.mk b/ports-mgmt/portmk/Mk/bsd.port.post.mk
index c36f5f38a68e..17b8a6db2bdd 100644
--- a/ports-mgmt/portmk/Mk/bsd.port.post.mk
+++ b/ports-mgmt/portmk/Mk/bsd.port.post.mk
@@ -1368,6 +1368,38 @@ makesum:
.endif
.endif
+.PHONY: master-sites-all
+.if !target(master-sites-all)
+master-sites-all:
+ @${_FETCHDISTFILES_ENV}; \
+ set -- -t ''; \
+ . '${DISTFILES_SH}'
+.endif
+
+.PHONY: master-sites
+.if !target(master-sites)
+master-sites:
+ @${_FETCHDISTFILES_ENV}; \
+ set -- -t 'DEFAULT'; \
+ . '${DISTFILES_SH}'
+.endif
+
+.PHONY: patch-sites-all
+.if !target(patch-sites-all)
+patch-sites-all:
+ @${_FETCHDISTFILES_ENV}; \
+ set -- -T ''; \
+ . '${DISTFILES_SH}'
+.endif
+
+.PHONY: patch-sites
+.if !target(patch-sites)
+patch-sites:
+ @${_FETCHDISTFILES_ENV}; \
+ set -- -T 'DEFAULT'; \
+ . '${DISTFILES_SH}'
+.endif
+
.PHONY: migratesum
.if !target(migratesum)
migratesum:
diff --git a/ports-mgmt/portmk/scripts/distfiles.sh b/ports-mgmt/portmk/scripts/distfiles.sh
index 994d40433bba..18916518d922 100644
--- a/ports-mgmt/portmk/scripts/distfiles.sh
+++ b/ports-mgmt/portmk/scripts/distfiles.sh
@@ -568,6 +568,48 @@ do_fetch()
done
}
+###
+# do_list_sites lists {MASTER,PATCH}_SITES
+###
+
+do_list_sites()
+{
+ [ $# -eq 2 ] || return 1
+
+ local select
+
+ case "$1" in
+ MASTER)
+ files="$DISTFILES";;
+ PATCH)
+ files="$PATCHFILES";;
+ *)
+ return 1;;
+ esac
+
+ if [ -n "$2" ]; then
+ select="$2"
+ else
+ select=`echo "$files" | $TR -s ' \t' '\n' | $AWK '
+ /.+:/ {
+ sub(/.+:/, "")
+ g=split($0, a, /,/)
+ for (i in a)
+ group[a[i]]=1
+ next
+ }
+ { group["DEFAULT"]=1 }
+ END {
+ for (g in group)
+ print g
+ }'`
+ fi
+
+ SORTED_MASTER_SITES_TMP=`get_master_sites_sorted "$1" "$select"`
+ echo $_MASTER_SITE_OVERRIDE \
+ $SORTED_MASTER_SITES_TMP $_MASTER_SITE_BACKUP
+}
+
### missing size ###
###
@@ -991,6 +1033,8 @@ do_migratesum2()
# main
###
+opt_list_master=false
+opt_list_patch=false
opt_fetch_list=false
opt_makesum=false
opt_migratesum=false
@@ -999,8 +1043,12 @@ opt_fetch=false
opt_fetch_all=false
opt_missing_size=false
-while getopts "LmMNfFS" opt; do
+while getopts "LmMNfFSt:T:" opt; do
case "$opt" in
+ t) list_master="${OPTARG}";
+ opt_list_master=true;;
+ T) list_patch="${OPTARG}";
+ opt_list_patch=true;;
L) opt_fetch_list=true;;
m) opt_makesum=true;;
M) opt_migratesum=true;;
@@ -1014,6 +1062,12 @@ done
shift $(($OPTIND-1))
+$opt_list_master &&
+ { do_list_sites "MASTER" "$list-master" || exit 1; }
+
+$opt_list_patch &&
+ { do_list_sites "PATCH" "$list_patch" || exit 1; }
+
$opt_fetch_list &&
{ do_fetch_list || exit 1; }