mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-05 05:20:34 +00:00
Merge pull request #1533 from xzhang1/add-version
`Release` file: support `Version` field
This commit is contained in:
@@ -24,7 +24,8 @@
|
||||
}
|
||||
],
|
||||
"Storage": "",
|
||||
"Suite": ""
|
||||
"Suite": "",
|
||||
"Version": ""
|
||||
},
|
||||
{
|
||||
"AcquireByHash": false,
|
||||
@@ -50,7 +51,8 @@
|
||||
}
|
||||
],
|
||||
"Storage": "",
|
||||
"Suite": ""
|
||||
"Suite": "",
|
||||
"Version": ""
|
||||
},
|
||||
{
|
||||
"AcquireByHash": false,
|
||||
@@ -77,7 +79,8 @@
|
||||
}
|
||||
],
|
||||
"Storage": "",
|
||||
"Suite": ""
|
||||
"Suite": "",
|
||||
"Version": ""
|
||||
},
|
||||
{
|
||||
"AcquireByHash": false,
|
||||
@@ -104,6 +107,7 @@
|
||||
}
|
||||
],
|
||||
"Storage": "",
|
||||
"Suite": ""
|
||||
"Suite": "",
|
||||
"Version": ""
|
||||
}
|
||||
]
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
Finalizing metadata files...
|
||||
Signing file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
|
||||
Local repo local-repo has been successfully published.
|
||||
Please setup your webserver to serve directory '${HOME}/.aptly/public' with autoindexing.
|
||||
Now you can add following line to apt sources:
|
||||
deb http://your-server/ maverick contrib
|
||||
deb-src http://your-server/ maverick contrib
|
||||
Don't forget to add your GPG key to apt with apt-key.
|
||||
|
||||
You can also use `aptly serve` to publish your repositories over HTTP quickly.
|
||||
@@ -0,0 +1,12 @@
|
||||
Origin: . maverick
|
||||
Label: label37
|
||||
Suite: maverick
|
||||
Version: 13.3
|
||||
Codename: maverick
|
||||
Architectures: i386
|
||||
Components: contrib
|
||||
Description: Generated by aptly
|
||||
MD5Sum:
|
||||
SHA1:
|
||||
SHA256:
|
||||
SHA512:
|
||||
@@ -23,5 +23,6 @@
|
||||
}
|
||||
],
|
||||
"Storage": "",
|
||||
"Suite": ""
|
||||
"Suite": "",
|
||||
"Version": ""
|
||||
}
|
||||
|
||||
@@ -23,5 +23,6 @@
|
||||
}
|
||||
],
|
||||
"Storage": "",
|
||||
"Suite": ""
|
||||
"Suite": "",
|
||||
"Version": ""
|
||||
}
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Origin: aptly24
|
||||
Label: . squeeze
|
||||
Suite: squeeze
|
||||
Version: 13.3
|
||||
Codename: squeeze
|
||||
NotAutomatic: yes
|
||||
ButAutomaticUpgrades: yes
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Origin: LP-PPA-gladky-anton-gnuplot
|
||||
Label: . maverick
|
||||
Suite: maverick
|
||||
Version: 13.3
|
||||
Codename: maverick
|
||||
Signed-By: a,string
|
||||
Architectures: amd64 i386
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
Origin: earth
|
||||
Label: fun
|
||||
Suite: maverick
|
||||
Version: 13.3
|
||||
Codename: maverick
|
||||
Architectures: i386
|
||||
Components: main
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
Loading packages...
|
||||
Generating metadata files and linking package files...
|
||||
Finalizing metadata files...
|
||||
Signing file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
Clearsigning file 'Release' with gpg, please enter your passphrase when prompted:
|
||||
Cleaning up published repository ./maverick...
|
||||
Cleaning up component 'main'...
|
||||
|
||||
Published local repository ./maverick [i386, source] publishes {main: [local-repo]} has been updated successfully.
|
||||
@@ -0,0 +1,11 @@
|
||||
Origin: . maverick
|
||||
Label: . maverick
|
||||
Suite: maverick
|
||||
Codename: maverick
|
||||
Architectures: i386
|
||||
Components: main
|
||||
Description: Generated by aptly
|
||||
MD5Sum:
|
||||
SHA1:
|
||||
SHA256:
|
||||
SHA512:
|
||||
@@ -1005,3 +1005,22 @@ class PublishRepo36Test(BaseTest):
|
||||
# verify byte-identical output
|
||||
second_release = self.read_file('public/dists/maverick/Release')
|
||||
self.check_equal(first_release, second_release)
|
||||
|
||||
|
||||
class PublishRepo37Test(BaseTest):
|
||||
"""
|
||||
publish repo: custom version
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly repo create local-repo",
|
||||
"aptly repo add local-repo ${files}",
|
||||
]
|
||||
runCmd = "aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick -component=contrib -label=label37 -version=13.3 local-repo"
|
||||
gold_processor = BaseTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
super(PublishRepo37Test, self).check()
|
||||
|
||||
# verify contents except of sums
|
||||
self.check_file_contents(
|
||||
'public/dists/maverick/Release', 'release', match_prepare=strip_processor)
|
||||
|
||||
@@ -690,7 +690,7 @@ class PublishSnapshot23Test(BaseTest):
|
||||
|
||||
class PublishSnapshot24Test(BaseTest):
|
||||
"""
|
||||
publish snapshot: custom origin, notautomatic and butautomaticupgrades
|
||||
publish snapshot: custom origin, version, notautomatic and butautomaticupgrades
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixturePool = True
|
||||
@@ -698,7 +698,7 @@ class PublishSnapshot24Test(BaseTest):
|
||||
"aptly snapshot create snap24 from mirror gnuplot-maverick",
|
||||
]
|
||||
sortOutput = True
|
||||
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze -origin=aptly24 -notautomatic=yes -butautomaticupgrades=yes snap24"
|
||||
runCmd = "aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=squeeze -origin=aptly24 -version=13.3 -notautomatic=yes -butautomaticupgrades=yes snap24"
|
||||
gold_processor = BaseTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
|
||||
@@ -607,7 +607,7 @@ class PublishSwitch16Test(BaseTest):
|
||||
|
||||
class PublishSwitch17Test(BaseTest):
|
||||
"""
|
||||
publish switch: signed-by
|
||||
publish switch: signed-by, version
|
||||
"""
|
||||
fixtureDB = True
|
||||
fixturePool = True
|
||||
@@ -616,7 +616,7 @@ class PublishSwitch17Test(BaseTest):
|
||||
"aptly snapshot create snap2 from mirror gnuplot-maverick",
|
||||
"aptly publish snapshot -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick snap1",
|
||||
]
|
||||
runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -signed-by=a,string maverick snap2"
|
||||
runCmd = "aptly publish switch -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -signed-by=a,string -version=13.3 maverick snap2"
|
||||
gold_processor = BaseTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
|
||||
@@ -629,7 +629,7 @@ class PublishUpdate19Test(BaseTest):
|
||||
|
||||
class PublishUpdate20Test(BaseTest):
|
||||
"""
|
||||
publish update: update label and origin
|
||||
publish update: update label, origin, version
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly repo create local-repo",
|
||||
@@ -637,7 +637,7 @@ class PublishUpdate20Test(BaseTest):
|
||||
"aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick -skip-bz2 local-repo",
|
||||
"aptly repo remove local-repo pyspi"
|
||||
]
|
||||
runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -label=fun -origin=earth maverick"
|
||||
runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -label=fun -origin=earth -version=13.3 maverick"
|
||||
gold_processor = BaseTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
@@ -647,3 +647,25 @@ class PublishUpdate20Test(BaseTest):
|
||||
|
||||
# verify contents except of sums
|
||||
self.check_file_contents('public/dists/maverick/Release', 'release', match_prepare=strip_processor)
|
||||
|
||||
|
||||
class PublishUpdate21Test(BaseTest):
|
||||
"""
|
||||
publish update: update version with empty value
|
||||
"""
|
||||
fixtureCmds = [
|
||||
"aptly repo create local-repo",
|
||||
"aptly repo add local-repo ${files}/",
|
||||
"aptly publish repo -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -distribution=maverick -skip-bz2 -version=13.3 local-repo",
|
||||
"aptly repo remove local-repo pyspi"
|
||||
]
|
||||
runCmd = "aptly publish update -keyring=${files}/aptly.pub -secret-keyring=${files}/aptly.sec -version='' maverick"
|
||||
gold_processor = BaseTest.expand_environ
|
||||
|
||||
def check(self):
|
||||
super(PublishUpdate21Test, self).check()
|
||||
|
||||
self.check_exists('public/dists/maverick/InRelease')
|
||||
|
||||
# verify contents except of sums
|
||||
self.check_file_contents('public/dists/maverick/Release', 'release', match_prepare=strip_processor)
|
||||
|
||||
@@ -48,6 +48,7 @@ class PublishAPITestRepo(APITest):
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
@@ -94,6 +95,7 @@ class PublishAPITestRepo(APITest):
|
||||
'Distribution': distribution,
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': './' + distribution,
|
||||
@@ -166,6 +168,7 @@ class PublishAPITestRepoMultiDist(APITest):
|
||||
'Distribution': 'bookworm',
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'bookworm',
|
||||
@@ -232,6 +235,7 @@ class PublishAPITestRepoSignedBy(APITest):
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
@@ -283,6 +287,7 @@ class PublishSnapshotAPITest(APITest):
|
||||
"ButAutomaticUpgrades": "yes",
|
||||
"Origin": "earth",
|
||||
"Label": "fun",
|
||||
"Version": "13.3",
|
||||
}
|
||||
)
|
||||
self.check_task(task)
|
||||
@@ -299,6 +304,7 @@ class PublishSnapshotAPITest(APITest):
|
||||
'Distribution': 'squeeze',
|
||||
'Label': 'fun',
|
||||
'Origin': 'earth',
|
||||
"Version": "13.3",
|
||||
'MultiDist': False,
|
||||
'NotAutomatic': 'yes',
|
||||
'ButAutomaticUpgrades': 'yes',
|
||||
@@ -377,6 +383,7 @@ class PublishSnapshotAPITestSignedBy(APITest):
|
||||
'Distribution': 'squeeze',
|
||||
'Label': 'fun',
|
||||
'Origin': 'earth',
|
||||
'Version': '',
|
||||
'MultiDist': False,
|
||||
'NotAutomatic': 'yes',
|
||||
'ButAutomaticUpgrades': 'yes',
|
||||
@@ -441,12 +448,13 @@ class PublishUpdateAPITestRepo(APITest):
|
||||
json={"PackageRefs": ['Psource pyspi 0.6.1-1.4 f8f1daa806004e89']})
|
||||
self.check_task(task)
|
||||
|
||||
# Update and switch AcquireByHash on.
|
||||
# Update and switch AcquireByHash on, Version.
|
||||
task = self.put_task(
|
||||
"/api/publish/" + prefix + "/wheezy",
|
||||
json={
|
||||
"AcquireByHash": True,
|
||||
"Signing": DefaultSigningOptions,
|
||||
"Version": "13.3"
|
||||
}
|
||||
)
|
||||
self.check_task(task)
|
||||
@@ -457,6 +465,7 @@ class PublishUpdateAPITestRepo(APITest):
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
'Version': '13.3',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
@@ -549,6 +558,7 @@ class PublishUpdateAPITestRepoSignedBy(APITest):
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
@@ -629,6 +639,7 @@ class PublishUpdateAPIMultiDist(APITest):
|
||||
'Distribution': 'bookworm',
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'bookworm',
|
||||
@@ -731,6 +742,7 @@ class PublishConcurrentUpdateAPITestRepo(APITest):
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
@@ -830,6 +842,7 @@ class PublishUpdateSkipCleanupAPITestRepo(APITest):
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
@@ -901,6 +914,7 @@ class PublishSwitchAPITestRepo(APITest):
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
'Prefix': prefix,
|
||||
'SignedBy': '',
|
||||
@@ -941,6 +955,7 @@ class PublishSwitchAPITestRepo(APITest):
|
||||
"SkipContents": True,
|
||||
"Label": "fun",
|
||||
"Origin": "earth",
|
||||
"Version": "13.3",
|
||||
})
|
||||
self.check_task(task)
|
||||
repo_expected = {
|
||||
@@ -950,6 +965,7 @@ class PublishSwitchAPITestRepo(APITest):
|
||||
'Distribution': 'wheezy',
|
||||
'Label': 'fun',
|
||||
'Origin': 'earth',
|
||||
'Version': '13.3',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
@@ -1017,6 +1033,7 @@ class PublishSwitchAPITestRepoSignedBy(APITest):
|
||||
'Codename': '',
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
'Version': '',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Origin': '',
|
||||
@@ -1053,6 +1070,7 @@ class PublishSwitchAPITestRepoSignedBy(APITest):
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
@@ -1113,6 +1131,7 @@ class PublishSwitchAPISkipCleanupTestRepo(APITest):
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
'Prefix': prefix,
|
||||
'SignedBy': '',
|
||||
@@ -1152,6 +1171,7 @@ class PublishSwitchAPISkipCleanupTestRepo(APITest):
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'Path': prefix + '/' + 'otherdist',
|
||||
'Prefix': prefix,
|
||||
'SignedBy': '',
|
||||
@@ -1194,6 +1214,7 @@ class PublishSwitchAPISkipCleanupTestRepo(APITest):
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
@@ -1258,6 +1279,7 @@ class PublishShowAPITestRepo(APITest):
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
'Prefix': prefix,
|
||||
'SignedBy': '',
|
||||
@@ -1850,6 +1872,7 @@ class PublishUpdateSourcesAPITestRepo(APITest):
|
||||
"SkipContents": True,
|
||||
"Label": "fun",
|
||||
"Origin": "earth",
|
||||
"Version": "13.3",
|
||||
}
|
||||
).status_code, 200)
|
||||
|
||||
@@ -1860,6 +1883,7 @@ class PublishUpdateSourcesAPITestRepo(APITest):
|
||||
'Distribution': 'wheezy',
|
||||
'Label': 'fun',
|
||||
'Origin': 'earth',
|
||||
'Version': '13.3',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
@@ -1915,6 +1939,7 @@ class PublishAPITestDualSignature(APITest):
|
||||
'Distribution': 'wheezy',
|
||||
'Label': '',
|
||||
'Origin': '',
|
||||
'Version': '',
|
||||
'NotAutomatic': '',
|
||||
'ButAutomaticUpgrades': '',
|
||||
'Path': prefix + '/' + 'wheezy',
|
||||
|
||||
Reference in New Issue
Block a user